Limit sources included in combining

Combine only sources whose distance is shorter than distance of the
selected source multiplied by the value of combinelimit and their
estimated frequencies are close to the frequency of the selected source.
Add outlyer status for sources which are selectable, but not included in
the combining. The status is displayed as '-' in the chronyc sources
output.
This commit is contained in:
Miroslav Lichvar
2013-06-10 18:37:08 +02:00
parent 18a66a2ba8
commit 52272f4dc5
7 changed files with 91 additions and 8 deletions

23
conf.c
View File

@@ -66,6 +66,7 @@ static void parse_clientloglimit(char *);
static void parse_cmdallow(char *);
static void parse_cmddeny(char *);
static void parse_cmdport(char *);
static void parse_combinelimit(char *);
static void parse_commandkey(char *);
static void parse_corrtimeratio(char *);
static void parse_deny(char *);
@@ -126,6 +127,7 @@ static double max_clock_error = 1.0; /* in ppm */
static double reselect_distance = 1e-4;
static double stratum_weight = 1.0;
static double combine_limit = 3.0;
static int cmd_port = DEFAULT_CANDM_PORT;
@@ -374,6 +376,8 @@ CNF_ReadFile(const char *filename)
parse_cmddeny(p);
} else if (!strcasecmp(command, "cmdport")) {
parse_cmdport(p);
} else if (!strcasecmp(command, "combinelimit")) {
parse_combinelimit(p);
} else if (!strcasecmp(command, "commandkey")) {
parse_commandkey(p);
} else if (!strcasecmp(command, "corrtimeratio")) {
@@ -757,6 +761,17 @@ parse_stratumweight(char *line)
/* ================================================== */
static void
parse_combinelimit(char *line)
{
check_number_of_args(line, 1);
if (sscanf(line, "%lf", &combine_limit) != 1) {
command_parse_error();
}
}
/* ================================================== */
static void
parse_driftfile(char *line)
{
@@ -1630,6 +1645,14 @@ CNF_GetStratumWeight(void)
/* ================================================== */
double
CNF_GetCombineLimit(void)
{
return combine_limit;
}
/* ================================================== */
int
CNF_GetManualEnabled(void)
{