Mercurial > hg > fxanalyse
diff FXAnalyse.c @ 48:70980f27e1a4
Simplify dedrifting interface
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Wed, 10 Oct 2012 13:12:55 +0200 |
parents | 1d3cd8260cbb |
children | fbb172892253 |
line wrap: on
line diff
--- 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; } +