Test program with the RT black boxes

Dependencies:   mbed

Committer:
pmic
Date:
Wed May 15 13:58:10 2019 +0000
Revision:
43:a577f752dd7a
Parent:
40:711929f5c2a8
Add new instantiation option to surpress the printout for rt mbed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pmic 37:352bacb64f3f 1 #ifndef GPA_H_
pmic 37:352bacb64f3f 2 #define GPA_H_
pmic 37:352bacb64f3f 3
pmic 6:da0c9587ecae 4 class GPA
pmic 6:da0c9587ecae 5 {
pmic 6:da0c9587ecae 6 public:
pmic 37:352bacb64f3f 7
pmic 37:352bacb64f3f 8 typedef struct GPADATA {
pmic 37:352bacb64f3f 9 float fexc;
pmic 37:352bacb64f3f 10 float absGyu;
pmic 37:352bacb64f3f 11 float angGyu;
pmic 37:352bacb64f3f 12 float absGyr;
pmic 37:352bacb64f3f 13 float angGyr;
pmic 37:352bacb64f3f 14 float Umag;
pmic 37:352bacb64f3f 15 float Ymag;
pmic 37:352bacb64f3f 16 float Rmag;
pmic 37:352bacb64f3f 17 bool MeasPointFinished;
pmic 37:352bacb64f3f 18 } gpadata_t;
pmic 37:352bacb64f3f 19
pmic 35:009a1efb5e82 20 GPA(float fMin, float fMax, int NfexcDes, float Aexc0, float Aexc1, float Ts);
pmic 30:48b233b596b8 21 GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
pmic 30:48b233b596b8 22 GPA(float f0, float f1, float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
pmic 30:48b233b596b8 23 GPA(float *fexcDes, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin);
pmic 43:a577f752dd7a 24 GPA(float fMin, float fMax, int NfexcDes, int NperMin, int NmeasMin, float Ts, float Aexc0, float Aexc1, int NstartMin, int NsweepMin, bool doPrint);
pmic 6:da0c9587ecae 25
pmic 37:352bacb64f3f 26 float operator()(float inp, float out)
pmic 37:352bacb64f3f 27 {
pmic 16:1e8a2a167eaf 28 return update((double)inp, (double)out);
pmic 6:da0c9587ecae 29 }
pmic 6:da0c9587ecae 30
pmic 6:da0c9587ecae 31 virtual ~GPA();
pmic 8:d68e177e2571 32
pmic 6:da0c9587ecae 33 void reset();
pmic 16:1e8a2a167eaf 34 float update(double inp, double out);
pmic 8:d68e177e2571 35
pmic 6:da0c9587ecae 36 void printGPAfexcDes();
pmic 6:da0c9587ecae 37 void printGPAmeasPara();
pmic 30:48b233b596b8 38 void printFullGPAmeasPara();
pmic 6:da0c9587ecae 39 void printGPAmeasTime();
pmic 20:1d5e89b2f22e 40 void printNfexcDes();
pmic 37:352bacb64f3f 41 void printLine();
pmic 37:352bacb64f3f 42
pmic 37:352bacb64f3f 43 gpadata_t getGPAdata();
pmic 6:da0c9587ecae 44
pmic 6:da0c9587ecae 45 private:
pmic 6:da0c9587ecae 46
pmic 20:1d5e89b2f22e 47 int NfexcDes;
pmic 20:1d5e89b2f22e 48 int NperMin;
pmic 20:1d5e89b2f22e 49 int NmeasMin;
pmic 16:1e8a2a167eaf 50 double Ts;
pmic 16:1e8a2a167eaf 51 double *fexcDes;
pmic 16:1e8a2a167eaf 52 double aAexcDes;
pmic 16:1e8a2a167eaf 53 double bAexcDes;
pmic 8:d68e177e2571 54
pmic 16:1e8a2a167eaf 55 double fnyq;
pmic 16:1e8a2a167eaf 56 double pi2;
pmic 16:1e8a2a167eaf 57 double pi2Ts;
pmic 16:1e8a2a167eaf 58 double piDiv2;
pmic 39:590aa4d162da 59 double rad2deg;
pmic 8:d68e177e2571 60
pmic 20:1d5e89b2f22e 61 int Nmeas;
pmic 20:1d5e89b2f22e 62 int Nper;
pmic 30:48b233b596b8 63 double dfexc;
pmic 16:1e8a2a167eaf 64 double fexc;
pmic 16:1e8a2a167eaf 65 double fexcPast;
pmic 30:48b233b596b8 66 int i;
pmic 30:48b233b596b8 67 int j;
pmic 16:1e8a2a167eaf 68 double scaleG;
pmic 16:1e8a2a167eaf 69 double cr;
pmic 16:1e8a2a167eaf 70 double ci;
pmic 16:1e8a2a167eaf 71 double *sU;
pmic 16:1e8a2a167eaf 72 double *sY;
pmic 16:1e8a2a167eaf 73 double sinarg;
pmic 20:1d5e89b2f22e 74 int NmeasTotal;
pmic 16:1e8a2a167eaf 75 double Aexc;
pmic 30:48b233b596b8 76 double AexcPast;
pmic 16:1e8a2a167eaf 77 double pi2Tsfexc;
pmic 30:48b233b596b8 78 int NstartMin;
pmic 30:48b233b596b8 79 int NsweepMin;
pmic 30:48b233b596b8 80 int Nsweep;
pmic 30:48b233b596b8 81 double bfexc;
pmic 30:48b233b596b8 82 double afexc;
pmic 30:48b233b596b8 83 double aAexc;
pmic 30:48b233b596b8 84 double bAexc;
pmic 30:48b233b596b8 85 double AexcOut;
pmic 37:352bacb64f3f 86
pmic 37:352bacb64f3f 87 gpadata_t gpaData;
pmic 43:a577f752dd7a 88 bool doPrint;
pmic 37:352bacb64f3f 89
pmic 30:48b233b596b8 90 void assignParameters(int NfexcDes, int NperMin, int NmeasMin, double Ts, int NstartMin, int NsweepMin);
pmic 30:48b233b596b8 91 void calculateDecreasingAmplitudeCoefficients(double Aexc0, double Aexc1);
pmic 30:48b233b596b8 92 void initializeConstants(double Ts);
pmic 30:48b233b596b8 93 void assignFilterStorage();
pmic 20:1d5e89b2f22e 94 void fexcDesLogspace(double fMin, double fMax, int NfexcDes);
pmic 20:1d5e89b2f22e 95 void calcGPAmeasPara(double fexcDes_i);
pmic 30:48b233b596b8 96 void calcGPAsweepPara();
pmic 30:48b233b596b8 97 double wrapAngle(double angle);
pmic 30:48b233b596b8 98 void printLongLine();
pmic 6:da0c9587ecae 99
pmic 37:352bacb64f3f 100 };
pmic 37:352bacb64f3f 101
pmic 37:352bacb64f3f 102 #endif