changeset 80:46fe62febcd0

Add dedrifting DDS reset functionality
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Mon, 18 Mar 2013 12:34:05 +0100
parents 930acf691aa4
children be814b934eca
files FXAnalyse.c FXAnalyse.h FXAnalyse.uir
diffstat 3 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Wed Feb 27 09:49:05 2013 +0100
+++ b/FXAnalyse.c	Mon Mar 18 12:34:05 2013 +0100
@@ -2243,3 +2243,28 @@
 	return 0;
 }
 
+int CVICALLBACK CB_ResetDedriftDDS (int panel, int control, int event,
+		void *callbackData, int eventData1, int eventData2)
+{
+	switch (event)
+	{
+		case EVENT_COMMIT:
+			// stop slope measurement and reset slope 
+			SlopeMeasuring = 0;
+			SetCtrlVal(panel, PANEL_MEASURE_SLOPE, SlopeMeasuring);
+			CenterFrequencyCh2 = 0.0;
+			MoyMath2 = 0.0;
+			Nratio = -1;
+			CenterFrequencyCh2ToDetermine = TRUE ;
+			appliedSlope = 0.0;
+			SetCtrlVal(panel, PANEL_SLOPE_APPLIED, appliedSlope);
+			// reset DDS
+			DDSFox_Reset(&DDS1xAD9956);
+			DDSFox_SetProfile(&DDS1xAD9956);
+			DDSFox_SetDiv(&DDS1xAD9956, 1);
+			DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, appliedSlope);
+			break;
+	}
+	return 0;
+}
+
--- a/FXAnalyse.h	Wed Feb 27 09:49:05 2013 +0100
+++ b/FXAnalyse.h	Mon Mar 18 12:34:05 2013 +0100
@@ -1,6 +1,6 @@
 /**************************************************************************/
 /* LabWindows/CVI User Interface Resource (UIR) Include File              */
-/* Copyright (c) National Instruments 2012. All Rights Reserved.          */
+/* Copyright (c) National Instruments 2013. All Rights Reserved.          */
 /*                                                                        */
 /* WARNING: Do not add to, delete from, or otherwise modify the contents  */
 /*          of this include file.                                         */
@@ -171,6 +171,7 @@
 #define  PANEL_INVERT_SLOPE_SIGN          117     /* control type: radioButton, callback function: CB_InvertSlopeSign */
 #define  PANEL_MEASURE_SLOPE              118     /* control type: LED, callback function: CB_MeasureSlope */
 #define  PANEL_SLOPE_MEASURED             119     /* control type: numeric, callback function: (none) */
+#define  PANEL_RESET_DEDRIFT_DDS          120     /* control type: command, callback function: CB_ResetDedriftDDS */
 
 
      /* Menu Bars, Menus, and Menu Items: */
@@ -214,6 +215,7 @@
 int  CVICALLBACK CB_OnStop(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_OnStopSlopeCancellingOnUnlocked(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 CB_ResetDedriftDDS(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 int  CVICALLBACK CB_SetSlope(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);
 
Binary file FXAnalyse.uir has changed