Control Library by altb

Dependents:   My_Libraries IndNav_QK3_T265

Revision:
4:74a4318390ea
Parent:
0:d49418189c5c
--- a/GPA.h	Fri Jul 05 06:56:49 2019 +0000
+++ b/GPA.h	Thu Jul 25 12:03:42 2019 +0000
@@ -1,13 +1,30 @@
+#ifndef GPA_H_
+#define GPA_H_
+
 class GPA
 {
 public:
-    
+
+    typedef struct GPADATA {
+        float   fexc;
+        float   absGyu;
+        float   angGyu;
+        float   absGyr;
+        float   angGyr;
+        float   Umag;
+        float   Ymag;
+        float   Rmag;
+        bool    MeasPointFinished;
+    } gpadata_t;
+
     GPA(float fMin, float fMax, int NfexcDes, float Aexc0, float Aexc1, float Ts);
-    GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
-    GPA(float f0, float f1, float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
-    GPA(float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
+    GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int Nstart, int Nsweep);
+    GPA(float f0, float f1, float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int Nstart, int Nsweep);
+    GPA(float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int Nstart, int Nsweep);
+    GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int Nstart, int Nsweep, bool doPrint);
 
-    float operator()(float inp, float out) {
+    float operator()(float inp, float out)
+    {
         return update((double)inp, (double)out);
     }
 
@@ -18,9 +35,11 @@
 
     void     printGPAfexcDes();
     void     printGPAmeasPara();
-    void     printFullGPAmeasPara();
     void     printGPAmeasTime();
     void     printNfexcDes();
+    void     printLine();
+
+    gpadata_t getGPAdata();
 
 private:
 
@@ -34,15 +53,19 @@
 
     double  fnyq;
     double  pi2;
+    double  pi4;
     double  pi2Ts;
     double  piDiv2;
-    float   rad2deg;
+    double  rad2deg;
+    double  div12pi;
+    double  div812pi;
 
     int     Nmeas;
     int     Nper;
     double  dfexc;
     double  fexc;
     double  fexcPast;
+    double  dfexcj;
     int     i;
     int     j;
     double  scaleG;
@@ -51,28 +74,28 @@
     double *sU;
     double *sY;
     double  sinarg;
+    double  sinargR;
     int     NmeasTotal;
     double  Aexc;
     double  AexcPast;
     double  pi2Tsfexc;
-    int     NstartMin;
-    int     NsweepMin;
+    int     Nstart;
     int     Nsweep;
-    double  bfexc;
-    double  afexc;
-    double  aAexc;
-    double  bAexc;
+    int     Nsweep_i;
     double  AexcOut;
-    
-    void    assignParameters(int NfexcDes, int NperMin, int NmeasMin, double Ts, int NstartMin, int NsweepMin);
+
+    gpadata_t gpaData;
+    bool    doPrint;
+
+    void    assignParameters(int NfexcDes, int NperMin, int NmeasMin, double Ts, int Nstart, int Nsweep);
     void    calculateDecreasingAmplitudeCoefficients(double Aexc0, double Aexc1);
     void    initializeConstants(double Ts);
     void    assignFilterStorage();
     void    fexcDesLogspace(double fMin, double fMax, int NfexcDes);
     void    calcGPAmeasPara(double fexcDes_i);
-    void    calcGPAsweepPara();
     double  wrapAngle(double angle);
     void    printLongLine();
-    void    printLine();
 
-};
\ No newline at end of file
+};
+
+#endif
\ No newline at end of file