changeset 60:cd7b5903f168

Display measured slope
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Thu, 18 Oct 2012 12:24:19 +0200
parents d0aa333e6451
children 37075b60408b
files FXAnalyse.c FXAnalyse.h FXAnalyse.uir
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Wed Oct 17 17:40:40 2012 +0200
+++ b/FXAnalyse.c	Thu Oct 18 12:24:19 2012 +0200
@@ -1230,7 +1230,7 @@
 						if (! KeepSlope)
 							SlopeMath2 = 0.0;
 						
-						SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2);
+						SetCtrlVal(MainPanel, PANEL_SLOPE_APPLIED, SlopeMath2);
 						DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2);
 						
 						Slope_Math2slope = 0.0;
@@ -1243,6 +1243,8 @@
 					Math2_slope = currentFreq;
 					Moy_Math2slope = ((N_Math2slope-1)*Moy_Math2slope + Math2_slope)/N_Math2slope;
 					Slope_Math2slope = (Slope_Math2slope*(N_Math2slope-2) + 6*(Math2_slope-Moy_Math2slope)/N_Math2slope)/(N_Math2slope+1);
+					// update indicator
+					SetCtrlVal(MainPanel, PANEL_SLOPE_MEASURED, 0);
 					
 					// update applied slope
 					if ((utc - SlopeMeasuringTimeBegin) > TimetoSlope) {
@@ -1272,7 +1274,7 @@
 						}
 						
 						double frequency = DDSFox_ReadFreq(&DDS1xAD9956);
-						SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2);
+						SetCtrlVal(MainPanel, PANEL_SLOPE_APPLIED, SlopeMath2);
 						DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2);
 						
 						N_Math2slope = 0.0;
@@ -2213,7 +2215,7 @@
 				SlopeMeasuring = TRUE;
 				
 				frequency = DDSFox_ReadFreq(&DDS1xAD9956);
-				GetCtrlVal(panel, PANEL_SLOPETOCANCEL, &SlopeMath2);
+				GetCtrlVal(panel, PANEL_SLOPE_APPLIED, &SlopeMath2);
 				DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2);
 				
 				Nratio = -1;
@@ -2229,7 +2231,7 @@
 				if (! KeepSlope)
 					SlopeMath2 = 0.0;
 				
-				SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2);
+				SetCtrlVal(panel, PANEL_SLOPE_APPLIED, SlopeMath2);
 				DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2);
 				
 				SlopeMeasuring = FALSE; 
@@ -2259,7 +2261,7 @@
 			Nratio = -1;
 			CenterFrequencyCh2ToDetermine = TRUE ;
 			SlopeMath2 = 0.0; 
-			SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2);
+			SetCtrlVal(panel, PANEL_SLOPE_APPLIED, SlopeMath2);
 			DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, SlopeMath2);
 			break;
 	}
--- a/FXAnalyse.h	Wed Oct 17 17:40:40 2012 +0200
+++ b/FXAnalyse.h	Thu Oct 18 12:24:19 2012 +0200
@@ -92,7 +92,7 @@
 #define  PANEL_DDS3STEP                   38      /* control type: ring, callback function: CB_ChangeDDSStep */
 #define  PANEL_DDS2STEP                   39      /* control type: ring, callback function: CB_ChangeDDSStep */
 #define  PANEL_CENTERFREQUENCY            40      /* control type: numeric, callback function: (none) */
-#define  PANEL_SLOPETOCANCEL              41      /* control type: numeric, callback function: CB_SetSlope */
+#define  PANEL_SLOPE_APPLIED              41      /* control type: numeric, callback function: CB_SetSlope */
 #define  PANEL_MATH4                      42      /* control type: numeric, callback function: (none) */
 #define  PANEL_MATH5                      43      /* control type: numeric, callback function: (none) */
 #define  PANEL_MATH3                      44      /* control type: numeric, callback function: (none) */
@@ -173,6 +173,7 @@
 #define  PANEL_ESTIMATE_N3                119     /* control type: command, callback function: CB_OnEstimateN */
 #define  PANEL_INVERT_SLOPE_SIGN          120     /* control type: radioButton, callback function: CB_InvertSlopeSign */
 #define  PANEL_MEASURE_SLOPE              121     /* control type: LED, callback function: CB_MeasureSlope */
+#define  PANEL_SLOPE_MEASURED             122     /* control type: numeric, callback function: (none) */
 
 
      /* Menu Bars, Menus, and Menu Items: */
Binary file FXAnalyse.uir has changed