changeset 256:708de02ef948

Implement limit to frequency adjustment during recenter
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 05 Jun 2015 21:00:54 +0200
parents ada536bc461b
children 8cbfce046d41
files FXAnalyse.c FXAnalyse.h FXAnalyse.uir
diffstat 3 files changed, 208 insertions(+), 150 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Fri Jun 05 18:10:46 2015 +0200
+++ b/FXAnalyse.c	Fri Jun 05 21:00:54 2015 +0200
@@ -257,9 +257,10 @@
 
 
 enum {
-	LO = 1,
-	HG = 2,
-	SR = 4,
+	LO,
+	HG,
+	SR,
+	_N_BEATS,
 };
 
 enum {
@@ -499,24 +500,96 @@
 
 // recenter
 struct recenter {
-	int enabled;		// recenter enabled
-	int lo;				// recenter microwave beatnote
-	int sr;				// recenter Sr beatnote
-	int hg;				// recenter Hg beatnote
-	double interval;	// interval
-	double t0;			// beginning of current interval
+	int active;					// recenter enabled
+	int enabled[_N_BEATS];		// which beatnotes to recenter
+	double threshold[_N_BEATS];	// maximum frequency correction
+	double interval;			// interval
+	double t0;					// beginning of current interval
 };
 
 struct recenter recenter = {
-	.enabled = FALSE,
-	.lo = FALSE,
-	.sr = FALSE,
-	.hg = FALSE,
+	.active = FALSE,
+	.enabled = { FALSE, FALSE, FALSE },
+	.threshold = { 10.0, 2000.0, 2000.0 },
 	.interval = 1800.0,
 	.t0 = 0.0
 };
 
 
+int recenter_enabled()
+{
+	if (! recenter.active)
+		return FALSE;
+	
+	for (int i = 0; i < _N_BEATS; i++)
+		if (recenter.enabled[i])
+			return TRUE;
+
+	return FALSE;
+}
+
+
+void recenter_update()
+{
+	if (! recenter_enabled())
+		return;
+	
+	rollmean_accumulate(&rollmean_ch2, Ch2);
+	rollmean_accumulate(&rollmean_ch3, Ch3);
+	rollmean_accumulate(&rollmean_ch4, Ch4);
+			
+	if ((utc - recenter.t0) > recenter.interval) {
+		
+		if (recenter.enabled[LO]) {
+			// adjust DDS2 frequency to keep Ch4 reading at 275 kHz
+			double freq = ad9912.frequency[1];
+			double adj = 275000.0 - rollmean_ch4.mean;
+			if (fabs(adj) > recenter.threshold[LO]) {
+				logmessage(WARNING, "not recenter ch4 to 275 kHz: DDS2 adjustment=%+3e exceeds threshold", adj);
+			} else {
+				freq = freq + adj;
+				ad9912_set_frequency_w(&ad9912, 1, freq);
+				SetCtrlVal(MainPanel, PANEL_DDS2, ad9912.frequency[1]);
+				logmsg("recenter ch4 to 275 kHz: DDS2 adjustment=%+3e", adj);
+			}
+		}
+				
+		if (recenter.enabled[HG]) {
+			// adjust DDS3 frequency to keep Ch2 reading at 10 kHz
+			double freq = ad9912.frequency[2];
+			double adj = 10000 - rollmean_ch2.mean;
+			if (fabs(adj) > recenter.threshold[HG]) {
+				logmessage(WARNING, "not recenter Hg beatnote (ch2) to 10 kHz: DDS3 adjustment=%+3e exceeds threshold", adj);
+			} else {
+				freq = freq + adj;
+				ad9912_set_frequency_w(&ad9912, 2, freq);
+				SetCtrlVal(MainPanel, PANEL_DDS3, ad9912.frequency[2]);
+				logmsg("recenter Hg beatnote (ch2) to 10 kHz: DDS3 adjustment=%+3e", adj);
+			}
+		}
+			
+		if (recenter.enabled[SR]) {
+			// adjust DDS4 frequency to keep Ch3 reading at 10 kHz
+			double freq = ad9912.frequency[3];
+			double adj = 10000 - rollmean_ch3.mean;
+			if (fabs(adj) > recenter.threshold[SR]) {
+				logmessage(WARNING, "not recenter Sr beatnote (ch3) to 10 kHz: DDS4 adjustment=%+3e exceeds threshold", adj);
+			} else {
+				freq = freq + adj;
+				ad9912_set_frequency_w(&ad9912, 3, freq);
+				SetCtrlVal(MainPanel, PANEL_DDS4, ad9912.frequency[3]);
+				logmsg("recenter Sr beatnote (ch3) to 10 kHz: DDS4 adjustment=%+3e", adj);
+			}
+		}
+				
+		recenter.t0 = utc;
+		rollmean_zero(&rollmean_ch2);
+		rollmean_zero(&rollmean_ch3);
+		rollmean_zero(&rollmean_ch4);
+	}
+}
+
+
 // data loggging
 static char *datafolder;
 
@@ -1474,50 +1547,7 @@
 				dedrift_update(f);
 								
 				// recenter
-				if (recenter.enabled)
-				{
-					rollmean_accumulate(&rollmean_ch2, Ch2);
-					rollmean_accumulate(&rollmean_ch3, Ch3);
-					rollmean_accumulate(&rollmean_ch4, Ch4);
-					
-					if ((utc - recenter.t0) > recenter.interval) {
-		
-						if (recenter.lo) {
-							// adjust DDS2 frequency to keep Ch4 reading at 275 kHz
-							double freq = ad9912.frequency[1];
-							double adj = 275000.0 - rollmean_ch4.mean;
-							freq = freq + adj;
-							ad9912_set_frequency_w(&ad9912, 1, freq);
-							SetCtrlVal(MainPanel, PANEL_DDS2, ad9912.frequency[1]);
-							logmsg("recenter ch4 to 275 kHz: DDS2 adjustment=%+3e", adj);
-						}
-					
-						if (recenter.hg) {
-							// adjust DDS3 frequency to keep Ch2 reading at 10 kHz
-							double freq = ad9912.frequency[2];
-							double adj = 10000 - rollmean_ch2.mean;
-							freq = freq + adj;
-							ad9912_set_frequency_w(&ad9912, 2, freq);
-							SetCtrlVal(MainPanel, PANEL_DDS3, ad9912.frequency[2]);
-							logmsg("recenter Hg beatnote (ch2) to 10 kHz: DDS3 adjustment=%+3e", adj);
-						}
-					
-						if (recenter.sr) {
-							// adjust DDS4 frequency to keep Ch3 reading at 10 kHz
-							double freq = ad9912.frequency[3];
-							double adj = 10000 - rollmean_ch3.mean;
-							freq = freq + adj;
-							ad9912_set_frequency_w(&ad9912, 3, freq);
-							SetCtrlVal(MainPanel, PANEL_DDS4, ad9912.frequency[3]);
-							logmsg("recenter Sr beatnote (ch3) to 10 kHz: DDS4 adjustment=%+3e", adj);
-						}
-					
-						recenter.t0 = utc;
-						rollmean_zero(&rollmean_ch2);
-						rollmean_zero(&rollmean_ch3);
-						rollmean_zero(&rollmean_ch4);
-					}
-				}
+				recenter_update();
 
 				struct tm *time = gmtime(&ev.time.tv_sec);
 				// round to milliseconds
@@ -2021,7 +2051,7 @@
 	switch (event)
 	{
 		case EVENT_COMMIT:
-			GetCtrlVal(panel, control, &recenter.enabled);
+			GetCtrlVal(panel, control, &recenter.active);
 			recenter.t0 = utc;
 			rollmean_zero(&rollmean_ch2);
 			rollmean_zero(&rollmean_ch3);
@@ -2200,13 +2230,36 @@
 			switch (control)
 			{
 				case PANEL_RECENTER_LO:
-					GetCtrlVal(panel, control, &recenter.lo);
+					GetCtrlVal(panel, control, &recenter.enabled[LO]);
 					break;
 				case PANEL_RECENTER_HG:
-					GetCtrlVal(panel, control, &recenter.hg);
+					GetCtrlVal(panel, control, &recenter.enabled[HG]);
 					break;
 				case PANEL_RECENTER_SR:
-					GetCtrlVal(panel, control, &recenter.sr);
+					GetCtrlVal(panel, control, &recenter.enabled[SR]);
+					break;
+			}
+			break;
+	}
+	return 0;
+}
+
+int CVICALLBACK CB_RecenterThreshold (int panel, int control, int event,
+		void *callbackData, int eventData1, int eventData2)
+{
+	switch (event)
+	{
+		case EVENT_COMMIT:
+			switch (control)
+			{
+				case PANEL_RECENTER_THRESHOLD_LO:
+					GetCtrlVal(panel, control, &recenter.threshold[LO]);
+					break;
+				case PANEL_RECENTER_THRESHOLD_HG:
+					GetCtrlVal(panel, control, &recenter.threshold[HG]);
+					break;
+				case PANEL_RECENTER_THRESHOLD_SR:
+					GetCtrlVal(panel, control, &recenter.threshold[SR]);
 					break;
 			}
 			break;
@@ -2409,3 +2462,4 @@
 	}
 	return 0;
 }
