# HG changeset patch # User Daniele Nicolodi # Date 1342437330 -7200 # Node ID 783407954cdf27aa249179d2f5fd7fcf56b468c7 # Parent e45d6e9544f57992218ab490dce6dd38cba86581 Minor code cleanup diff -r e45d6e9544f5 -r 783407954cdf FXAnalyse.c --- a/FXAnalyse.c Mon Jul 16 13:04:01 2012 +0200 +++ b/FXAnalyse.c Mon Jul 16 13:15:30 2012 +0200 @@ -2680,88 +2680,78 @@ } - int CVICALLBACK CB_OnResetSlope (int panel, int control, int event, - void *callbackData, int eventData1, int eventData2) +int CVICALLBACK CB_OnResetSlope (int panel, int control, int event, + void *callbackData, int eventData1, int eventData2) { - switch (event) - { + switch (event) { case EVENT_COMMIT: - if (control==PANEL_RESETSLOPE){ - - SlopeMath2=0.0; - CenterFrequencyCh2=0.0; - MoyMath2=0.0; - Nratio=-1; - CenterFrequencyCh2ToDetermine=TRUE ; - OnSlopeCancelling =FALSE; - LaunchDDSFOX (DDSFoxName,DDSFoxip,DDSFoxPort,DDSFoxProfil,DDSFoxClock,DDSFoxDeltaT,DDSFoxFrequency,DDSFoxSweeprate,0); - } - + SlopeMath2 = 0.0; + CenterFrequencyCh2 = 0.0; + MoyMath2 = 0.0; + Nratio = -1; + CenterFrequencyCh2ToDetermine = TRUE ; + OnSlopeCancelling = FALSE; + LaunchDDSFOX (DDSFoxName,DDSFoxip,DDSFoxPort,DDSFoxProfil,DDSFoxClock,DDSFoxDeltaT,DDSFoxFrequency,DDSFoxSweeprate,0); break; - - } + } return 0; } - int CVICALLBACK CB_ChangeSlopeTime (int panel, int control, int event, - void *callbackData, int eventData1, int eventData2) +int CVICALLBACK CB_ChangeSlopeTime (int panel, int control, int event, + void *callbackData, int eventData1, int eventData2) { - switch (event) - { + switch (event) { case EVENT_COMMIT: - if (control==PANEL_SLOPETIME){ - - GetCtrlVal(MainPanel, PANEL_SLOPETIME, &TimetoSlope); - } - + GetCtrlVal(MainPanel, PANEL_SLOPETIME, &TimetoSlope); break; - - } + } return 0; } - int LaunchDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate,int mode) +int LaunchDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate,int mode) { - //mode =0 pour normal - //mode =1 pour reset + //mode =0 pour normal + //mode =1 pour reset + DDSParameter DDSState; - strcpy(DDSState.Name ,Name) ; - DDSState.Profil = Profil ; - strcpy(DDSState.ip,ip) ; - DDSState.Port = Port; - DDSState.Clock = Clock; - DDSState.Delta_T = DeltaT; - DDSState.Frequency = Frequency; - DDSState.SweepRate = Sweeprate ; - if (mode == 1) { DDS_Initialize (&DDSState) ; } - else { DDS_ReInitialize (&DDSState) ; } + + strcpy(DDSState.Name, Name); + DDSState.Profil = Profil; + strcpy(DDSState.ip, ip); + DDSState.Port = Port; + DDSState.Clock = Clock; + DDSState.Delta_T = DeltaT; + DDSState.Frequency = Frequency; + DDSState.SweepRate = Sweeprate; + + if (mode == 1) { + DDS_Initialize (&DDSState); + } else { + DDS_ReInitialize (&DDSState); + } return 0; } - double ReadDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate) +double ReadDDSFOX (char *Name,char *ip,int Port,unsigned int Profil,double Clock,double DeltaT,double Frequency,double Sweeprate) { DDSParameter DDSState; - double FrequDDSFox; + + strcpy(DDSState.Name, Name); + DDSState.Profil = Profil; + strcpy(DDSState.ip, ip); + DDSState.Port = Port; + DDSState.Clock = Clock; + DDSState.Delta_T = DeltaT; + DDSState.Frequency = Frequency; + DDSState.SweepRate = Sweeprate; - strcpy(DDSState.Name ,Name) ; - DDSState.Profil = Profil ; - strcpy(DDSState.ip,ip) ; - DDSState.Port = Port; - DDSState.Clock = Clock; - DDSState.Delta_T = DeltaT; - DDSState.Frequency = Frequency; - DDSState.SweepRate = Sweeprate ; - - FrequDDSFox=DDSFox_ReadFreq(&DDSState); - - - return FrequDDSFox; + return DDSFox_ReadFreq(&DDSState); }