Mercurial > hg > fxanalyse
comparison FXAnalyse.c @ 34:1e4b8ba97faf
Cleanup code handling dedrifing options
This removes some code that does not make much sense to me.
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Wed, 03 Oct 2012 12:56:22 +0200 |
parents | 09ed37e1da04 |
children | 914e0f16b19a |
comparison
equal
deleted
inserted
replaced
33:09ed37e1da04 | 34:1e4b8ba97faf |
---|---|
2460 | 2460 |
2461 | 2461 |
2462 int CVICALLBACK CB_OnCROX (int panel, int control, int event, | 2462 int CVICALLBACK CB_OnCROX (int panel, int control, int event, |
2463 void *callbackData, int eventData1, int eventData2) | 2463 void *callbackData, int eventData1, int eventData2) |
2464 { | 2464 { |
2465 bool BoxChecked = FALSE; | 2465 switch (event) { |
2466 double ActualFrequ=0.0; | 2466 case EVENT_COMMIT: |
2467 | 2467 switch (control) { |
2468 switch (event) | 2468 |
2469 { | 2469 case PANEL_CHECKBOX_CORRFREQU: |
2470 case EVENT_COMMIT: | 2470 // enable frequency correction |
2471 | 2471 GetCtrlVal(MainPanel, PANEL_CHECKBOX_CORRFREQU, &FrequCorrec); |
2472 if (control== PANEL_CHECKBOX_CORRFREQU) | 2472 break; |
2473 { | 2473 |
2474 GetCtrlVal(MainPanel, PANEL_CHECKBOX_CORRFREQU, &BoxChecked) ; | 2474 case PANEL_CHECKBOX_KEEP: |
2475 if (BoxChecked) { | 2475 // keep current dedrifting frequency when dedrifting is disabled |
2476 FrequCorrec=TRUE ; | 2476 GetCtrlVal(MainPanel, PANEL_CHECKBOX_KEEP, &KeepFrequ); |
2477 } | 2477 break; |
2478 else {FrequCorrec=FALSE ;} | 2478 |
2479 | 2479 case PANEL_CHECKBOX_KEEPSLOPE: |
2480 // keep current dedrifting slope when dedrifting is disabled | |
2481 GetCtrlVal(MainPanel, PANEL_CHECKBOX_KEEPSLOPE, &KeepSlope); | |
2482 break; | |
2480 } | 2483 } |
2481 | |
2482 if (control== PANEL_CHECKBOX_KEEP) | |
2483 { | |
2484 GetCtrlVal(MainPanel, PANEL_CHECKBOX_KEEP, &BoxChecked) ; | |
2485 if (BoxChecked) { | |
2486 KeepFrequ=TRUE ; | |
2487 } | |
2488 else {KeepFrequ=FALSE ;} | |
2489 | |
2490 } | |
2491 | |
2492 | |
2493 if (control== PANEL_CHECKBOX_KEEPSLOPE) | |
2494 { | |
2495 GetCtrlVal(MainPanel, PANEL_CHECKBOX_KEEPSLOPE, &BoxChecked) ; | |
2496 if (BoxChecked) { | |
2497 KeepSlope=TRUE ; | |
2498 if (SlopeMeasuring==FALSE && OnSlopeCancelling==FALSE) | |
2499 { | |
2500 ActualFrequ = DDSFox_ReadFreq(&DDS1xAD9956); | |
2501 DDSFox_Set(&DDS1xAD9956, ActualFrequ, SlopeMath2); | |
2502 OnSlopeCancelling=TRUE; | |
2503 | |
2504 | |
2505 } | |
2506 } | |
2507 else {KeepSlope=FALSE ; | |
2508 if (SlopeMeasuring==FALSE && OnSlopeCancelling==TRUE) | |
2509 { | |
2510 ActualFrequ=DDSFox_ReadFreq(&DDS1xAD9956); | |
2511 DDSFox_Set(&DDS1xAD9956, ActualFrequ, 0.0); | |
2512 OnSlopeCancelling=FALSE; | |
2513 } | |
2514 | |
2515 } | |
2516 | |
2517 } | |
2518 | |
2519 break; | 2484 break; |
2520 | 2485 } |
2521 } | |
2522 return 0; | 2486 return 0; |
2523 } | 2487 } |
2524 | 2488 |
2525 | 2489 |
2526 | 2490 |