Mercurial > hg > fxanalyse
comparison FXAnalyse.c @ 14:783407954cdf
Minor code cleanup
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Mon, 16 Jul 2012 13:15:30 +0200 |
parents | 239f2fe67cc0 |
children | 9cadd12e7722 |
comparison
equal
deleted
inserted
replaced
13:e45d6e9544f5 | 14:783407954cdf |
---|---|
2678 } | 2678 } |
2679 return 0; | 2679 return 0; |
2680 } | 2680 } |
2681 | 2681 |
2682 | 2682 |
2683 int CVICALLBACK CB_OnResetSlope (int panel, int control, int event, | 2683 int CVICALLBACK CB_OnResetSlope (int panel, int control, int event, |
2684 void *callbackData, int eventData1, int eventData2) | 2684 void *callbackData, int eventData1, int eventData2) |
2685 { | 2685 { |
2686 | 2686 |
2687 switch (event) | 2687 switch (event) { |
2688 { | 2688 case EVENT_COMMIT: |
2689 case EVENT_COMMIT: | 2689 SlopeMath2 = 0.0; |
2690 if (control==PANEL_RESETSLOPE){ | 2690 CenterFrequencyCh2 = 0.0; |
2691 | 2691 MoyMath2 = 0.0; |
2692 SlopeMath2=0.0; | 2692 Nratio = -1; |
2693 CenterFrequencyCh2=0.0; | 2693 CenterFrequencyCh2ToDetermine = TRUE ; |
2694 MoyMath2=0.0; | 2694 OnSlopeCancelling = FALSE; |
2695 Nratio=-1; | 2695 LaunchDDSFOX (DDSFoxName,DDSFoxip,DDSFoxPort,DDSFoxProfil,DDSFoxClock,DDSFoxDeltaT,DDSFoxFrequency,DDSFoxSweeprate,0); |
2696 CenterFrequencyCh2ToDetermine=TRUE ; | 2696 break; |
2697 OnSlopeCancelling =FALSE; | 2697 } |
2698 LaunchDDSFOX (DDSFoxName,DDSFoxip,DDSFoxPort,DDSFoxProfil,DDSFoxClock,DDSFoxDeltaT,DDSFoxFrequency,DDSFoxSweeprate,0); | |
2699 } | |
2700 | |
2701 break; | |
2702 | |
2703 } | |
2704 return 0; | 2698 return 0; |
2705 } | 2699 } |
2706 | 2700 |
2707 | 2701 |
2708 int CVICALLBACK CB_ChangeSlopeTime (int panel, int control, int event, | 2702 int CVICALLBACK CB_ChangeSlopeTime (int panel, int control, int event, |
2709 void *callbackData, int eventData1, int eventData2) | 2703 void *callbackData, int eventData1, int eventData2) |
2710 { | 2704 { |
2711 | 2705 |
2712 switch (event) | 2706 switch (event) { |
2713 { | 2707 case EVENT_COMMIT: |
2714 case EVENT_COMMIT: | 2708 GetCtrlVal(MainPanel, PANEL_SLOPETIME, &TimetoSlope); |
2715 if (control==PANEL_SLOPETIME){ | 2709 break; |
2716 | 2710 } |
2717 GetCtrlVal(MainPanel, PANEL_SLOPETIME, &TimetoSlope); | 2711 return 0; |
2718 } | 2712 } |
2719 | 2713 |
2720 break; | 2714 |
2721 | 2715 int LaunchDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate,int mode) |
2722 } | 2716 { |
2723 return 0; | 2717 //mode =0 pour normal |
2724 } | 2718 //mode =1 pour reset |
2725 | 2719 |
2726 | |
2727 int LaunchDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate,int mode) | |
2728 { | |
2729 //mode =0 pour normal | |
2730 //mode =1 pour reset | |
2731 DDSParameter DDSState; | 2720 DDSParameter DDSState; |
2732 strcpy(DDSState.Name ,Name) ; | 2721 |
2733 DDSState.Profil = Profil ; | 2722 strcpy(DDSState.Name, Name); |
2734 strcpy(DDSState.ip,ip) ; | 2723 DDSState.Profil = Profil; |
2735 DDSState.Port = Port; | 2724 strcpy(DDSState.ip, ip); |
2736 DDSState.Clock = Clock; | 2725 DDSState.Port = Port; |
2737 DDSState.Delta_T = DeltaT; | 2726 DDSState.Clock = Clock; |
2738 DDSState.Frequency = Frequency; | 2727 DDSState.Delta_T = DeltaT; |
2739 DDSState.SweepRate = Sweeprate ; | 2728 DDSState.Frequency = Frequency; |
2740 if (mode == 1) { DDS_Initialize (&DDSState) ; } | 2729 DDSState.SweepRate = Sweeprate; |
2741 else { DDS_ReInitialize (&DDSState) ; } | 2730 |
2731 if (mode == 1) { | |
2732 DDS_Initialize (&DDSState); | |
2733 } else { | |
2734 DDS_ReInitialize (&DDSState); | |
2735 } | |
2742 | 2736 |
2743 return 0; | 2737 return 0; |
2744 } | 2738 } |
2745 | 2739 |
2746 double ReadDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate) | 2740 double ReadDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate) |
2747 { | 2741 { |
2748 | 2742 |
2749 DDSParameter DDSState; | 2743 DDSParameter DDSState; |
2750 double FrequDDSFox; | 2744 |
2751 | 2745 strcpy(DDSState.Name, Name); |
2752 strcpy(DDSState.Name ,Name) ; | 2746 DDSState.Profil = Profil; |
2753 DDSState.Profil = Profil ; | 2747 strcpy(DDSState.ip, ip); |
2754 strcpy(DDSState.ip,ip) ; | 2748 DDSState.Port = Port; |
2755 DDSState.Port = Port; | 2749 DDSState.Clock = Clock; |
2756 DDSState.Clock = Clock; | 2750 DDSState.Delta_T = DeltaT; |
2757 DDSState.Delta_T = DeltaT; | 2751 DDSState.Frequency = Frequency; |
2758 DDSState.Frequency = Frequency; | 2752 DDSState.SweepRate = Sweeprate; |
2759 DDSState.SweepRate = Sweeprate ; | 2753 |
2760 | 2754 return DDSFox_ReadFreq(&DDSState); |
2761 FrequDDSFox=DDSFox_ReadFreq(&DDSState); | |
2762 | |
2763 | |
2764 return FrequDDSFox; | |
2765 } | 2755 } |
2766 | 2756 |
2767 | 2757 |
2768 int CVICALLBACK CB_OnCROX (int panel, int control, int event, | 2758 int CVICALLBACK CB_OnCROX (int panel, int control, int event, |
2769 void *callbackData, int eventData1, int eventData2) | 2759 void *callbackData, int eventData1, int eventData2) |