changeset 37:5e81800fe354

Cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 03 Oct 2012 15:05:45 +0200
parents fb6092340979
children 537ca522c8b1
files FXAnalyse.c
diffstat 1 files changed, 19 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Wed Oct 03 15:05:40 2012 +0200
+++ b/FXAnalyse.c	Wed Oct 03 15:05:45 2012 +0200
@@ -20,37 +20,22 @@
 
 #define DEDRIFT_DDS_FREQUENCY 70000000
 
-//==============================================================================
-// Static global variables
-
-/* multi threading stuff */  // to be used when I will replace timer by thread for counder readout
-//static int ghPool;
-//static volatile int vgExiting = 0;
-
-/* panel handling stuff */
+// panel handling stuff
 static PanelHandle MainPanel ;
 static PanelHandle CalcN1Panel ;
 static PanelHandle CalcN2Panel ;
 static PanelHandle CalcN3Panel ;
 static PanelHandle EstimateN3Panel;
 
-//==============================================================================
-// Static functions
-
-//static int CVICALLBACK ReadCounterThread(void *functionData);	   // to be used when I will replace timer by thread for counder readout  
-
-//==============================================================================
-// Global variables
-
 char LogFileName[MAX_PATHNAME_LEN];
 char ExtraMathFileName[MAX_PATHNAME_LEN];
 
 double utc = 0;
 double mjd = 0;
 
-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 Ch1, Ch2, Ch3, Ch4;
+double Math1, Math2, Math3, Math4, Math5;
+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 ; 
@@ -60,15 +45,12 @@
 // 4xAD9912 DDS box
 DDS4xAD9912_Data DDS4xAD9912;
 
-muParserHandle_t MathParser1, MathParser2, MathParser3, MathParser4, MathParser5 ;
-
-volatile bool Acquiring = FALSE ;
+muParserHandle_t MathParser1, MathParser2, MathParser3, MathParser4, MathParser5;
 
-long OldLogFilePtr = 0 ;
-double Ndiv=8.0;
+int Acquiring = FALSE;
 
-///////////////////
-//Pour les calculs des N
+long OldLogFilePtr = 0;
+double Ndiv = 8.0;
 
 enum {
 	N_MEASUREMENT_STEP_0,
@@ -91,7 +73,7 @@
 int settling = 0;
 
 int Measuring_1 = FALSE;
-bool Measuring_2 = FALSE, Step1_2 = FALSE, Step2_2 = FALSE, Step3_2 = FALSE;
+int Measuring_2 = FALSE, Step1_2 = FALSE, Step2_2 = FALSE, Step3_2 = FALSE;
 int Measuring_3 = FALSE;
 
 double FrequDDS1=110000000.0, FrequDDS2=15300000.0, FrequDDS3=150400000.0, FrequDDS4=110000000.0;
@@ -122,9 +104,6 @@
 
 int nDDSChange=0, nstabilization=0;
 
-//////
-//Pour les signes de fb
-
 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;
@@ -132,19 +111,14 @@
 volatile bool Getsign1=FALSE,Getsign2=FALSE,Getsign3=FALSE;
 double Signe1=1.0,Signe2=1.0,Signe3=0.0;
 
-
-
-
-
-/////////////////////////
-// Slope Cancelling Variables
+// slope cancelling
 
-volatile bool SlopeMeasuring=FALSE;
-volatile bool AutoStopSlopeCancellingIfDelock=TRUE;
-volatile bool OnSlopeCancelling =FALSE;  
-double SlopeMath2=0.0;
-double TimetoSlope=60.0;
-double SlopeMeasuringTimeBegin=0.0;
+int SlopeMeasuring = FALSE;
+int AutoStopSlopeCancellingIfDelock = TRUE;
+int OnSlopeCancelling = FALSE;
+double SlopeMath2 = 0.0; // currently applied frequency dedrifiting slope
+double TimetoSlope = 60.0;
+double SlopeMeasuringTimeBegin = 0.0;
 
 double Slope_Math2slope=0.0,Math2_slope=0.0,Moy_Math2slope=0.0;
 int N_Math2slope=0.0,nstabilisationSlopeMeasuring=0;
@@ -155,12 +129,10 @@
 
 int ratio=10; //Recentre la frequence tous les ratios
 
-volatile bool FrequCorrec=FALSE,KeepFrequ=TRUE, KeepSlope=TRUE ;
-int Nratio=-1;
+int FrequCorrec = FALSE, KeepFrequ = TRUE, KeepSlope = TRUE;
+int Nratio = -1;
 double MoyMath2 = 0.0, CenterFrequencyCh2 = 0.0;
-volatile bool CenterFrequencyCh2ToDetermine=FALSE;
-
-
+int CenterFrequencyCh2ToDetermine = FALSE;
 
 enum {
 	SLOPE_REFERENCE_MICROWAVE = 0,
@@ -169,9 +141,6 @@
 
 int slopeReference = SLOPE_REFERENCE_MICROWAVE;
 
-//////////////////////////////////
-//  Keep Centered Variables
-
 volatile bool KeepCentering=FALSE; 
 double Timetorecenter275K=3600.0*10; 
 double Timetorecenter10K=3600.0*3;  
@@ -266,7 +235,6 @@
 	GetCtrlVal(MainPanel, PANEL_DDS4, &initfreqDDS) ;
 	DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, initfreqDDS) ;
 	
-	
 	// initialyze 1x AD9956 DDS box
 	strcpy(DDS1xAD9956.ip, "145.238.205.58"); 
 	DDS1xAD9956.Port = 6665;