Mercurial > hg > fxanalyse
changeset 42:dcc305411dcc
Cleanup
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Tue, 09 Oct 2012 13:18:31 +0200 |
parents | 7fb7eee56b11 |
children | 39a0f396d778 |
files | FXAnalyse.c |
diffstat | 1 files changed, 24 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/FXAnalyse.c Fri Oct 05 15:24:32 2012 +0200 +++ b/FXAnalyse.c Tue Oct 09 13:18:31 2012 +0200 @@ -203,8 +203,6 @@ int main (int argc, char *argv[]) { - //int ThreadId ; // to be used when I will replace timer by thread for counder readout - double initfreqDDS ; char * MathString1 = " " ; char * MathString2 = " " ; @@ -1238,19 +1236,13 @@ Getsign3 = FALSE; } } - - - - /* - * Slope Cancelling - */ - + // slope cancelling if (SlopeMeasuring == TRUE) { double currentFreq = 0.0; - /* select reference */ + // select reference switch (slopeReference) { case SLOPE_REFERENCE_MICROWAVE: currentFreq = Math2; @@ -1357,9 +1349,7 @@ } } - - //// For re-centering - + // re-centering if (KeepCentering) { @@ -2223,36 +2213,32 @@ int CVICALLBACK CB_OnFind275K (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) - { - - - double FrequencyToChange,DeltaCh4,DeltaCh2; - - DeltaCh4=275000-Ch4; - DeltaCh2=10000-Ch2; +{ + double frequency; switch (event) - { + { case EVENT_COMMIT: - if (control==PANEL_FIND275K2){ - GetCtrlVal(MainPanel, PANEL_DDS2, &FrequencyToChange) ; - SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyToChange+DeltaCh4) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, FrequencyToChange+DeltaCh4); + switch (control) + { + case PANEL_FIND275K2: + GetCtrlVal(MainPanel, PANEL_DDS2, &frequency); + frequency = frequency + 275000 - Ch4; + SetCtrlVal(MainPanel, PANEL_DDS2, frequency) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, frequency); + break; - } - - if (control==PANEL_FIND10K3){ - GetCtrlVal(MainPanel, PANEL_DDS3, &FrequencyToChange) ; - SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyToChange+DeltaCh2) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyToChange+DeltaCh2); - - } - - break; - - } + case PANEL_FIND10K3: + GetCtrlVal(MainPanel, PANEL_DDS3, &frequency); + frequency = frequency + 10000 - Ch2; + SetCtrlVal(MainPanel, PANEL_DDS3, frequency); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, frequency); + break; + } + break; + } return 0; -} +} int CVICALLBACK CB_OnSlopeTime (int panel, int control, int event,