+
--- a/FXAnalyse.h	Fri Jun 05 18:10:46 2015 +0200
+++ b/FXAnalyse.h	Fri Jun 05 21:00:54 2015 +0200
@@ -59,95 +59,98 @@
 #define  PANEL_DDS2                       19      /* control type: numeric, callback function: CB_ChangeDDSOut */
 #define  PANEL_TEXTMSG                    20      /* control type: textMsg, callback function: (none) */
 #define  PANEL_TEXTMSG_2                  21      /* control type: textMsg, callback function: (none) */
-#define  PANEL_RECENTER_INTERVAL          22      /* control type: numeric, callback function: CB_RecenterInterval */
-#define  PANEL_SLOPETIME                  23      /* control type: numeric, callback function: CB_ChangeSlopeTime */
-#define  PANEL_DEDRIFT_DDS_FREQ           24      /* control type: numeric, callback function: CB_DedriftDDSFreq */
-#define  PANEL_DDS1                       25      /* control type: numeric, callback function: CB_ChangeDDSOut */
-#define  PANEL_CHANGENDIV                 26      /* control type: numeric, callback function: CB_OnChangeNdiv */
-#define  PANEL_N3                         27      /* control type: numeric, callback function: CB_ChangeN */
-#define  PANEL_N3CALCULUS                 28      /* control type: command, callback function: CB_OnNCalculus */
-#define  PANEL_N1                         29      /* control type: numeric, callback function: CB_ChangeN */
-#define  PANEL_N2                         30      /* control type: numeric, callback function: CB_ChangeN */
-#define  PANEL_N2CALCULUS                 31      /* control type: command, callback function: CB_OnNCalculus */
-#define  PANEL_DDS4STEP                   32      /* control type: ring, callback function: CB_ChangeDDSStep */
-#define  PANEL_DDS3STEP                   33      /* control type: ring, callback function: CB_ChangeDDSStep */
-#define  PANEL_DDS2STEP                   34      /* control type: ring, callback function: CB_ChangeDDSStep */
-#define  PANEL_SLOPE_APPLIED              35      /* control type: numeric, callback function: CB_SetSlope */
-#define  PANEL_PLOT_Math5                 36      /* control type: radioButton, callback function: CB_OnFreqPlot */
-#define  PANEL_PLOT_Math4                 37      /* control type: radioButton, callback function: CB_OnFreqPlot */
-#define  PANEL_ADEV_Math4                 38      /* control type: radioButton, callback function: CB_OnAllanPlot */
-#define  PANEL_DDS1STEP                   39      /* control type: ring, callback function: CB_ChangeDDSStep */
-#define  PANEL_TEXTMSG_15                 40      /* control type: textMsg, callback function: (none) */
-#define  PANEL_ADEV_Math5                 41      /* control type: radioButton, callback function: CB_OnAllanPlot */
-#define  PANEL_PLOT_Math3                 42      /* control type: radioButton, callback function: CB_OnFreqPlot */
-#define  PANEL_SAVE_EXTRA                 43      /* control type: radioButton, callback function: CB_SaveData */
-#define  PANEL_SR_LOGGER                  44      /* control type: radioButton, callback function: CB_SrDatalogger */
-#define  PANEL_SAVE_SR                    45      /* control type: radioButton, callback function: CB_SaveData */
-#define  PANEL_ADEV_Math3                 46      /* control type: radioButton, callback function: CB_OnAllanPlot */
-#define  PANEL_MATHSTRING4                47      /* control type: string, callback function: CB_ChangeMath */
-#define  PANEL_PLOT_Math2                 48      /* control type: radioButton, callback function: CB_OnFreqPlot */
-#define  PANEL_SAVE_HG                    49      /* control type: radioButton, callback function: CB_SaveData */
-#define  PANEL_SAVE_LO                    50      /* control type: radioButton, callback function: CB_SaveData */
-#define  PANEL_ADEV_Math2                 51      /* control type: radioButton, callback function: CB_OnAllanPlot */
-#define  PANEL_MATHSTRING3                52      /* control type: string, callback function: CB_ChangeMath */
-#define  PANEL_MATHSTRING1                53      /* control type: string, callback function: CB_ChangeMath */
-#define  PANEL_MATHSTRING2                54      /* control type: string, callback function: CB_ChangeMath */
-#define  PANEL_TEXTMSG_16                 55      /* control type: textMsg, callback function: (none) */
-#define  PANEL_MATHSTRING5                56      /* control type: textBox, callback function: CB_ChangeMath */
-#define  PANEL_UTC                        57      /* control type: numeric, callback function: (none) */
-#define  PANEL_TIME                       58      /* control type: string, callback function: (none) */
-#define  PANEL_DDS4                       59      /* control type: numeric, callback function: CB_ChangeDDSOut */
-#define  PANEL_DDS3                       60      /* control type: numeric, callback function: CB_ChangeDDSOut */
-#define  PANEL_N1CALCULUS                 61      /* control type: command, callback function: CB_OnNCalculus */
-#define  PANEL_FINDSIGN3                  62      /* control type: command, callback function: CB_OnFindSign */
-#define  PANEL_SIGN3                      63      /* control type: numeric, callback function: CB_BeatnoteSign */
-#define  PANEL_FINDSIGN2                  64      /* control type: command, callback function: CB_OnFindSign */
-#define  PANEL_SIGN2                      65      /* control type: numeric, callback function: CB_BeatnoteSign */
-#define  PANEL_FINDSIGN1                  66      /* control type: command, callback function: CB_OnFindSign */
-#define  PANEL_SIGN1                      67      /* control type: numeric, callback function: CB_BeatnoteSign */
-#define  PANEL_ADJUST_DDS4                68      /* control type: command, callback function: CB_AdjustDDSFreq */
-#define  PANEL_ADJUST_DDS3                69      /* control type: command, callback function: CB_AdjustDDSFreq */
-#define  PANEL_ADJUST_DDS2                70      /* control type: command, callback function: CB_AdjustDDSFreq */
-#define  PANEL_RESETSLOPE                 71      /* control type: command, callback function: CB_OnResetSlope */
-#define  PANEL_DEDRIFT_STOP_ON_UNLOC      72      /* control type: radioButton, callback function: CB_OnStopSlopeCancellingOnUnlocked */
-#define  PANEL_DEDRIFT_KEEP_SLOPE         73      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
-#define  PANEL_DEDRIFT_KEEP_FREQ          74      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
-#define  PANEL_SLOPE_REFERENCE            75      /* control type: ring, callback function: CB_OnSlopeReference */
-#define  PANEL_ESTIMATE_N2                76      /* control type: command, callback function: cb_onEstimateN */
-#define  PANEL_ESTIMATE_N3                77      /* control type: command, callback function: cb_onEstimateN */
-#define  PANEL_DEDRIFT_PROPORTIONAL       78      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
-#define  PANEL_DEDRIFT_INVERT_SIGN        79      /* control type: radioButton, callback function: CB_InvertSlopeSign */
-#define  PANEL_RECENTER                   80      /* control type: LED, callback function: CB_RecenterEnable */
-#define  PANEL_MEASURE_SLOPE              81      /* control type: LED, callback function: CB_MeasureSlope */
-#define  PANEL_SLOPE_MEASURED             82      /* control type: numeric, callback function: (none) */
-#define  PANEL_RESET_DEDRIFT_DDS          83      /* control type: command, callback function: CB_ResetDedriftDDS */
-#define  PANEL_SAVE_RAW                   84      /* control type: radioButton, callback function: CB_SaveData */
-#define  PANEL_SHOWLOG                    85      /* control type: radioButton, callback function: CB_ShowLog */
-#define  PANEL_DEDRIFT_DOUBLE_CORR        86      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
-#define  PANEL_SAVE_DDS                   87      /* control type: radioButton, callback function: CB_SaveData */
-#define  PANEL_DECORATION_2               88      /* control type: deco, callback function: (none) */
-#define  PANEL_DECORATION_8               89      /* control type: deco, callback function: (none) */
-#define  PANEL_DECORATION                 90      /* control type: deco, callback function: (none) */
-#define  PANEL_DECORATION_3               91      /* control type: deco, callback function: (none) */
-#define  PANEL_TEXTMSG_6                  92      /* control type: textMsg, callback function: (none) */
-#define  PANEL_TEXTMSG_22                 93      /* control type: textMsg, callback function: (none) */
-#define  PANEL_TEXTMSG_21                 94      /* control type: textMsg, callback function: (none) */
-#define  PANEL_TEXTMSG_7                  95      /* control type: textMsg, callback function: (none) */
-#define  PANEL_DECORATION_4               96      /* control type: deco, callback function: (none) */
-#define  PANEL_DECORATION_7               97      /* control type: deco, callback function: (none) */
-#define  PANEL_DECORATION_6               98      /* control type: deco, callback function: (none) */
-#define  PANEL_DECORATION_5               99      /* control type: deco, callback function: (none) */
-#define  PANEL_TEXTMSG_20                 100     /* control type: textMsg, callback function: (none) */
-#define  PANEL_TEXTMSG_19                 101     /* control type: textMsg, callback function: (none) */
-#define  PANEL_MATH4                      102     /* control type: string, callback function: (none) */
-#define  PANEL_MATH5                      103     /* control type: string, callback function: (none) */
-#define  PANEL_MATH3                      104     /* control type: string, callback function: (none) */
-#define  PANEL_MATH2                      105     /* control type: string, callback function: (none) */
-#define  PANEL_MATH1                      106     /* control type: string, callback function: (none) */
-#define  PANEL_RECENTER_SR                107     /* control type: radioButton, callback function: CB_RecenterChannel */
-#define  PANEL_RECENTER_HG                108     /* control type: radioButton, callback function: CB_RecenterChannel */
-#define  PANEL_RECENTER_LO                109     /* control type: radioButton, callback function: CB_RecenterChannel */
-#define  PANEL_ERROR                      110     /* control type: LED, callback function: CB_ShowError */
+#define  PANEL_RECENTER_THRESHOLD_SR      22      /* control type: numeric, callback function: CB_RecenterThreshold */
+#define  PANEL_RECENTER_THRESHOLD_HG      23      /* control type: numeric, callback function: CB_RecenterThreshold */
+#define  PANEL_RECENTER_THRESHOLD_LO      24      /* control type: numeric, callback function: CB_RecenterThreshold */
+#define  PANEL_RECENTER_INTERVAL          25      /* control type: numeric, callback function: CB_RecenterInterval */
+#define  PANEL_SLOPETIME                  26      /* control type: numeric, callback function: CB_ChangeSlopeTime */
+#define  PANEL_DEDRIFT_DDS_FREQ           27      /* control type: numeric, callback function: CB_DedriftDDSFreq */
+#define  PANEL_DDS1                       28      /* control type: numeric, callback function: CB_ChangeDDSOut */
+#define  PANEL_CHANGENDIV                 29      /* control type: numeric, callback function: CB_OnChangeNdiv */
+#define  PANEL_N3                         30      /* control type: numeric, callback function: CB_ChangeN */
+#define  PANEL_N3CALCULUS                 31      /* control type: command, callback function: CB_OnNCalculus */
+#define  PANEL_N1                         32      /* control type: numeric, callback function: CB_ChangeN */
+#define  PANEL_N2                         33      /* control type: numeric, callback function: CB_ChangeN */
+#define  PANEL_N2CALCULUS                 34      /* control type: command, callback function: CB_OnNCalculus */
+#define  PANEL_DDS4STEP                   35      /* control type: ring, callback function: CB_ChangeDDSStep */
+#define  PANEL_DDS3STEP                   36      /* control type: ring, callback function: CB_ChangeDDSStep */
+#define  PANEL_DDS2STEP                   37      /* control type: ring, callback function: CB_ChangeDDSStep */
+#define  PANEL_SLOPE_APPLIED              38      /* control type: numeric, callback function: CB_SetSlope */
+#define  PANEL_PLOT_Math5                 39      /* control type: radioButton, callback function: CB_OnFreqPlot */
+#define  PANEL_PLOT_Math4                 40      /* control type: radioButton, callback function: CB_OnFreqPlot */
+#define  PANEL_ADEV_Math4                 41      /* control type: radioButton, callback function: CB_OnAllanPlot */
+#define  PANEL_DDS1STEP                   42      /* control type: ring, callback function: CB_ChangeDDSStep */
+#define  PANEL_TEXTMSG_15                 43      /* control type: textMsg, callback function: (none) */
+#define  PANEL_ADEV_Math5                 44      /* control type: radioButton, callback function: CB_OnAllanPlot */
+#define  PANEL_PLOT_Math3                 45      /* control type: radioButton, callback function: CB_OnFreqPlot */
+#define  PANEL_SAVE_EXTRA                 46      /* control type: radioButton, callback function: CB_SaveData */
+#define  PANEL_SR_LOGGER                  47      /* control type: radioButton, callback function: CB_SrDatalogger */
+#define  PANEL_SAVE_SR                    48      /* control type: radioButton, callback function: CB_SaveData */
+#define  PANEL_ADEV_Math3                 49      /* control type: radioButton, callback function: CB_OnAllanPlot */
+#define  PANEL_MATHSTRING4                50      /* control type: string, callback function: CB_ChangeMath */
+#define  PANEL_PLOT_Math2                 51      /* control type: radioButton, callback function: CB_OnFreqPlot */
+#define  PANEL_SAVE_HG                    52      /* control type: radioButton, callback function: CB_SaveData */
+#define  PANEL_SAVE_LO                    53      /* control type: radioButton, callback function: CB_SaveData */
+#define  PANEL_ADEV_Math2                 54      /* control type: radioButton, callback function: CB_OnAllanPlot */
+#define  PANEL_MATHSTRING3                55      /* control type: string, callback function: CB_ChangeMath */
+#define  PANEL_MATHSTRING1                56      /* control type: string, callback function: CB_ChangeMath */
+#define  PANEL_MATHSTRING2                57      /* control type: string, callback function: CB_ChangeMath */
+#define  PANEL_TEXTMSG_16                 58      /* control type: textMsg, callback function: (none) */
+#define  PANEL_MATHSTRING5                59      /* control type: textBox, callback function: CB_ChangeMath */
+#define  PANEL_UTC                        60      /* control type: numeric, callback function: (none) */
+#define  PANEL_TIME                       61      /* control type: string, callback function: (none) */
+#define  PANEL_DDS4                       62      /* control type: numeric, callback function: CB_ChangeDDSOut */
+#define  PANEL_DDS3                       63      /* control type: numeric, callback function: CB_ChangeDDSOut */
+#define  PANEL_N1CALCULUS                 64      /* control type: command, callback function: CB_OnNCalculus */
+#define  PANEL_FINDSIGN3                  65      /* control type: command, callback function: CB_OnFindSign */
+#define  PANEL_SIGN3                      66      /* control type: numeric, callback function: CB_BeatnoteSign */
+#define  PANEL_FINDSIGN2                  67      /* control type: command, callback function: CB_OnFindSign */
+#define  PANEL_SIGN2                      68      /* control type: numeric, callback function: CB_BeatnoteSign */
+#define  PANEL_FINDSIGN1                  69      /* control type: command, callback function: CB_OnFindSign */
+#define  PANEL_SIGN1                      70      /* control type: numeric, callback function: CB_BeatnoteSign */
+#define  PANEL_ADJUST_DDS4                71      /* control type: command, callback function: CB_AdjustDDSFreq */
+#define  PANEL_ADJUST_DDS3                72      /* control type: command, callback function: CB_AdjustDDSFreq */
+#define  PANEL_ADJUST_DDS2                73      /* control type: command, callback function: CB_AdjustDDSFreq */
+#define  PANEL_RESETSLOPE                 74      /* control type: command, callback function: CB_OnResetSlope */
+#define  PANEL_DEDRIFT_STOP_ON_UNLOC      75      /* control type: radioButton, callback function: CB_OnStopSlopeCancellingOnUnlocked */
+#define  PANEL_DEDRIFT_KEEP_SLOPE         76      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
+#define  PANEL_DEDRIFT_KEEP_FREQ          77      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
+#define  PANEL_SLOPE_REFERENCE            78      /* control type: ring, callback function: CB_OnSlopeReference */
+#define  PANEL_ESTIMATE_N2                79      /* control type: command, callback function: cb_onEstimateN */
+#define  PANEL_ESTIMATE_N3                80      /* control type: command, callback function: cb_onEstimateN */
+#define  PANEL_DEDRIFT_PROPORTIONAL       81      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
+#define  PANEL_DEDRIFT_INVERT_SIGN        82      /* control type: radioButton, callback function: CB_InvertSlopeSign */
+#define  PANEL_RECENTER                   83      /* control type: LED, callback function: CB_RecenterEnable */
+#define  PANEL_MEASURE_SLOPE              84      /* control type: LED, callback function: CB_MeasureSlope */
+#define  PANEL_SLOPE_MEASURED             85      /* control type: numeric, callback function: (none) */
+#define  PANEL_RESET_DEDRIFT_DDS          86      /* control type: command, callback function: CB_ResetDedriftDDS */
+#define  PANEL_SAVE_RAW                   87      /* control type: radioButton, callback function: CB_SaveData */
+#define  PANEL_SHOWLOG                    88      /* control type: radioButton, callback function: CB_ShowLog */
+#define  PANEL_DEDRIFT_DOUBLE_CORR        89      /* control type: radioButton, callback function: CB_OnDedriftSettingsChange */
+#define  PANEL_SAVE_DDS                   90      /* control type: radioButton, callback function: CB_SaveData */
+#define  PANEL_DECORATION_2               91      /* control type: deco, callback function: (none) */
+#define  PANEL_DECORATION_8               92      /* control type: deco, callback function: (none) */
+#define  PANEL_DECORATION                 93      /* control type: deco, callback function: (none) */
+#define  PANEL_DECORATION_3               94      /* control type: deco, callback function: (none) */
+#define  PANEL_TEXTMSG_6                  95      /* control type: textMsg, callback function: (none) */
+#define  PANEL_TEXTMSG_22                 96      /* control type: textMsg, callback function: (none) */
+#define  PANEL_TEXTMSG_21                 97      /* control type: textMsg, callback function: (none) */
+#define  PANEL_TEXTMSG_7                  98      /* control type: textMsg, callback function: (none) */
+#define  PANEL_DECORATION_4               99      /* control type: deco, callback function: (none) */
+#define  PANEL_DECORATION_7               100     /* control type: deco, callback function: (none) */
+#define  PANEL_DECORATION_6               101     /* control type: deco, callback function: (none) */
+#define  PANEL_DECORATION_5               102     /* control type: deco, callback function: (none) */
+#define  PANEL_TEXTMSG_20                 103     /* control type: textMsg, callback function: (none) */
+#define  PANEL_TEXTMSG_19                 104     /* control type: textMsg, callback function: (none) */
+#define  PANEL_MATH4                      105     /* control type: string, callback function: (none) */
+#define  PANEL_MATH5                      106     /* control type: string, callback function: (none) */
+#define  PANEL_MATH3                      107     /* control type: string, callback function: (none) */
+#define  PANEL_MATH2                      108     /* control type: string, callback function: (none) */
+#define  PANEL_MATH1                      109     /* control type: string, callback function: (none) */
+#define  PANEL_RECENTER_SR                110     /* control type: radioButton, callback function: CB_RecenterChannel */
+#define  PANEL_RECENTER_HG                111     /* control type: radioButton, callback function: CB_RecenterChannel */
+#define  PANEL_RECENTER_LO                112     /* control type: radioButton, callback function: CB_RecenterChannel */
+#define  PANEL_ERROR                      113     /* control type: LED, callback function: CB_ShowError */
 
 
      /* Control Arrays: */
@@ -197,6 +200,7 @@
 int  CVICALLBACK CB_RecenterChannel(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_RecenterEnable(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_RecenterInterval(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
+int  CVICALLBACK CB_RecenterThreshold(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_ResetDedriftDDS(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_SaveData(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_SetSlope(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
Binary file FXAnalyse.uir has changed