comparison FXAnalyse.c @ 48:70980f27e1a4

Simplify dedrifting interface
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 10 Oct 2012 13:12:55 +0200
parents 1d3cd8260cbb
children fbb172892253
comparison
equal deleted inserted replaced
47:1d3cd8260cbb 48:70980f27e1a4
594 SetCtrlVal(MainPanel, PANEL_FREQ4, Ch4); 594 SetCtrlVal(MainPanel, PANEL_FREQ4, Ch4);
595 SetCtrlVal(MainPanel, PANEL_SIGN1, Signe1); 595 SetCtrlVal(MainPanel, PANEL_SIGN1, Signe1);
596 SetCtrlVal(MainPanel, PANEL_SIGN2, Signe2); 596 SetCtrlVal(MainPanel, PANEL_SIGN2, Signe2);
597 SetCtrlVal(MainPanel, PANEL_SIGN3, Signe3); 597 SetCtrlVal(MainPanel, PANEL_SIGN3, Signe3);
598 SetCtrlVal(MainPanel, PANEL_CENTERFREQUENCY, CenterFrequencyCh2); 598 SetCtrlVal(MainPanel, PANEL_CENTERFREQUENCY, CenterFrequencyCh2);
599 SetCtrlVal(MainPanel, PANEL_LED1, SlopeMeasuring);
600 SetCtrlVal(MainPanel, PANEL_LED2, OnSlopeCancelling);
601 599
602 // Treat data 600 // Treat data
603 601
604 Math1 = mupEval(MathParser1); 602 Math1 = mupEval(MathParser1);
605 SetCtrlVal(MainPanel,PANEL_MATH1, Math1); 603 SetCtrlVal(MainPanel,PANEL_MATH1, Math1);
1332 CenterFrequencyCh2 = 0.0; 1330 CenterFrequencyCh2 = 0.0;
1333 CenterFrequencyCh2ToDetermine = TRUE; 1331 CenterFrequencyCh2ToDetermine = TRUE;
1334 Nratio = -1; 1332 Nratio = -1;
1335 nstabilisationSlopeMeasuring = 0; 1333 nstabilisationSlopeMeasuring = 0;
1336 1334
1337 SetCtrlVal(MainPanel, PANEL_STARTCANCEL, 0); 1335 SetCtrlVal(MainPanel, PANEL_MEASURE_SLOPE, 0);
1338 } 1336 }
1339 } 1337 }
1340 } 1338 }
1341 } 1339 }
1342 } 1340 }
2260 } 2258 }
2261 return 0; 2259 return 0;
2262 } 2260 }
2263 2261
2264 2262
2265 int CVICALLBACK CB_OnStartSlopeCancelling (int panel, int control, int event, 2263 int CVICALLBACK CB_MeasureSlope (int panel, int control, int event,
2266 void *callbackData, int eventData1, int eventData2) 2264 void *callbackData, int eventData1, int eventData2)
2267 { 2265 {
2268
2269 double frequency; 2266 double frequency;
2270 int activate; 2267 int active;
2271 2268
2272 switch (event) 2269 switch (event)
2273 { 2270 {
2274 case EVENT_COMMIT: 2271 case EVENT_COMMIT:
2275 2272
2276 GetCtrlVal(MainPanel, PANEL_STARTCANCEL, &activate); 2273 GetCtrlVal(panel, control, &active);
2277 2274
2278 if (activate) { 2275 if (active) {
2279 2276
2280 SlopeMeasuringTimeBegin = utc; 2277 SlopeMeasuringTimeBegin = utc;
2281 SlopeMeasuring = TRUE; 2278 SlopeMeasuring = TRUE;
2282 2279
2283 frequency = DDSFox_ReadFreq(&DDS1xAD9956); 2280 frequency = DDSFox_ReadFreq(&DDS1xAD9956);
2284 GetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, &SlopeMath2); 2281 GetCtrlVal(panel, PANEL_SLOPETOCANCEL, &SlopeMath2);
2285 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); 2282 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2);
2286 2283
2287 Nratio = -1; 2284 Nratio = -1;
2288 CenterFrequencyCh2ToDetermine = TRUE ; 2285 CenterFrequencyCh2ToDetermine = TRUE ;
2289 CenterFrequencyCh2 = 0.0; 2286 CenterFrequencyCh2 = 0.0;
2292 2289
2293 frequency = DEDRIFT_DDS_FREQUENCY; 2290 frequency = DEDRIFT_DDS_FREQUENCY;
2294 if (KeepFrequ) 2291 if (KeepFrequ)
2295 frequency = DDSFox_ReadFreq(&DDS1xAD9956); 2292 frequency = DDSFox_ReadFreq(&DDS1xAD9956);
2296 2293
2297 if (! KeepSlope) { 2294 if (! KeepSlope)
2298 SlopeMath2 = 0.0; 2295 SlopeMath2 = 0.0;
2299 OnSlopeCancelling = FALSE; 2296
2300 } 2297 SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2);
2301
2302 SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2);
2303 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); 2298 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2);
2304 2299
2305 SlopeMeasuring = FALSE; 2300 SlopeMeasuring = FALSE;
2306 N_Math2slope = 0.0; 2301 N_Math2slope = 0.0;
2307 Math2_slope = 0.0; 2302 Math2_slope = 0.0;
2330 MoyMath2 = 0.0; 2325 MoyMath2 = 0.0;
2331 Nratio = -1; 2326 Nratio = -1;
2332 CenterFrequencyCh2ToDetermine = TRUE ; 2327 CenterFrequencyCh2ToDetermine = TRUE ;
2333 OnSlopeCancelling = FALSE; 2328 OnSlopeCancelling = FALSE;
2334 SlopeMath2 = 0.0; 2329 SlopeMath2 = 0.0;
2335 SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2); 2330 SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2);
2336 DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, SlopeMath2); 2331 DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, SlopeMath2);
2337 break; 2332 break;
2338 } 2333 }
2339 return 0; 2334 return 0;
2340 } 2335 }
2541 GetCtrlVal(panel, control, &invertSlopeSign); 2536 GetCtrlVal(panel, control, &invertSlopeSign);
2542 break; 2537 break;
2543 } 2538 }
2544 return 0; 2539 return 0;
2545 } 2540 }
2541