# HG changeset patch # User Daniele Nicolodi # Date 1425030731 -3600 # Node ID d6a37eca6d92ea4e520df92f54a4d5604bd69022 # Parent b1dc2ba9a315f804b392087876e77e8122673f23 Fix errors in previous commit diff -r b1dc2ba9a315 -r d6a37eca6d92 FXAnalyse.c --- a/FXAnalyse.c Thu Feb 26 23:11:01 2015 +0100 +++ b/FXAnalyse.c Fri Feb 27 10:52:11 2015 +0100 @@ -380,11 +380,11 @@ .fDDS = 70e6, .applied = 0.0, .interval = 30.0, - .t0 = 0.0 - .threshold = 10.0, + .t0 = 0.0, + .threshold = 20.0, // corresponding to a relative frequnecy stability of ~1e-13 .badcount = 0, + .badcountmax = 10, .safety = TRUE, - .badcountmax = 10, }; @@ -428,10 +428,10 @@ // one. If the data point is accepted `count` is reset to zero. int stat_accumulate_resilient(struct stat *stat, double v, double threshold, int *count) { - if ((! isnan(stat.previous) && (fabs(v - stat->previous) > threshold)) { + if (!isnan(stat->previous) && (fabs(v - stat->previous) > threshold)) { // bad data point stat_accumulate(stat, stat->previous); - *count++; + *count += 1; return TRUE; } else { // good data point @@ -454,9 +454,9 @@ logmsg("dedrift: bad data point detected"); // too many consecutive bad data points detected - if ((dedrift.safety) && (dedrift.badcount > &dedrift.badcountmax)) { + if (dedrift.safety && (dedrift.badcount > dedrift.badcountmax)) { + logmsg("dedrift: maximum number of consecutive bad data points exceeded"); dedrift_update_disable(); - logmsg("dedrift: maximum number of consecutive bad data points exceeded"); } } @@ -2035,7 +2035,6 @@ int CVICALLBACK CB_OnStopSlopeCancellingOnUnlocked (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { - int value; switch (event) { case EVENT_COMMIT: