# HG changeset patch # User Daniele Nicolodi # Date 1349867575 -7200 # Node ID 70980f27e1a4b944125cce1975d3855b00d38e38 # Parent 1d3cd8260cbbad2de84f2c6e4855a06302ed275f Simplify dedrifting interface diff -r 1d3cd8260cbb -r 70980f27e1a4 FXAnalyse.c --- a/FXAnalyse.c Wed Oct 10 13:12:46 2012 +0200 +++ b/FXAnalyse.c Wed Oct 10 13:12:55 2012 +0200 @@ -596,8 +596,6 @@ SetCtrlVal(MainPanel, PANEL_SIGN2, Signe2); SetCtrlVal(MainPanel, PANEL_SIGN3, Signe3); SetCtrlVal(MainPanel, PANEL_CENTERFREQUENCY, CenterFrequencyCh2); - SetCtrlVal(MainPanel, PANEL_LED1, SlopeMeasuring); - SetCtrlVal(MainPanel, PANEL_LED2, OnSlopeCancelling); // Treat data @@ -1334,7 +1332,7 @@ Nratio = -1; nstabilisationSlopeMeasuring = 0; - SetCtrlVal(MainPanel, PANEL_STARTCANCEL, 0); + SetCtrlVal(MainPanel, PANEL_MEASURE_SLOPE, 0); } } } @@ -2262,26 +2260,25 @@ } - int CVICALLBACK CB_OnStartSlopeCancelling (int panel, int control, int event, + int CVICALLBACK CB_MeasureSlope (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { - double frequency; - int activate; + int active; switch (event) { case EVENT_COMMIT: - GetCtrlVal(MainPanel, PANEL_STARTCANCEL, &activate); + GetCtrlVal(panel, control, &active); - if (activate) { + if (active) { SlopeMeasuringTimeBegin = utc; SlopeMeasuring = TRUE; frequency = DDSFox_ReadFreq(&DDS1xAD9956); - GetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, &SlopeMath2); + GetCtrlVal(panel, PANEL_SLOPETOCANCEL, &SlopeMath2); DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); Nratio = -1; @@ -2294,12 +2291,10 @@ if (KeepFrequ) frequency = DDSFox_ReadFreq(&DDS1xAD9956); - if (! KeepSlope) { + if (! KeepSlope) SlopeMath2 = 0.0; - OnSlopeCancelling = FALSE; - } - SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2); + SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2); DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); SlopeMeasuring = FALSE; @@ -2332,7 +2327,7 @@ CenterFrequencyCh2ToDetermine = TRUE ; OnSlopeCancelling = FALSE; SlopeMath2 = 0.0; - SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2); + SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2); DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, SlopeMath2); break; } @@ -2543,3 +2538,4 @@ } return 0; } + diff -r 1d3cd8260cbb -r 70980f27e1a4 FXAnalyse.h --- a/FXAnalyse.h Wed Oct 10 13:12:46 2012 +0200 +++ b/FXAnalyse.h Wed Oct 10 13:12:55 2012 +0200 @@ -169,12 +169,10 @@ #define PANEL_CHECKBOX_RECENTER 115 /* control type: radioButton, callback function: CB_OnReCentering */ #define PANEL_CHECKBOX_KEEPSLOPE 116 /* control type: radioButton, callback function: CB_OnCROX */ #define PANEL_CHECKBOX_KEEP 117 /* control type: radioButton, callback function: CB_OnCROX */ -#define PANEL_STARTCANCEL 118 /* control type: textButton, callback function: CB_OnStartSlopeCancelling */ -#define PANEL_LED1 119 /* control type: LED, callback function: (none) */ -#define PANEL_LED2 120 /* control type: LED, callback function: (none) */ -#define PANEL_SLOPE_REFERENCE 121 /* control type: ring, callback function: CB_OnSlopeReference */ -#define PANEL_ESTIMATE_N3 122 /* control type: command, callback function: CB_OnEstimateN */ -#define PANEL_INVERT_SLOPE_SIGN 123 /* control type: radioButton, callback function: CB_InvertSlopeSign */ +#define PANEL_SLOPE_REFERENCE 118 /* control type: ring, callback function: CB_OnSlopeReference */ +#define PANEL_ESTIMATE_N3 119 /* control type: command, callback function: CB_OnEstimateN */ +#define PANEL_INVERT_SLOPE_SIGN 120 /* control type: radioButton, callback function: CB_InvertSlopeSign */ +#define PANEL_MEASURE_SLOPE 121 /* control type: LED, callback function: CB_MeasureSlope */ /* Menu Bars, Menus, and Menu Items: */ @@ -190,6 +188,7 @@ int CVICALLBACK CB_ChangeN(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_ChangeSlopeTime(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_InvertSlopeSign(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); +int CVICALLBACK CB_MeasureSlope(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnAcceptN(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnAllanPlot(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnAutoSaveHg(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); @@ -220,7 +219,6 @@ int CVICALLBACK CB_OnSlopeTime(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnStart(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnStartNCalculus(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); -int CVICALLBACK CB_OnStartSlopeCancelling(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnStop(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnTimer(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); diff -r 1d3cd8260cbb -r 70980f27e1a4 FXAnalyse.uir Binary file FXAnalyse.uir has changed