Mercurial > hg > fxanalyse
changeset 17:9cadd12e7722
Implement N3 measurement. Large code cleanup.
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Wed, 18 Jul 2012 18:48:36 +0200 |
parents | 9d57d1fcbcd5 |
children | 721d817f171e |
files | FXAnalyse.c FXAnalyse.h FXAnalyse.uir |
diffstat | 3 files changed, 536 insertions(+), 438 deletions(-) [+] |
line wrap: on
line diff
--- a/FXAnalyse.c Wed Jul 18 18:47:44 2012 +0200 +++ b/FXAnalyse.c Wed Jul 18 18:48:36 2012 +0200 @@ -4,6 +4,7 @@ #include <userint.h> #include <formatio.h> #include <string.h> +#include <future.h> #include "YLCStuff.h" #include "FXAnalyse.h" @@ -41,6 +42,7 @@ static PanelHandle CalcN1Panel ; static PanelHandle CalcN2Panel ; static PanelHandle CalcN3Panel ; +static PanelHandle EstimateN3Panel; //============================================================================== // Static functions @@ -58,7 +60,7 @@ double Ch1, Ch2, Ch3, Ch4 ; // le type long double est identique au double (8 octets) sous CVI !!! double Math1, Math2, Math3, Math4, Math5; // N est en fait un entier en pratique... -double N1, N2, N3,N4 ; +double N1, N2, N3, N4 ; Plot_Data PlotCh1, PlotCh2, PlotCh3, PlotCh4, PlotMath1, PlotMath2, PlotMath3, PlotMath4, PlotMath5 ; Allan_Data AllanCh1, AllanCh2, AllanCh3, AllanCh4, AllanMath1, AllanMath2, AllanMath3, AllanMath4, AllanMath5 ; @@ -78,18 +80,28 @@ /////////////////// //Pour les calculs des N +enum { + N_MEASUREMENT_STEP_0, + N_MEASUREMENT_STEP_1, + N_MEASUREMENT_STEP_2, + N_MEASUREMENT_STEP_3, + N_MEASUREMENT_STEP_4, +}; + +int settling = 0; + volatile bool Measuring_1 = FALSE,Step1_1 = FALSE,Step2_1 = FALSE,Step3_1 = FALSE, Measuring_2 = FALSE,Step1_2 = FALSE,Step2_2 = FALSE,Step3_2 = FALSE; volatile bool Measuring_3 = FALSE,Step1_3 = FALSE,Step2_3 = FALSE,Step3_3 = FALSE; volatile bool TimetoBegin=FALSE; -double FrequDDS1=110000000.0,FrequDDS2=15300000.0,FrequDDS3=150400000.000000; +double FrequDDS1=110000000.0, FrequDDS2=15300000.0, FrequDDS3=150400000.0, FrequDDS4=110000000.0; double Slope_1=0.0,Slope_2=0.0,Slope_3=0.0,Beatslope_2=0.0; -double SlopeTime1=60.0,SlopeTime2=60.0; +double SlopeTime1=40.0, SlopeTime2=40.0; SlopeTime3=40.0; -double N_1=0.0,N_2=0.0,N_3=0.0; -double DeltaT_1=8.0,DeltakHz_1=1800.0,t1_1=0.0,t2_1=0.0,t3_1=0.0, Frepplus_1=0.0, Frepminus_1=0.0; -double DeltaT_2=8.0,DeltakHz_2=1500.0,t1_2=0.0,t2_2=0.0,t3_2=0.0, Frepplus_2=0.0, Frepminus_2=0.0; -double DeltaT_3=20.0,DeltakHz_3=100.0,t1_3=0.0,t2_3=0.0,t3_3=0.0, Frepplus_3=0.0, Frepminus_3=0.0; +double N_1=0.0, N_2=0.0, N_3=0.0; +double DeltaT_1=20.0, DeltakHz_1=500.0, t1_1=0.0, t2_1=0.0, t3_1=0.0, Frepplus_1=0.0, Frepminus_1=0.0; +double DeltaT_2=20.0, DeltakHz_2=500.0, t1_2=0.0, t2_2=0.0, t3_2=0.0, Frepplus_2=0.0, Frepminus_2=0.0; +double DeltaT_3=20.0, DeltakHz_3=500.0, t1_3=0.0, t2_3=0.0, t3_3=0.0, Frepplus_3=0.0, Frepminus_3=0.0; int DeltaTMoy_1=3,n_1=0,DeltaTMoy_2=3,n_2=0,DeltaTMoy_3=3,n_3=0; @@ -111,12 +123,15 @@ double Ch4Plus=0.0,Ch4Minus=0.0; -int NDEJAPASSE=0, nDDSChange=0, nstabilization=0 ; +int NDEJAPASSE=0, nDDSChange=0, nstabilization=0; ////// //Pour les signes de fb -double Frequencystep1=10000.0,tbegin1=0.0,Frepbefore1=0.0,Frequency1=0.0,Frequencystep2=10.0,tbegin2=0.0,Frepbefore2=0.0,Ch2before=0.0,Frequency2=0.0,Frequencystep3=100000.0,tbegin3=0.0,Frepbefore3=0.0,Frequency3=0.0; +double Frequencystep1=10000.0, tbegin1=0.0, Frepbefore1=0.0, Frequency1=0.0; +double Frequencystep2=10.0, tbegin2=0.0, Frepbefore2=0.0, Ch2before=0.0, Frequency2=0.0; +double Frequencystep3=100000.0, tbegin3=0.0, Frepbefore3=0.0, Frequency3=0.0; + volatile bool Getsign1=FALSE,Getsign2=FALSE,Getsign3=FALSE; double Signe1=1.0,Signe2=1.0,Signe3=0.0; @@ -248,6 +263,8 @@ return -1; if ((CalcN3Panel = LoadPanel (0, "FXAnalyse.uir", CALCN3)) < 0) return -1; + if ((EstimateN3Panel = LoadPanel (MainPanel, "FXAnalyse.uir", ESTIMATEN3)) < 0) + return -1; DisplayPanel (MainPanel); @@ -1179,116 +1196,174 @@ } } + switch (Measuring_3) { + case N_MEASUREMENT_STEP_0: + // not measuring N3 + break; - /* if (Measuring_3==TRUE) - { - if (Step1_3==FALSE) { - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequDDS3); - t1_3=utc; - Frequ_slope_3=Math1; - Moy_slope_3= Frequ_slope_3; - N_slope_3=1; - Step1_3=TRUE ; - } - else { - if(Step2_3==FALSE){ - N_slope_3=N_slope_3+1; - Frequ_slope_3=Math1; - Moy_slope_3=((N_slope_3-1)*Moy_slope_3 + Frequ_slope_3)/N_slope_3; - Slope_slope_3 = (Slope_slope_3*(N_slope_3-2) + 6*(Frequ_slope_3-Moy_slope_3)/N_slope_3)/(N_slope_3+1) ; - if (utc-t1_3>DeltaT_3) { - Slope_3 = Slope_slope_3; - GetCtrlVal(MainPanel, PANEL_DDSFREPOUT, &FrequencyDDSBes) ; - DDSBes_SetFrequency(&DDSBes, FrequencyDDSBes+(FACTORDDSBES*DeltakHz_3*1000)); - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequDDS3+DeltakHz_3*1000); - t2_3=utc; - Step2_3=TRUE ; - N_slope_3=0; - Frequ_slope_3=0.0; - Moy_slope_3=0.0; - Slope_slope_3 =0.0; - } - } - else { - if(Step2_3==FALSE){ - if (utc-t2_3<DeltaT_3) { - Frepplus_3=Frepplus_3 +Math1+250000000-Slope_3*(utc-t2_3); - n_3=n_3+1; - } - else{ - Frepplus_3=Frepplus_3/n_3; - DDSBes_SetFrequency(&DDSBes, FrequencyDDSBes-(FACTORDDSBES*DeltakHz_3*1000)); - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequDDS3-DeltakHz_3*1000); - n_3=0; - t3_3=utc; - Step3_3=TRUE ; - } - } - else { - if (utc-t3_3<DeltaT_3) { - Frepminus_3=Frepminus_3 +Math1+250000000-Slope_3*(utc-t3_3); - n_3=n_3+1; - } - else{ - Frepminus_3=Frepminus_3/(n_3); - N_3 = (16*DeltakHz_3*1000 -Slope_3*(t3_3-t2_3))/(Frepplus_3-Frepminus_3); - n_3=0; - Frepminus_3=0.0; - Frepplus_3=0.0; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequDDS3); - Measuring_2=FALSE ; - Step1_3=FALSE ; - Step2_3=FALSE ; - Step3_3=FALSE ; - t1_3=0.0; - t2_3=0.0; - t3_3=0.0; - } - } - } + case N_MEASUREMENT_STEP_1: // init + + SetCtrlVal(MainPanel, PANEL_DDS4, FrequDDS4); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, FrequDDS4); + settling = 3; + + t1_3 = utc; + N_slope_3 = 0; + // record current DDS3 frequency + GetCtrlVal(MainPanel, PANEL_DDS3, &FrequencyDDS3Init); + + // step 1 done + Measuring_3 = N_MEASUREMENT_STEP_2; + break; + + case N_MEASUREMENT_STEP_2: // slope measurement + + if (settling > 0) { + settling--; + break; + } + + N_slope_3++; + Frequ_slope_3 = Ch2; + Moy_slope_3 = ((N_slope_3-1)*Moy_slope_3 + Frequ_slope_3)/N_slope_3; + Slope_slope_3 = (Slope_slope_3*(N_slope_3-2) + 6*(Frequ_slope_3-Moy_slope_3)/N_slope_3)/(N_slope_3+1) ; + + if (utc - t1_3 > SlopeTime3) { + // slope measurement + Slope_3 = Slope_slope_3; + + t2_3 = utc; + N_slope_3 = 0; + Frequ_slope_3 = 0.0; + Moy_slope_3 = 0.0; + Slope_slope_3 = 0.0; + + // step 2 done + Measuring_3 = N_MEASUREMENT_STEP_3; + + // frep positive step + SetCtrlVal(MainPanel, PANEL_DDS4, FrequDDS4 + DeltakHz_3 * 1000); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, FrequDDS4 + DeltakHz_3 * 1000); + // compensate with DDS3 to keep measured beatnote in counter box range + double fDDS3 = FrequencyDDS3Init + N3/N1 * DeltakHz_3; + SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); + // allow counter to settle + settling = 3; + } + break; + + case N_MEASUREMENT_STEP_3: // frep positive step + + if (settling > 0) { + settling--; + break; } - } */ - - - - + + n_3++; + Frepplus_3 += Ch2 - Slope_3 * (utc - t2_3); + + if (utc - t2_3 > DeltaT_3) { + // positive step measurement + Frepplus_3 = Frepplus_3 / n_3; + + n_3 = 0; + t3_3 = utc; + + // step 3 done + Measuring_3 = N_MEASUREMENT_STEP_4; + + // frep negative step + SetCtrlVal(MainPanel, PANEL_DDS4, FrequDDS4 - DeltakHz_3 * 1000); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, FrequDDS4 - DeltakHz_3 * 1000); + // compensate with DDS3 to keep measured beatnote in counter box range + double fDDS3 = FrequencyDDS3Init - N3/N1 * DeltakHz_3; + SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3); + // allow counter to settle + settling = 3; + } + break; + + + case N_MEASUREMENT_STEP_4: // frep negative step + + if (settling > 0) { + settling--; + break; + } + + n_3++; + Frepminus_3 += Ch2 - Slope_3 * (utc - t3_3); + + if (utc - t3_3 > DeltaT_3) { + // positive step measurement + Frepminus_3 = Frepminus_3 / n_3; + + // compute N3 + N_3 = 1000.0 * DeltakHz_3 / (Frepplus_3 - Frepminus_3); + SetCtrlVal(CalcN3Panel, CALCN3_N_3, N_3); + + t1_3=0.0; + t2_3=0.0; + t3_3=0.0; + n_3 = 0; + Frepminus_3 = 0.0; + Frepplus_3 = 0.0; + + // step 4 done + Measuring_3 = N_MEASUREMENT_STEP_0; + + // back to nominal frep + SetCtrlVal(MainPanel, PANEL_DDS4, FrequDDS4); + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, FrequDDS4); + } + break; + } // Calcul du signe de fb - if (Getsign1 ==TRUE) { - if (utc> tbegin1+2){ - if (Math1> Frepbefore1) { Signe1=-1.0;} - else {Signe1=1.0;} + if (Getsign1 == TRUE) { + if (utc > tbegin1+2) { + if (Math1 > Frepbefore1) + Signe1 = -1.0; + else + Signe1 = +1.0; SetCtrlVal(MainPanel, PANEL_DDS1, Frequency1) ; DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency1); - Getsign1=FALSE; - } + Getsign1 = FALSE; } - if (Getsign2 ==TRUE) { - if (utc> tbegin2+2){ - if (Math1> Frepbefore2) { - if (Ch2>Ch2before) {Signe2=+1.0;} - else {Signe2=-1.0;} - } - else { - if (Ch2>Ch2before) {Signe2=-1.0;} - else {Signe2=+1.0;} + } + if (Getsign2 == TRUE) { + if (utc > tbegin2+2){ + if (Math1 > Frepbefore2) { + if (Ch2 > Ch2before) + Signe2 = +1.0; + else + Signe2 = -1.0; + } else { + if (Ch2 > Ch2before) + Signe2 = -1.0; + else + Signe2 = +1.0; } SetCtrlVal(MainPanel, PANEL_DDS1, Frequency2) ; DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency2); - Getsign2=FALSE; - } + Getsign2 = FALSE; } - if (Getsign3 ==TRUE) { - if (utc> tbegin3+2){ - if (Ch1> Frepbefore3) { Signe3=-1.0;} - else {Signe3=1.0;} + } + if (Getsign3 == TRUE) { + if (utc > tbegin3+2){ + if (Ch3 > Frepbefore3) + Signe3 = -1.0; + else + Signe3 = +1.0; SetCtrlVal(MainPanel, PANEL_DDS3, Frequency3) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, Frequency3); - Getsign3=FALSE; - } + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, Frequency3); + Getsign3 = FALSE; } + } @@ -2085,47 +2160,26 @@ } -int CVICALLBACK OnAcceptN (int panel, int control, int event, +int CVICALLBACK CB_OnAcceptN (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { - double N; - switch (event) - { + { case EVENT_COMMIT: if (panel == CalcN1Panel) { - N = floor(N_1); - if (N_1-N<0.5) - { - N1=N; - } - else - { - N1=N+1; - } - SetCtrlVal(MainPanel, PANEL_N1CHOICE, N1) ; - } - + N1 = round(N_1); + SetCtrlVal(MainPanel, PANEL_N1CHOICE, N1); + } if (panel == CalcN2Panel) { - N = floor(N_2); - if (N_2-N<0.5) - { - N2=N; - } - else - { - N2=N+1; - } - SetCtrlVal(MainPanel, PANEL_N2CHOICE, N2) ; - } - + N2 = round(N_2); + SetCtrlVal(MainPanel, PANEL_N2CHOICE, N2); + } if (panel == CalcN3Panel) { - GetCtrlVal(CalcN3Panel, CALCN3_N_3, &N) ; - SetCtrlVal(MainPanel, PANEL_N3CHOICE, N) ; - N3=N; - } + N3 = round(N_3); + SetCtrlVal(MainPanel, PANEL_N3CHOICE, N3); + } break; - } + } return 0; } @@ -2287,36 +2341,20 @@ { switch (event) - { + { case EVENT_COMMIT: - if (control==CALCN1_COMMANDBUTTON) - { - Measuring_1=TRUE; - } - if (control==CALCN2_COMMANDBUTTON) - { - Measuring_2=TRUE; - } + if (panel == CalcN1Panel) + Measuring_1 = TRUE; + if (panel == CalcN2Panel) + Measuring_2 = TRUE; + if (panel == CalcN3Panel) + Measuring_3 = TRUE; break; - } - - + } return 0; } -int CVICALLBACK CB_OnStartN3Calculus (int panel, int control, int event, - void *callbackData, int eventData1, int eventData2) -{ - - switch (event) - { - case EVENT_COMMIT: - Measuring_3=TRUE; - break; - } - return 0; -} int CVICALLBACK CB_OnNStop (int panel, int control, int event, @@ -2325,116 +2363,93 @@ int PanelIsVisible; switch (event) - { + { case EVENT_COMMIT: - //switch (control) - if (control==CALCN1_COMMANDBUTTON_2) - { - GetPanelAttribute (CalcN1Panel, ATTR_VISIBLE , &PanelIsVisible); - if (PanelIsVisible) { - HidePanel(CalcN1Panel) ; - } - - Measuring_1=FALSE; - Step1_1=FALSE ; - Step2_1=FALSE ; - Step3_1=FALSE ; - Frepminus_1=0.0; - Frepplus_1=0.0; - t1_1=0.0; - t2_1=0.0; - t3_1=0.0; - N_slope_1=0; - Frequ_slope_1=0.0; - Moy_slope_1=0.0; - Slope_slope_1 =0.0; - Ch4_slope=0.0; - Moy_Ch4slope_1=0.0; - Slope_Ch4slope_1=0.0; - DDSBesChanged1=FALSE; - DDSBesChanged2=FALSE; - nDDSChange=0.0; - - SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, FrequDDS1); - SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, FrequencyDDSBesInit); - nstabilization=0; + if (panel == CalcN1Panel) { + GetPanelAttribute (CalcN1Panel, ATTR_VISIBLE, &PanelIsVisible); + if (PanelIsVisible) + HidePanel(CalcN1Panel); + + Measuring_1=FALSE; + Step1_1=FALSE ; + Step2_1=FALSE ; + Step3_1=FALSE ; + Frepminus_1=0.0; + Frepplus_1=0.0; + t1_1=0.0; + t2_1=0.0; + t3_1=0.0; + N_slope_1=0; + Frequ_slope_1=0.0; + Moy_slope_1=0.0; + Slope_slope_1 =0.0; + Ch4_slope=0.0; + Moy_Ch4slope_1=0.0; + Slope_Ch4slope_1=0.0; + DDSBesChanged1=FALSE; + DDSBesChanged2=FALSE; + nDDSChange=0.0; + + SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, FrequDDS1); + SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, FrequencyDDSBesInit); + nstabilization=0; + } + if (panel == CalcN2Panel) { + GetPanelAttribute (CalcN2Panel, ATTR_VISIBLE, &PanelIsVisible); + if (PanelIsVisible) + HidePanel(CalcN2Panel); + + Measuring_2=FALSE; + Step1_2=FALSE ; + Step2_2=FALSE ; + Step3_2=FALSE ; + Frepminus_2=0.0; + Delta10K_Minus=0.0; + Frepplus_2=0.0; + Delta10K_Plus=0.0; + DeltaDDS3=0.0; + t1_2=0.0; + t2_2=0.0; + t3_2=0.0; + N_slope_2=0; + Frequ_slope_2=0.0; + Moy_slope_2=0.0; + Beat_slope_2=0.0; + Moy_Beatslope_2=0.0; + Slope_Beatslope_2 =0.0; + Slope_slope_2 =0.0; + DDSBesChanged1=FALSE; + DDSBesChanged2=FALSE; + nDDSChange=0.0; + + SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, FrequDDS1); + SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, FrequencyDDSBesInit); + SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init); + nstabilization=0; } - - - if (control==CALCN2_STOP2) - { - GetPanelAttribute (CalcN2Panel, ATTR_VISIBLE , &PanelIsVisible); - if (PanelIsVisible) { - HidePanel(CalcN2Panel) ; - } - - Measuring_2=FALSE; - Step1_2=FALSE ; - Step2_2=FALSE ; - Step3_2=FALSE ; - Frepminus_2=0.0; - Delta10K_Minus=0.0; - Frepplus_2=0.0; - Delta10K_Plus=0.0; - DeltaDDS3=0.0; - t1_2=0.0; - t2_2=0.0; - t3_2=0.0; - N_slope_2=0; - Frequ_slope_2=0.0; - Moy_slope_2=0.0; - Beat_slope_2=0.0; - Moy_Beatslope_2=0.0; - Slope_Beatslope_2 =0.0; - Slope_slope_2 =0.0; - DDSBesChanged1=FALSE; - DDSBesChanged2=FALSE; - nDDSChange=0.0; - SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, FrequDDS1); - SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, FrequencyDDSBesInit); - SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init); - nstabilization=0; + if (panel == CalcN3Panel) { + GetPanelAttribute (CalcN3Panel, ATTR_VISIBLE, &PanelIsVisible); + if (PanelIsVisible) + HidePanel(CalcN3Panel); + + Measuring_3 = FALSE; + Frepminus_3 = 0.0; + Frepplus_3 = 0.0; + t1_3 = 0.0; + t2_3 = 0.0; + t3_3 = 0.0; + N_slope_3 = 0; + Frequ_slope_3 = 0.0; + Moy_slope_3 = 0.0; + Slope_slope_3 = 0.0; } - - break; - } - return 0; -} - -int CVICALLBACK CB_OnN3Stop (int panel, int control, int event, - void *callbackData, int eventData1, int eventData2) -{ - int PanelIsVisible; - - switch (event) - { - case EVENT_COMMIT: - GetPanelAttribute (CalcN3Panel, ATTR_VISIBLE , &PanelIsVisible); - if (PanelIsVisible) { - HidePanel(CalcN3Panel) ; - } - - Measuring_3=FALSE; - Step1_3=FALSE ; - Step2_3=FALSE ; - Step3_3=FALSE ; - Frepminus_3=0.0; - Frepplus_3=0.0; - t1_3=0.0; - t2_3=0.0; - t3_3=0.0; - N_slope_3=0; - Frequ_slope_3=0.0; - Moy_slope_3=0.0; - Slope_slope_3 =0.0; - break; - } + } return 0; } @@ -2444,25 +2459,22 @@ { double Time ; - switch (event) - { + switch (event) { case EVENT_COMMIT: - if (control==CALCN1_INTEGRATIONTIME){ + if (panel == CalcN1Panel) { GetCtrlVal(CalcN1Panel, CALCN1_INTEGRATIONTIME, &Time) ; DeltaT_1=Time; } - if (control==CALCN2_INTEGRATIONTIME){ + if (panel == CalcN2Panel) { GetCtrlVal(CalcN2Panel, CALCN2_INTEGRATIONTIME, &Time) ; DeltaT_2=Time; } - if (control==CALCN3_INTEGRATIONTIME){ + if (panel == CalcN3Panel) { GetCtrlVal(CalcN3Panel, CALCN3_INTEGRATIONTIME, &Time) ; DeltaT_3=Time; } - break; - - } + } return 0; } @@ -2473,68 +2485,64 @@ double Frequ ; switch (event) - { + { case EVENT_COMMIT: - if (control==CALCN1_DELTAFREQ){ - GetCtrlVal(CalcN1Panel, CALCN1_DELTAFREQ, &Frequ) ; - DeltakHz_1=Frequ; + if (panel == CalcN1Panel) { + GetCtrlVal(CalcN1Panel, CALCN1_DELTAFREQ, &Frequ); + DeltakHz_1 = Frequ; } - if (control==CALCN2_DELTAFREQ){ + if (panel == CalcN2Panel) { GetCtrlVal(CalcN2Panel, CALCN2_DELTAFREQ, &Frequ) ; DeltakHz_2=Frequ; } - if (control==CALCN3_DELTAFREQ){ + if (panel == CalcN3Panel) { GetCtrlVal(CalcN3Panel, CALCN3_DELTAFREQ, &Frequ) ; DeltakHz_3=Frequ; } - break; - - } + } return 0; } int CVICALLBACK CB_OnFindSign (int panel, int control, int event, - void *callbackData, int eventData1, int eventData2) + void *callbackData, int eventData1, int eventData2) { - switch (event) - { + switch (event) { case EVENT_COMMIT: - if (control==PANEL_FINDSIGN1){ - tbegin1=utc; - Frepbefore1=Math1; - GetCtrlVal(MainPanel, PANEL_DDS1, &Frequency1) ; - SetCtrlVal(MainPanel, PANEL_DDS1, Frequency1+Frequencystep1) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency1+Frequencystep1); - Getsign1=TRUE; + switch (control) + { + case PANEL_FINDSIGN1: + tbegin1 = utc; + Frepbefore1 = Math1; + GetCtrlVal(MainPanel, PANEL_DDS1, &Frequency1) ; + SetCtrlVal(MainPanel, PANEL_DDS1, Frequency1+Frequencystep1) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency1+Frequencystep1); + Getsign1 = TRUE; + break; + case PANEL_FINDSIGN2: + tbegin2 = utc; + Frepbefore2 = Math1; + Ch2before = Ch2; + GetCtrlVal(MainPanel, PANEL_DDS1, &Frequency2) ; + SetCtrlVal(MainPanel, PANEL_DDS1, Frequency2+Frequencystep2) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency2+Frequencystep2); + Getsign2 = TRUE; + break; + case PANEL_FINDSIGN3: + tbegin3 = utc; + Frepbefore3 = Math1; + GetCtrlVal(MainPanel, PANEL_DDS4, &Frequency3) ; + SetCtrlVal(MainPanel, PANEL_DDS4, Frequency3+Frequencystep3) ; + DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, Frequency3+Frequencystep3); + Getsign3 = TRUE; + break; } - if (control==PANEL_FINDSIGN2){ - tbegin2=utc; - Frepbefore2=Math1; - Ch2before=Ch2; - GetCtrlVal(MainPanel, PANEL_DDS1, &Frequency2) ; - SetCtrlVal(MainPanel, PANEL_DDS1, Frequency2+Frequencystep2) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency2+Frequencystep2); - Getsign2=TRUE; - } - if (control==PANEL_FINDSIGN3){ - tbegin3=utc; - Frepbefore3=Ch1; - GetCtrlVal(MainPanel, PANEL_DDS3, &Frequency3) ; - SetCtrlVal(MainPanel, PANEL_DDS3, Frequency3+Frequencystep3) ; - DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, Frequency3+Frequencystep3); - Getsign3=TRUE; - } - - break; - - } + } return 0; -} - +} int CVICALLBACK CB_OnFind275K (int panel, int control, int event, @@ -2577,21 +2585,22 @@ double Time ; switch (event) - { + { case EVENT_COMMIT: - if (control==CALCN1_SLOPETIME){ - GetCtrlVal(CalcN1Panel, CALCN1_SLOPETIME, &Time) ; + if (panel == CalcN1Panel) { + GetCtrlVal(CalcN1Panel, CALCN1_SLOPETIME, &Time); SlopeTime1=Time; } - - if (control==CALCN2_SLOPETIME){ - GetCtrlVal(CalcN2Panel, CALCN2_SLOPETIME, &Time) ; + if (panel == CalcN2Panel) { + GetCtrlVal(CalcN2Panel, CALCN2_SLOPETIME, &Time); SlopeTime2=Time; } - + if (panel == CalcN3Panel) { + GetCtrlVal(CalcN3Panel, CALCN3_SLOPETIME, &Time); + SlopeTime3=Time; + } break; - - } + } return 0; } @@ -2876,7 +2885,7 @@ return 0; } -int CVICALLBACK SlopeReference_cb (int panel, int control, int event, +int CVICALLBACK CB_OnSlopeReference (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { switch (event) @@ -2887,3 +2896,84 @@ } return 0; } + + +int CVICALLBACK CB_OnEstimateN (int panel, int control, int event, + void *callbackData, int eventData1, int eventData2) +{ + int visible; + double wl; + + switch (event) + { + case EVENT_COMMIT: + /* be prepaid to support more N estimates for different beat notes */ + switch (control) + { + case PANEL_ESTIMATE_N3: + GetPanelAttribute(EstimateN3Panel, ATTR_VISIBLE , &visible); + if (! visible) { + DisplayPanel(EstimateN3Panel); + } + /* set current frep */ + SetCtrlVal(EstimateN3Panel, ESTIMATEN3_FREP, 250e6 + Math1); + /* default wavelenght for Sr cavity */ + GetCtrlVal(EstimateN3Panel, ESTIMATEN3_WAVELENGTH, &wl); + if (wl == 0.0) + SetCtrlVal(EstimateN3Panel, ESTIMATEN3_WAVELENGTH, 698.50); + /* reset N3 estimate */ + SetCtrlVal(EstimateN3Panel, ESTIMATEN3_N, 0.0); + break; + } + break; + } + + return 0; +} + +int CVICALLBACK CB_OnNEstimateCancel (int panel, int control, int event, + void *callbackData, int eventData1, int eventData2) +{ + int visible; + + switch (event) + { + case EVENT_COMMIT: + GetPanelAttribute(panel, ATTR_VISIBLE, &visible); + if (visible) + HidePanel(panel); + break; + } + return 0; +} + +int CVICALLBACK CB_OnNEstimateSet (int panel, int control, int event, + void *callbackData, int eventData1, int eventData2) +{ + switch (event) + { + case EVENT_COMMIT: + GetCtrlVal(panel, ESTIMATEN3_N, &N3); + SetCtrlVal(MainPanel, PANEL_N3CHOICE, N3); + HidePanel(panel); + break; + } + return 0; +} + +int CVICALLBACK CB_OnNEstimate (int panel, int control, int event, + void *callbackData, int eventData1, int eventData2) +{ + double frep, wl, N; + + switch (event) + { + case EVENT_COMMIT: + GetCtrlVal(panel, ESTIMATEN3_FREP, &frep); + GetCtrlVal(panel, ESTIMATEN3_WAVELENGTH, &wl); + N = round(299792458.0 / wl / 1e-9 / frep); + SetCtrlVal(panel, ESTIMATEN3_N, N); + break; + } + return 0; +}
--- a/FXAnalyse.h Wed Jul 18 18:47:44 2012 +0200 +++ b/FXAnalyse.h Wed Jul 18 18:48:36 2012 +0200 @@ -24,7 +24,7 @@ #define CALCN1_NUMERIC_5 6 /* control type: numeric, callback function: (none) */ #define CALCN1_N_1 7 /* control type: numeric, callback function: (none) */ #define CALCN1_NUMERIC_6 8 /* control type: numeric, callback function: (none) */ -#define CALCN1_ACCEPTN1 9 /* control type: command, callback function: OnAcceptN */ +#define CALCN1_ACCEPTN 9 /* control type: command, callback function: CB_OnAcceptN */ #define CALCN1_CHECKBOX_2 10 /* control type: radioButton, callback function: (none) */ #define CALCN1_TEXTMSG_2 11 /* control type: textMsg, callback function: (none) */ #define CALCN1_SLOPE 12 /* control type: numeric, callback function: (none) */ @@ -43,7 +43,7 @@ #define CALCN2_N_2 6 /* control type: numeric, callback function: (none) */ #define CALCN2_STOP2 7 /* control type: command, callback function: CB_OnNStop */ #define CALCN2_COMMANDBUTTON 8 /* control type: command, callback function: CB_OnStartNCalculus */ -#define CALCN2_ACCEPTN1 9 /* control type: command, callback function: OnAcceptN */ +#define CALCN2_ACCEPTN 9 /* control type: command, callback function: CB_OnAcceptN */ #define CALCN2_SLOPETIME 10 /* control type: numeric, callback function: CB_OnSlopeTime */ #define CALCN3 4 @@ -52,11 +52,20 @@ #define CALCN3_DELTAFREQ 4 /* control type: numeric, callback function: CB_OnDeltaFreq */ #define CALCN3_INTEGRATIONTIME 5 /* control type: numeric, callback function: CB_OnIntegrationTime */ #define CALCN3_N_3 6 /* control type: numeric, callback function: (none) */ -#define CALCN3_COMMANDBUTTON_2 7 /* control type: command, callback function: CB_OnN3Stop */ -#define CALCN3_COMMANDBUTTON 8 /* control type: command, callback function: CB_OnStartN3Calculus */ -#define CALCN3_ACCEPTN1 9 /* control type: command, callback function: OnAcceptN */ +#define CALCN3_STOP2 7 /* control type: command, callback function: CB_OnNStop */ +#define CALCN3_COMMANDBUTTON 8 /* control type: command, callback function: CB_OnStartNCalculus */ +#define CALCN3_ACCEPTN 9 /* control type: command, callback function: CB_OnAcceptN */ +#define CALCN3_SLOPETIME 10 /* control type: numeric, callback function: CB_OnSlopeTime */ -#define PANEL 5 /* callback function: CB_OnEventMain */ +#define ESTIMATEN3 5 +#define ESTIMATEN3_N 2 /* control type: numeric, callback function: (none) */ +#define ESTIMATEN3_ESTIMATE 3 /* control type: command, callback function: CB_OnNEstimate */ +#define ESTIMATEN3_FREP 4 /* control type: numeric, callback function: (none) */ +#define ESTIMATEN3_SET 5 /* control type: command, callback function: CB_OnNEstimateSet */ +#define ESTIMATEN3_CANCEL 6 /* control type: command, callback function: CB_OnNEstimateCancel */ +#define ESTIMATEN3_WAVELENGTH 7 /* control type: numeric, callback function: (none) */ + +#define PANEL 6 /* callback function: CB_OnEventMain */ #define PANEL_QUITBUTTON 2 /* control type: command, callback function: QuitCallback */ #define PANEL_STARTBUTTON 3 /* control type: command, callback function: CB_OnStart */ #define PANEL_STOPBUTTON 4 /* control type: command, callback function: CB_OnStop */ @@ -87,107 +96,104 @@ #define PANEL_TEXTMSG_2 29 /* control type: textMsg, callback function: (none) */ #define PANEL_SLOPETIME 30 /* control type: numeric, callback function: CB_ChangeSlopeTime */ #define PANEL_DDS1 31 /* control type: numeric, callback function: CB_ChangeDDSOut */ -#define PANEL_SPLITTER_4 32 /* control type: splitter, callback function: (none) */ -#define PANEL_SPLITTER 33 /* control type: splitter, callback function: (none) */ -#define PANEL_CHANGENDIV 34 /* control type: numeric, callback function: CB_OnChangeNdiv */ -#define PANEL_DDSFREPOUT 35 /* control type: numeric, callback function: CB_ChangeDDSOut */ -#define PANEL_N3CHOICE 36 /* control type: numeric, callback function: CB_ChangeN */ -#define PANEL_N3CALCULUS 37 /* control type: command, callback function: CB_OnNCalculus */ -#define PANEL_N1CHOICE 38 /* control type: numeric, callback function: CB_ChangeN */ -#define PANEL_N2CHOICE 39 /* control type: numeric, callback function: CB_ChangeN */ -#define PANEL_N2CALCULUS 40 /* control type: command, callback function: CB_OnNCalculus */ -#define PANEL_TEXTMSG_14 41 /* control type: textMsg, callback function: (none) */ -#define PANEL_TEXTMSG_3 42 /* control type: textMsg, callback function: (none) */ -#define PANEL_TEXTMSG_4 43 /* control type: textMsg, callback function: (none) */ -#define PANEL_DDS4STEP 44 /* control type: ring, callback function: CB_ChangeDDSStep */ -#define PANEL_DDS3STEP 45 /* control type: ring, callback function: CB_ChangeDDSStep */ -#define PANEL_DDS2STEP 46 /* control type: ring, callback function: CB_ChangeDDSStep */ -#define PANEL_CENTERFREQUENCY 47 /* control type: numeric, callback function: (none) */ -#define PANEL_SLOPETOCANCEL 48 /* control type: numeric, callback function: (none) */ -#define PANEL_MATH4 49 /* control type: numeric, callback function: (none) */ -#define PANEL_MATH5 50 /* control type: numeric, callback function: (none) */ -#define PANEL_MATH3 51 /* control type: numeric, callback function: (none) */ -#define PANEL_CHECKBOX_MATH5PLOT 52 /* control type: radioButton, callback function: CB_OnFreqPlot */ -#define PANEL_CHECKBOX_MATH4PLOT 53 /* control type: radioButton, callback function: CB_OnFreqPlot */ -#define PANEL_CHECKBOX_MATH4ALLAN 54 /* control type: radioButton, callback function: CB_OnAllanPlot */ -#define PANEL_DDS1STEP 55 /* control type: ring, callback function: CB_ChangeDDSStep */ -#define PANEL_TEXTMSG_15 56 /* control type: textMsg, callback function: (none) */ -#define PANEL_CHECKBOX_MATH5ALLAN 57 /* control type: radioButton, callback function: CB_OnAllanPlot */ -#define PANEL_CHECKBOX_MATH3PLOT 58 /* control type: radioButton, callback function: CB_OnFreqPlot */ -#define PANEL_CHECKBOX_MATH5SAVE 59 /* control type: radioButton, callback function: (none) */ -#define PANEL_CHECKBOX_MATH3SAVE_2 60 /* control type: radioButton, callback function: CB_OnSaveSr */ -#define PANEL_CHECKBOX_MATH3ALLAN 61 /* control type: radioButton, callback function: CB_OnAllanPlot */ -#define PANEL_DDSFREPSTEP 62 /* control type: ring, callback function: CB_ChangeDDSStep */ -#define PANEL_DDSFREPAMP 63 /* control type: numeric, callback function: CB_ChangeDDSAmpli */ -#define PANEL_MATHSTRING4 64 /* control type: string, callback function: CB_ChangeMath */ -#define PANEL_TEXTMSG_17 65 /* control type: textMsg, callback function: (none) */ -#define PANEL_MATH2 66 /* control type: numeric, callback function: (none) */ -#define PANEL_SPLITTER_15 67 /* control type: splitter, callback function: (none) */ -#define PANEL_SPLITTER_12 68 /* control type: splitter, callback function: (none) */ -#define PANEL_CHECKBOX_MATH2PLOT 69 /* control type: radioButton, callback function: CB_OnFreqPlot */ -#define PANEL_CHECKBOX_MATH3SAVE 70 /* control type: radioButton, callback function: CB_OnSaveHg */ -#define PANEL_CHECKBOX_MATH2SAVE 71 /* control type: radioButton, callback function: CB_OnSaveOpt */ -#define PANEL_CHECKBOX_MATH2ALLAN 72 /* control type: radioButton, callback function: CB_OnAllanPlot */ -#define PANEL_TEXTMSG_7 73 /* control type: textMsg, callback function: (none) */ -#define PANEL_MATHSTRING3 74 /* control type: string, callback function: CB_ChangeMath */ -#define PANEL_MATH1 75 /* control type: numeric, callback function: (none) */ -#define PANEL_SPLITTER_6 76 /* control type: splitter, callback function: (none) */ -#define PANEL_TEXTMSG_18 77 /* control type: textMsg, callback function: (none) */ -#define PANEL_TEXTMSG_6 78 /* control type: textMsg, callback function: (none) */ -#define PANEL_TEXTMSG_8 79 /* control type: textMsg, callback function: (none) */ -#define PANEL_TEXTMSG_19 80 /* control type: textMsg, callback function: (none) */ -#define PANEL_MATHSTRING1 81 /* control type: string, callback function: CB_ChangeMath */ -#define PANEL_TEXTMSG_9 82 /* control type: textMsg, callback function: (none) */ -#define PANEL_TEXTMSG_10 83 /* control type: textMsg, callback function: (none) */ -#define PANEL_MATHSTRING2 84 /* control type: string, callback function: CB_ChangeMath */ -#define PANEL_SPLITTER_10 85 /* control type: splitter, callback function: (none) */ -#define PANEL_TEXTMSG_16 86 /* control type: textMsg, callback function: (none) */ -#define PANEL_SPLITTER_11 87 /* control type: splitter, callback function: (none) */ -#define PANEL_SPLITTER_9 88 /* control type: splitter, callback function: (none) */ -#define PANEL_SPLITTER_3 89 /* control type: splitter, callback function: (none) */ -#define PANEL_MINUS10KDDS1 90 /* control type: command, callback function: CB_OnMinus10k */ -#define PANEL_MINUS10KDDS4 91 /* control type: command, callback function: CB_OnMinus10k */ -#define PANEL_MINUS10KDDS3 92 /* control type: command, callback function: CB_OnMinus10k */ -#define PANEL_MINUS10KDDS2 93 /* control type: command, callback function: CB_OnMinus10k */ -#define PANEL_PLUS10KDDS4 94 /* control type: command, callback function: CB_OnPlus10k */ -#define PANEL_MINUS275K 95 /* control type: command, callback function: CB_OnMinus275k */ -#define PANEL_PLUS10KDDS3 96 /* control type: command, callback function: CB_OnPlus10k */ -#define PANEL_PLUS10KDDS1 97 /* control type: command, callback function: CB_OnPlus10k */ -#define PANEL_PLUS10KDDS2 98 /* control type: command, callback function: CB_OnPlus10k */ -#define PANEL_PLUS275K 99 /* control type: command, callback function: CB_OnPlus275k */ -#define PANEL_TEXTMSG_11 100 /* control type: textMsg, callback function: (none) */ -#define PANEL_MATHSTRING5 101 /* control type: textBox, callback function: CB_ChangeMath */ -#define PANEL_SPLITTER_8 102 /* control type: splitter, callback function: (none) */ -#define PANEL_MJD 103 /* control type: numeric, callback function: (none) */ -#define PANEL_UTC 104 /* control type: numeric, callback function: (none) */ -#define PANEL_TIME 105 /* control type: string, callback function: (none) */ -#define PANEL_DATE 106 /* control type: string, callback function: (none) */ -#define PANEL_CHECKBOX_MATH3AUTOSAV 107 /* control type: radioButton, callback function: CB_OnAutoSaveSr */ -#define PANEL_CHECKBOX_MATH2AUTOSAV 108 /* control type: radioButton, callback function: CB_OnAutoSaveHg */ -#define PANEL_CHOOSESAVEFILE 109 /* control type: command, callback function: OnChooseSaveFile */ -#define PANEL_SPLITTER_14 110 /* control type: splitter, callback function: (none) */ -#define PANEL_SPLITTER_13 111 /* control type: splitter, callback function: (none) */ -#define PANEL_DDS4 112 /* control type: numeric, callback function: CB_ChangeDDSOut */ -#define PANEL_SPLITTER_2 113 /* control type: splitter, callback function: (none) */ -#define PANEL_DDS3 114 /* control type: numeric, callback function: CB_ChangeDDSOut */ -#define PANEL_N1CALCULUS 115 /* control type: command, callback function: CB_OnNCalculus */ -#define PANEL_FINDSIGN3 116 /* control type: command, callback function: CB_OnFindSign */ -#define PANEL_SIGN3 117 /* control type: numeric, callback function: (none) */ -#define PANEL_FINDSIGN2 118 /* control type: command, callback function: CB_OnFindSign */ -#define PANEL_SIGN2 119 /* control type: numeric, callback function: (none) */ -#define PANEL_FINDSIGN1 120 /* control type: command, callback function: CB_OnFindSign */ -#define PANEL_SIGN1 121 /* control type: numeric, callback function: (none) */ -#define PANEL_FIND10K3 122 /* control type: command, callback function: CB_OnFind275K */ -#define PANEL_FIND275K2 123 /* control type: command, callback function: CB_OnFind275K */ -#define PANEL_RESETSLOPE 124 /* control type: command, callback function: CB_OnResetSlope */ -#define PANEL_CHECKBOX_STOPIFAUTODE 125 /* control type: radioButton, callback function: CB_OnAutoStopSlopeCancellingIfDelock */ -#define PANEL_CHECKBOX_RECENTER 126 /* control type: radioButton, callback function: CB_OnReCentering */ -#define PANEL_CHECKBOX_KEEPSLOPE 127 /* control type: radioButton, callback function: CB_OnCROX */ -#define PANEL_CHECKBOX_KEEP 128 /* control type: radioButton, callback function: CB_OnCROX */ -#define PANEL_STARTCANCEL 129 /* control type: textButton, callback function: CB_OnStartSlopeCancelling */ -#define PANEL_LED1 130 /* control type: LED, callback function: (none) */ -#define PANEL_LED2 131 /* control type: LED, callback function: (none) */ -#define PANEL_SLOPE_REFERENCE 132 /* control type: ring, callback function: SlopeReference_cb */ +#define PANEL_SPLITTER 32 /* control type: splitter, callback function: (none) */ +#define PANEL_CHANGENDIV 33 /* control type: numeric, callback function: CB_OnChangeNdiv */ +#define PANEL_DDSFREPOUT 34 /* control type: numeric, callback function: CB_ChangeDDSOut */ +#define PANEL_N3CHOICE 35 /* control type: numeric, callback function: CB_ChangeN */ +#define PANEL_N3CALCULUS 36 /* control type: command, callback function: CB_OnNCalculus */ +#define PANEL_N1CHOICE 37 /* control type: numeric, callback function: CB_ChangeN */ +#define PANEL_N2CHOICE 38 /* control type: numeric, callback function: CB_ChangeN */ +#define PANEL_N2CALCULUS 39 /* control type: command, callback function: CB_OnNCalculus */ +#define PANEL_DDS4STEP 40 /* control type: ring, callback function: CB_ChangeDDSStep */ +#define PANEL_DDS3STEP 41 /* control type: ring, callback function: CB_ChangeDDSStep */ +#define PANEL_DDS2STEP 42 /* control type: ring, callback function: CB_ChangeDDSStep */ +#define PANEL_CENTERFREQUENCY 43 /* control type: numeric, callback function: (none) */ +#define PANEL_SLOPETOCANCEL 44 /* control type: numeric, callback function: (none) */ +#define PANEL_MATH4 45 /* control type: numeric, callback function: (none) */ +#define PANEL_MATH5 46 /* control type: numeric, callback function: (none) */ +#define PANEL_MATH3 47 /* control type: numeric, callback function: (none) */ +#define PANEL_CHECKBOX_MATH5PLOT 48 /* control type: radioButton, callback function: CB_OnFreqPlot */ +#define PANEL_CHECKBOX_MATH4PLOT 49 /* control type: radioButton, callback function: CB_OnFreqPlot */ +#define PANEL_CHECKBOX_MATH4ALLAN 50 /* control type: radioButton, callback function: CB_OnAllanPlot */ +#define PANEL_DDS1STEP 51 /* control type: ring, callback function: CB_ChangeDDSStep */ +#define PANEL_TEXTMSG_15 52 /* control type: textMsg, callback function: (none) */ +#define PANEL_CHECKBOX_MATH5ALLAN 53 /* control type: radioButton, callback function: CB_OnAllanPlot */ +#define PANEL_CHECKBOX_MATH3PLOT 54 /* control type: radioButton, callback function: CB_OnFreqPlot */ +#define PANEL_CHECKBOX_MATH5SAVE 55 /* control type: radioButton, callback function: (none) */ +#define PANEL_CHECKBOX_MATH3SAVE_2 56 /* control type: radioButton, callback function: CB_OnSaveSr */ +#define PANEL_CHECKBOX_MATH3ALLAN 57 /* control type: radioButton, callback function: CB_OnAllanPlot */ +#define PANEL_DDSFREPSTEP 58 /* control type: ring, callback function: CB_ChangeDDSStep */ +#define PANEL_DDSFREPAMP 59 /* control type: numeric, callback function: CB_ChangeDDSAmpli */ +#define PANEL_MATHSTRING4 60 /* control type: string, callback function: CB_ChangeMath */ +#define PANEL_TEXTMSG_17 61 /* control type: textMsg, callback function: (none) */ +#define PANEL_MATH2 62 /* control type: numeric, callback function: (none) */ +#define PANEL_SPLITTER_15 63 /* control type: splitter, callback function: (none) */ +#define PANEL_SPLITTER_12 64 /* control type: splitter, callback function: (none) */ +#define PANEL_CHECKBOX_MATH2PLOT 65 /* control type: radioButton, callback function: CB_OnFreqPlot */ +#define PANEL_CHECKBOX_MATH3SAVE 66 /* control type: radioButton, callback function: CB_OnSaveHg */ +#define PANEL_CHECKBOX_MATH2SAVE 67 /* control type: radioButton, callback function: CB_OnSaveOpt */ +#define PANEL_CHECKBOX_MATH2ALLAN 68 /* control type: radioButton, callback function: CB_OnAllanPlot */ +#define PANEL_TEXTMSG_7 69 /* control type: textMsg, callback function: (none) */ +#define PANEL_MATHSTRING3 70 /* control type: string, callback function: CB_ChangeMath */ +#define PANEL_MATH1 71 /* control type: numeric, callback function: (none) */ +#define PANEL_SPLITTER_6 72 /* control type: splitter, callback function: (none) */ +#define PANEL_TEXTMSG_18 73 /* control type: textMsg, callback function: (none) */ +#define PANEL_TEXTMSG_6 74 /* control type: textMsg, callback function: (none) */ +#define PANEL_TEXTMSG_8 75 /* control type: textMsg, callback function: (none) */ +#define PANEL_TEXTMSG_19 76 /* control type: textMsg, callback function: (none) */ +#define PANEL_MATHSTRING1 77 /* control type: string, callback function: CB_ChangeMath */ +#define PANEL_TEXTMSG_9 78 /* control type: textMsg, callback function: (none) */ +#define PANEL_TEXTMSG_10 79 /* control type: textMsg, callback function: (none) */ +#define PANEL_MATHSTRING2 80 /* control type: string, callback function: CB_ChangeMath */ +#define PANEL_TEXTMSG_16 81 /* control type: textMsg, callback function: (none) */ +#define PANEL_SPLITTER_11 82 /* control type: splitter, callback function: (none) */ +#define PANEL_SPLITTER_16 83 /* control type: splitter, callback function: (none) */ +#define PANEL_SPLITTER_9 84 /* control type: splitter, callback function: (none) */ +#define PANEL_SPLITTER_3 85 /* control type: splitter, callback function: (none) */ +#define PANEL_MINUS10KDDS1 86 /* control type: command, callback function: CB_OnMinus10k */ +#define PANEL_MINUS10KDDS4 87 /* control type: command, callback function: CB_OnMinus10k */ +#define PANEL_MINUS10KDDS3 88 /* control type: command, callback function: CB_OnMinus10k */ +#define PANEL_MINUS10KDDS2 89 /* control type: command, callback function: CB_OnMinus10k */ +#define PANEL_PLUS10KDDS4 90 /* control type: command, callback function: CB_OnPlus10k */ +#define PANEL_MINUS275K 91 /* control type: command, callback function: CB_OnMinus275k */ +#define PANEL_PLUS10KDDS3 92 /* control type: command, callback function: CB_OnPlus10k */ +#define PANEL_PLUS10KDDS1 93 /* control type: command, callback function: CB_OnPlus10k */ +#define PANEL_PLUS10KDDS2 94 /* control type: command, callback function: CB_OnPlus10k */ +#define PANEL_PLUS275K 95 /* control type: command, callback function: CB_OnPlus275k */ +#define PANEL_TEXTMSG_11 96 /* control type: textMsg, callback function: (none) */ +#define PANEL_MATHSTRING5 97 /* control type: textBox, callback function: CB_ChangeMath */ +#define PANEL_SPLITTER_8 98 /* control type: splitter, callback function: (none) */ +#define PANEL_MJD 99 /* control type: numeric, callback function: (none) */ +#define PANEL_UTC 100 /* control type: numeric, callback function: (none) */ +#define PANEL_TIME 101 /* control type: string, callback function: (none) */ +#define PANEL_DATE 102 /* control type: string, callback function: (none) */ +#define PANEL_CHECKBOX_MATH3AUTOSAV 103 /* control type: radioButton, callback function: CB_OnAutoSaveSr */ +#define PANEL_CHECKBOX_MATH2AUTOSAV 104 /* control type: radioButton, callback function: CB_OnAutoSaveHg */ +#define PANEL_CHOOSESAVEFILE 105 /* control type: command, callback function: OnChooseSaveFile */ +#define PANEL_SPLITTER_14 106 /* control type: splitter, callback function: (none) */ +#define PANEL_SPLITTER_13 107 /* control type: splitter, callback function: (none) */ +#define PANEL_DDS4 108 /* control type: numeric, callback function: CB_ChangeDDSOut */ +#define PANEL_SPLITTER_2 109 /* control type: splitter, callback function: (none) */ +#define PANEL_DDS3 110 /* control type: numeric, callback function: CB_ChangeDDSOut */ +#define PANEL_N1CALCULUS 111 /* control type: command, callback function: CB_OnNCalculus */ +#define PANEL_FINDSIGN3 112 /* control type: command, callback function: CB_OnFindSign */ +#define PANEL_SIGN3 113 /* control type: numeric, callback function: (none) */ +#define PANEL_FINDSIGN2 114 /* control type: command, callback function: CB_OnFindSign */ +#define PANEL_SIGN2 115 /* control type: numeric, callback function: (none) */ +#define PANEL_FINDSIGN1 116 /* control type: command, callback function: CB_OnFindSign */ +#define PANEL_SIGN1 117 /* control type: numeric, callback function: (none) */ +#define PANEL_FIND10K3 118 /* control type: command, callback function: CB_OnFind275K */ +#define PANEL_FIND275K2 119 /* control type: command, callback function: CB_OnFind275K */ +#define PANEL_RESETSLOPE 120 /* control type: command, callback function: CB_OnResetSlope */ +#define PANEL_CHECKBOX_STOPIFAUTODE 121 /* control type: radioButton, callback function: CB_OnAutoStopSlopeCancellingIfDelock */ +#define PANEL_CHECKBOX_RECENTER 122 /* control type: radioButton, callback function: CB_OnReCentering */ +#define PANEL_CHECKBOX_KEEPSLOPE 123 /* control type: radioButton, callback function: CB_OnCROX */ +#define PANEL_CHECKBOX_KEEP 124 /* control type: radioButton, callback function: CB_OnCROX */ +#define PANEL_STARTCANCEL 125 /* control type: textButton, callback function: CB_OnStartSlopeCancelling */ +#define PANEL_LED1 126 /* control type: LED, callback function: (none) */ +#define PANEL_LED2 127 /* control type: LED, callback function: (none) */ +#define PANEL_SLOPE_REFERENCE 128 /* control type: ring, callback function: CB_OnSlopeReference */ +#define PANEL_ESTIMATE_N3 129 /* control type: command, callback function: CB_OnEstimateN */ /* Menu Bars, Menus, and Menu Items: */ @@ -203,6 +209,7 @@ int CVICALLBACK CB_ChangeMath(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); 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_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); int CVICALLBACK CB_OnAutoSaveSr(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); @@ -210,6 +217,7 @@ int CVICALLBACK CB_OnChangeNdiv(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnCROX(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnDeltaFreq(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); +int CVICALLBACK CB_OnEstimateN(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnEventMain(int panel, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnFind275K(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnFindSign(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); @@ -217,8 +225,10 @@ int CVICALLBACK CB_OnIntegrationTime(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnMinus10k(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnMinus275k(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); -int CVICALLBACK CB_OnN3Stop(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnNCalculus(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); +int CVICALLBACK CB_OnNEstimate(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); +int CVICALLBACK CB_OnNEstimateCancel(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); +int CVICALLBACK CB_OnNEstimateSet(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnNStop(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnPlus10k(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnPlus275k(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); @@ -227,17 +237,15 @@ int CVICALLBACK CB_OnSaveHg(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnSaveOpt(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK CB_OnSaveSr(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); +int CVICALLBACK CB_OnSlopeReference(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); 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_OnStartN3Calculus(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 OnAcceptN(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK OnChooseSaveFile(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); int CVICALLBACK QuitCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); -int CVICALLBACK SlopeReference_cb(int panel, int control, int event, void *callbackData, int eventData1, int eventData2); #ifdef __cplusplus