Mercurial > hg > fxanalyse
changeset 33:09ed37e1da04
Indent
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Wed, 03 Oct 2012 12:53:54 +0200 |
parents | 3ea9fb26ecdf |
children | 1e4b8ba97faf |
files | FXAnalyse.c |
diffstat | 1 files changed, 49 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- 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; }