# HG changeset patch # User Daniele Nicolodi # Date 1349261634 -7200 # Node ID 09ed37e1da04dc212612b48c9720b17ce47d1b28 # Parent 3ea9fb26ecdf1fc9d65faed9675e2a3ec8318a17 Indent diff -r 3ea9fb26ecdf -r 09ed37e1da04 FXAnalyse.c --- a/FXAnalyse.c Wed Oct 03 11:20:48 2012 +0200 +++ b/FXAnalyse.c Wed Oct 03 12:53:54 2012 +0200 @@ -983,9 +983,9 @@ double DeltaFrep275 = 275000-Ch4; double DeltaFrep10 = 10000-Ch2; - DeltaDDS3= DeltaDDS3 +(DeltaFrep10); - FrequencyDDSBes=FrequencyDDSBesInit+(DeltaFrep275); - FrequencyDDS3=FrequencyDDS3Init+DeltaDDS3; + DeltaDDS3 = DeltaDDS3 + DeltaFrep10; + FrequencyDDSBes = FrequencyDDSBesInit + DeltaFrep275; + FrequencyDDS3 = FrequencyDDS3Init + DeltaDDS3; SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBes) ; DDS4xAD9912_SetFrequency(&DDS4xAD9912,2,FrequencyDDSBes); @@ -2371,54 +2371,58 @@ void *callbackData, int eventData1, int eventData2) { - double ActualFrequ=0.0; - double ActualSlope=0.0; - int buttonstatu=0; + double ActualFrequ = 0.0; + double ActualSlope = 0.0; + int active; switch (event) - { + { case EVENT_COMMIT: - if (control==PANEL_STARTCANCEL){ - GetCtrlVal(MainPanel, PANEL_STARTCANCEL, &buttonstatu) ; + GetCtrlVal(MainPanel, PANEL_STARTCANCEL, &active); - if (buttonstatu==1) - { - SlopeMeasuringTimeBegin=utc; - SlopeMeasuring=TRUE; - ActualFrequ=DDSFox_ReadFreq(&DDS1xAD9956); - ActualSlope= SlopeMath2; - DDSFox_Set(&DDS1xAD9956, ActualFrequ, ActualSlope); - Nratio=-1; - CenterFrequencyCh2ToDetermine=TRUE ; - CenterFrequencyCh2=0.0; - - } - else - { - if (KeepFrequ==TRUE) {ActualFrequ=DDSFox_ReadFreq(&DDS1xAD9956);} - else { ActualFrequ= DEDRIFT_DDS_FREQUENCY;} - if (KeepSlope==TRUE) {ActualSlope= SlopeMath2; - OnSlopeCancelling =TRUE; } - else { ActualSlope= 0.0; - OnSlopeCancelling =FALSE; } - DDSFox_Set(&DDS1xAD9956, ActualFrequ, ActualSlope); - SlopeMeasuring=FALSE; - N_Math2slope=0.0; - Math2_slope=0.0; - Moy_Math2slope=0.0; - Slope_Math2slope=0.0; - MoyMath2=0.0; - Slope_Math2slope=0.0; - CenterFrequencyCh2= 0.0; - Nratio=-1; - nstabilisationSlopeMeasuring=0; - } - } - + if (active) { + + SlopeMeasuringTimeBegin=utc; + SlopeMeasuring=TRUE; + ActualFrequ=DDSFox_ReadFreq(&DDS1xAD9956); + ActualSlope= SlopeMath2; + DDSFox_Set(&DDS1xAD9956, ActualFrequ, ActualSlope); + Nratio=-1; + CenterFrequencyCh2ToDetermine=TRUE ; + CenterFrequencyCh2=0.0; + + } else { + + if (KeepFrequ) { + ActualFrequ = DDSFox_ReadFreq(&DDS1xAD9956); + } else { + ActualFrequ = DEDRIFT_DDS_FREQUENCY; + } + + if (KeepSlope) { + ActualSlope = SlopeMath2; + OnSlopeCancelling = TRUE; + } else { + ActualSlope = 0.0; + OnSlopeCancelling = FALSE; + } + + DDSFox_Set(&DDS1xAD9956, ActualFrequ, ActualSlope); + SlopeMeasuring=FALSE; + N_Math2slope=0.0; + Math2_slope=0.0; + Moy_Math2slope=0.0; + Slope_Math2slope=0.0; + MoyMath2=0.0; + Slope_Math2slope=0.0; + CenterFrequencyCh2= 0.0; + Nratio=-1; + nstabilisationSlopeMeasuring=0; + + } break; - - } + } return 0; }