Test program with the RT black boxes

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GPA.h Source File

GPA.h

00001 #ifndef GPA_H_
00002 #define GPA_H_
00003 
00004 class GPA
00005 {
00006 public:
00007 
00008     typedef struct GPADATA {
00009         float   fexc;
00010         float   absGyu;
00011         float   angGyu;
00012         float   absGyr;
00013         float   angGyr;
00014         float   Umag;
00015         float   Ymag;
00016         float   Rmag;
00017         bool    MeasPointFinished;
00018     } gpadata_t;
00019 
00020     GPA(float fMin, float fMax, int NfexcDes, float Aexc0, float Aexc1, float Ts);
00021     GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
00022     GPA(float f0, float f1, float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
00023     GPA(float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
00024     GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin, bool doPrint);
00025 
00026     float operator()(float inp, float out)
00027     {
00028         return update((double)inp, (double)out);
00029     }
00030 
00031     virtual ~GPA();
00032 
00033     void     reset();
00034     float    update(double inp, double out);
00035 
00036     void     printGPAfexcDes();
00037     void     printGPAmeasPara();
00038     void     printFullGPAmeasPara();
00039     void     printGPAmeasTime();
00040     void     printNfexcDes();
00041     void     printLine();
00042 
00043     gpadata_t getGPAdata();
00044 
00045 private:
00046 
00047     int     NfexcDes;
00048     int     NperMin;
00049     int     NmeasMin;
00050     double  Ts;
00051     double *fexcDes;
00052     double  aAexcDes;
00053     double  bAexcDes;
00054 
00055     double  fnyq;
00056     double  pi2;
00057     double  pi2Ts;
00058     double  piDiv2;
00059     double   rad2deg;
00060 
00061     int     Nmeas;
00062     int     Nper;
00063     double  dfexc;
00064     double  fexc;
00065     double  fexcPast;
00066     int     i;
00067     int     j;
00068     double  scaleG;
00069     double  cr;
00070     double  ci;
00071     double *sU;
00072     double *sY;
00073     double  sinarg;
00074     int     NmeasTotal;
00075     double  Aexc;
00076     double  AexcPast;
00077     double  pi2Tsfexc;
00078     int     NstartMin;
00079     int     NsweepMin;
00080     int     Nsweep;
00081     double  bfexc;
00082     double  afexc;
00083     double  aAexc;
00084     double  bAexc;
00085     double  AexcOut;
00086 
00087     gpadata_t gpaData;
00088     bool    doPrint;
00089 
00090     void    assignParameters(int NfexcDes, int NperMin, int NmeasMin, double Ts, int NstartMin, int NsweepMin);
00091     void    calculateDecreasingAmplitudeCoefficients(double Aexc0, double Aexc1);
00092     void    initializeConstants(double Ts);
00093     void    assignFilterStorage();
00094     void    fexcDesLogspace(double fMin, double fMax, int NfexcDes);
00095     void    calcGPAmeasPara(double fexcDes_i);
00096     void    calcGPAsweepPara();
00097     double  wrapAngle(double angle);
00098     void    printLongLine();
00099 
00100 };
00101 
00102 #endif