Mercurial > hg > fxanalyse
comparison FXAnalyse.c @ 20:3a7f088d4960
Get rid of unused variables. Some minor coding style improvements
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Thu, 19 Jul 2012 19:34:36 +0200 |
parents | 9cadd12e7722 |
children | b7b3b5f1c5a6 |
comparison
equal
deleted
inserted
replaced
19:e9d8791502c0 | 20:3a7f088d4960 |
---|---|
397 return 0; | 397 return 0; |
398 } | 398 } |
399 | 399 |
400 int CVICALLBACK CB_OnEventMain(int panel, int event, void *callbackData, int eventData1, int eventData2) | 400 int CVICALLBACK CB_OnEventMain(int panel, int event, void *callbackData, int eventData1, int eventData2) |
401 { | 401 { |
402 int VirtualKeyCode ; | |
403 int ActiveControl ; | 402 int ActiveControl ; |
404 int StepIndex ; | 403 int StepIndex ; |
405 double Step ; | 404 double Step ; |
406 | 405 |
407 switch (event) { | 406 switch (event) { |
536 | 535 |
537 | 536 |
538 int CVICALLBACK CB_OnStart (int panel, int control, int event, | 537 int CVICALLBACK CB_OnStart (int panel, int control, int event, |
539 void *callbackData, int eventData1, int eventData2) | 538 void *callbackData, int eventData1, int eventData2) |
540 { | 539 { |
541 int LogFile ; | 540 switch (event) |
542 char CharacterBuffer[]="\r" ; | 541 { |
543 char LineBuffer[FXLINELENGTH+10] = "\r\n_1 "; | |
544 | |
545 | |
546 switch (event) | |
547 { | |
548 case EVENT_COMMIT: | 542 case EVENT_COMMIT: |
549 if (Acquiring) { | 543 if (Acquiring) { |
550 PlotCh1.IndexPoint = 0 ; | 544 PlotCh1.IndexPoint = 0; |
551 PlotCh2.IndexPoint = 0 ; | 545 PlotCh2.IndexPoint = 0; |
552 PlotCh3.IndexPoint = 0 ; | 546 PlotCh3.IndexPoint = 0; |
553 PlotCh4.IndexPoint = 0 ; | 547 PlotCh4.IndexPoint = 0; |
554 PlotMath1.IndexPoint = 0 ; | 548 PlotMath1.IndexPoint = 0; |
555 PlotMath2.IndexPoint = 0 ; | 549 PlotMath2.IndexPoint = 0; |
556 PlotMath3.IndexPoint = 0 ; | 550 PlotMath3.IndexPoint = 0; |
557 PlotMath4.IndexPoint = 0 ; | 551 PlotMath4.IndexPoint = 0; |
558 PlotMath5.IndexPoint = 0 ; | 552 PlotMath5.IndexPoint = 0; |
559 Allan_Reset(&AllanCh1) ; | 553 Allan_Reset(&AllanCh1); |
560 Allan_Reset(&AllanCh2) ; | 554 Allan_Reset(&AllanCh2); |
561 Allan_Reset(&AllanCh3) ; | 555 Allan_Reset(&AllanCh3); |
562 Allan_Reset(&AllanCh4) ; | 556 Allan_Reset(&AllanCh4); |
563 Allan_Reset(&AllanMath1) ; | 557 Allan_Reset(&AllanMath1); |
564 Allan_Reset(&AllanMath2) ; | 558 Allan_Reset(&AllanMath2); |
565 Allan_Reset(&AllanMath3) ; | 559 Allan_Reset(&AllanMath3); |
566 Allan_Reset(&AllanMath4) ; | 560 Allan_Reset(&AllanMath4); |
567 Allan_Reset(&AllanMath5) ; | 561 Allan_Reset(&AllanMath5); |
568 } ; | 562 } |
569 Acquiring = TRUE ; | 563 Acquiring = TRUE; |
570 SetCtrlAttribute(MainPanel, PANEL_STARTBUTTON, ATTR_LABEL_TEXT, "__RESET"); | 564 SetCtrlAttribute(MainPanel, PANEL_STARTBUTTON, ATTR_LABEL_TEXT, "__RESET"); |
571 | 565 |
572 FindCurrentFileName() ; // LogFileName is the one corresponding to the date of today... | 566 FindCurrentFileName(); // LogFileName is the one corresponding to the date of today... |
573 GetFileInfo(LogFileName, &OldLogFilePtr) ; | 567 GetFileInfo(LogFileName, &OldLogFilePtr); |
574 OldLogFilePtr -= OldLogFilePtr%FXLINELENGTH + FXLINELENGTH - 2; | 568 OldLogFilePtr -= OldLogFilePtr%FXLINELENGTH + FXLINELENGTH - 2; |
575 break; | |
576 case EVENT_RIGHT_CLICK: | |
577 | |
578 break; | 569 break; |
579 } | 570 } |
580 return 0; | 571 return 0; |
581 } | 572 } |
582 | 573 |
597 } | 588 } |
598 | 589 |
599 int CVICALLBACK CB_OnTimer (int panel, int control, int event, | 590 int CVICALLBACK CB_OnTimer (int panel, int control, int event, |
600 void *callbackData, int eventData1, int eventData2) | 591 void *callbackData, int eventData1, int eventData2) |
601 { | 592 { |
602 int LogFile, FileOpt, FileHg, FileSr, FileExtraMath ; | 593 int LogFile, FileOpt, FileHg, FileExtraMath; |
603 long LogFileSize ; | 594 long LogFileSize; |
604 char CharacterBuffer[]="\r" ; | |
605 char LineBuffer[FXLINELENGTH+10] = "\r\n_1 "; | 595 char LineBuffer[FXLINELENGTH+10] = "\r\n_1 "; |
606 | 596 |
607 char * dateNow, * timeNow, day[4], month[4], year[4] ; | 597 char TimeTag[] = "100103 000000.000"; // K+K time tag meaning here 2010 january the 3rd at 00:00:00.000 |
608 char TimeTag[] = "100103 000000.000" ; // K+K time tag meaning here 2010 january the 3rd at 00:00:00.000 | |
609 char Date[] = "03/01/2010" ; | 598 char Date[] = "03/01/2010" ; |
610 char Time[] = "00:00:00.000" ; | 599 char Time[] = "00:00:00.000" ; |
611 char Year[] = "2010"; | 600 char Year[] = "2010"; |
612 char ShortYear[] = "10"; // the last 2 digits of calendar year only | 601 char ShortYear[] = "10"; // the last 2 digits of calendar year only |
613 char Month[] = "01"; | 602 char Month[] = "01"; |
614 char Day[] = "03"; | 603 char Day[] = "03"; |
615 char Hour[] = "00"; | 604 char Hour[] = "00"; |
616 char Min[] = "00" ; | 605 char Min[] = "00" ; |
617 char Sec[] = "00.000"; | 606 char Sec[] = "00.000"; |
618 struct tm LocalTime ; | 607 struct tm LocalTime ; |
619 time_t utcTime ; | 608 time_t utcTime; |
620 char * ReportString = "dd.mm.yy\t00:00:00\t3481610838.000\t0000000000000.00000000" ; | 609 char * ReportString = "dd.mm.yy\t00:00:00\t3481610838.000\t0000000000000.00000000"; |
621 | 610 |
622 int NotCare = 0 ; | 611 int BoxChecked = FALSE; |
623 bool BoxChecked = FALSE; | |
624 | |
625 double Target, NCalc ; | |
626 | 612 |
627 double FoxFrequ=0.0; | 613 double FoxFrequ=0.0; |
628 int Div = 1 ; | |
629 | 614 |
630 double FrequencyToChange=0.0; | 615 double FrequencyToChange=0.0; |
631 double DeltaCh2=0.0; | 616 double DeltaCh2=0.0; |
632 double DeltaCh4=0.0; | 617 double DeltaCh4=0.0; |
633 | 618 |
634 double ActualFrequ=0.0; | 619 double ActualFrequ=0.0; |
635 double ActualSlope=0.0; | 620 double ActualSlope=0.0; |
636 | 621 |
637 double DDS3Bize ; | 622 switch (event) |
638 double DDS2Bize ; | 623 { |
639 int N2Bize ; | |
640 int Signe2Bize; | |
641 double Math3Bize; | |
642 double Math1Bize; | |
643 | |
644 | |
645 | |
646 switch (event) | |
647 { | |
648 case EVENT_TIMER_TICK: | 624 case EVENT_TIMER_TICK: |
649 switch(Acquiring) | 625 switch(Acquiring) |
650 { | 626 { |
651 case TRUE: | 627 case TRUE: |
652 | 628 |
1372 * Slope Cancelling | 1348 * Slope Cancelling |
1373 */ | 1349 */ |
1374 | 1350 |
1375 if (SlopeMeasuring == TRUE) | 1351 if (SlopeMeasuring == TRUE) |
1376 { | 1352 { |
1377 double currentFreq; | 1353 double currentFreq = 0.0; |
1378 | 1354 |
1379 /* select reference */ | 1355 /* select reference */ |
1380 switch (slopeReference) { | 1356 switch (slopeReference) { |
1381 case SLOPE_REFERENCE_MICROWAVE: | 1357 case SLOPE_REFERENCE_MICROWAVE: |
1382 currentFreq = Math2; | 1358 currentFreq = Math2; |
2859 | 2835 |
2860 | 2836 |
2861 int CVICALLBACK CB_OnAutoStopSlopeCancellingIfDelock (int panel, int control, int event, | 2837 int CVICALLBACK CB_OnAutoStopSlopeCancellingIfDelock (int panel, int control, int event, |
2862 void *callbackData, int eventData1, int eventData2) | 2838 void *callbackData, int eventData1, int eventData2) |
2863 { | 2839 { |
2864 bool BoxChecked = FALSE; | 2840 switch (event) |
2865 double ActualFrequ=0.0; | 2841 { |
2866 | 2842 case EVENT_COMMIT: |
2867 switch (event) | 2843 GetCtrlVal(MainPanel, PANEL_CHECKBOX_STOPIFAUTODE, &AutoStopSlopeCancellingIfDelock); |
2868 { | 2844 break; |
2869 case EVENT_COMMIT: | 2845 } |
2870 | |
2871 if (control== PANEL_CHECKBOX_STOPIFAUTODE) | |
2872 { | |
2873 GetCtrlVal(MainPanel, PANEL_CHECKBOX_STOPIFAUTODE, &BoxChecked) ; | |
2874 if (BoxChecked) { | |
2875 AutoStopSlopeCancellingIfDelock=TRUE ; | |
2876 } | |
2877 else {AutoStopSlopeCancellingIfDelock=FALSE ;} | |
2878 | |
2879 } | |
2880 | |
2881 | |
2882 break; | |
2883 | |
2884 } | |
2885 return 0; | 2846 return 0; |
2886 } | 2847 } |
2887 | 2848 |
2888 int CVICALLBACK CB_OnSlopeReference (int panel, int control, int event, | 2849 int CVICALLBACK CB_OnSlopeReference (int panel, int control, int event, |
2889 void *callbackData, int eventData1, int eventData2) | 2850 void *callbackData, int eventData1, int eventData2) |