Add dispersion notification handlers

This commit is contained in:
Miroslav Lichvar
2010-02-16 18:16:03 +01:00
parent 8cb6fcad7e
commit 0f70959d8e
4 changed files with 61 additions and 2 deletions

View File

@@ -130,6 +130,8 @@ static int selected_source_index; /* Which source index is currently
static void
slew_sources(struct timeval *raw, struct timeval *cooked, double dfreq, double afreq,
double doffset, int is_step_change, void *anything);
static void
add_dispersion(double dispersion, void *anything);
static char *
source_to_string(SRC_Instance inst);
@@ -144,6 +146,7 @@ void SRC_Initialise(void) {
initialised = 1;
LCL_AddParameterChangeHandler(slew_sources, NULL);
LCL_AddDispersionNotifyHandler(add_dispersion, NULL);
return;
}
@@ -153,6 +156,7 @@ void SRC_Initialise(void) {
void SRC_Finalise(void)
{
LCL_RemoveParameterChangeHandler(slew_sources, NULL);
LCL_RemoveDispersionNotifyHandler(add_dispersion, NULL);
initialised = 0;
return;
}
@@ -807,6 +811,20 @@ slew_sources(struct timeval *raw,
}
/* ================================================== */
/* This routine is called when an indeterminate offset is introduced
into the local time. */
static void
add_dispersion(double dispersion, void *anything)
{
int i;
for (i = 0; i < n_sources; i++) {
SST_AddDispersion(sources[i]->stats, dispersion);
}
}
/* ================================================== */
/* This is called to dump out the source measurement registers */