1  #ifndef RTCM3_CLOCK_ORBIT_RTCM_H


2  #define RTCM3_CLOCK_ORBIT_RTCM_H


3 


4  /* Programheader


5 


6  Name: clock_orbit_rtcm.h


7  Project: RTCM3


8  Version: $Id: clock_orbit_rtcm.h 9050 20200827 14:01:42Z stuerze $


9  Authors: Dirk Stöcker, Andrea Stürze


10  Description: state space approach: RTCM


11  */


12 


13  #include <string.h>


14  #include "clock_orbit.h"


15 


16  class SsrCorrRtcm: public SsrCorr {


17  //Q_OBJECT


18 


19  public:


20  SsrCorrRtcm() {


21  setCorBase();


22  setCorOffset();


23  setCoType();


24  setCbType();


25  setPbType();


26  setVtecType();


27  setCodeType();


28 


29  satoffset << CLOCKORBIT_OFFSETGPS


30  << CLOCKORBIT_OFFSETGLONASS


31  << CLOCKORBIT_OFFSETGALILEO


32  << CLOCKORBIT_OFFSETQZSS


33  << CLOCKORBIT_OFFSETSBAS


34  << CLOCKORBIT_OFFSETBDS


35  << CLOCKORBIT_COUNTSAT;


36  };


37 


38  ~SsrCorrRtcm() {};


39 


40  void setCorBase() {


41  COBBASE_GPS = 1057;


42  COBBASE_GLONASS = 1063;


43  COBBASE_GALILEO = 1240;


44  COBBASE_QZSS = 1246;


45  COBBASE_SBAS = 1252;


46  COBBASE_BDS = 1258;


47  COBBASE_NUM = 6;


48  corbase << COBBASE_GPS


49  << COBBASE_GLONASS


50  << COBBASE_GALILEO


51  << COBBASE_QZSS


52  << COBBASE_SBAS


53  << COBBASE_BDS;


54  };


55 


56  void setCorOffset() {


57  COBOFS_ORBIT = 0;


58  COBOFS_CLOCK = 1;


59  COBOFS_CBIAS = 2;


60  COBOFS_COMBINED = 3;


61  COBOFS_URA = 4;


62  COBOFS_HR = 5;


63  COBOFS_NUM = 6;


64  };


65 


66  void setCoType() {


67  COTYPE_GPSORBIT = COBBASE_GPS + COBOFS_ORBIT;


68  COTYPE_GPSCLOCK = COTYPE_GPSORBIT + 1;


69  COTYPE_GPSCOMBINED = COBBASE_GPS + COBOFS_COMBINED;


70  COTYPE_GPSURA = COTYPE_GPSCOMBINED + 1;


71  COTYPE_GPSHR = COTYPE_GPSURA + 1;


72 


73  COTYPE_GLONASSORBIT = COBBASE_GLONASS + COBOFS_ORBIT;


74  COTYPE_GLONASSCLOCK = COTYPE_GLONASSORBIT + 1;


75  COTYPE_GLONASSCOMBINED = COBBASE_GLONASS + COBOFS_COMBINED;


76  COTYPE_GLONASSURA = COTYPE_GLONASSCOMBINED + 1;


77  COTYPE_GLONASSHR = COTYPE_GLONASSURA + 1;


78 


79  COTYPE_GALILEOORBIT = COBBASE_GALILEO + COBOFS_ORBIT,


80  COTYPE_GALILEOCLOCK = COTYPE_GALILEOORBIT + 1;


81  COTYPE_GALILEOCOMBINED = COBBASE_GALILEO + COBOFS_COMBINED;


82  COTYPE_GALILEOURA = COTYPE_GALILEOCOMBINED + 1;


83  COTYPE_GALILEOHR = COTYPE_GALILEOURA + 1;


84 


85  COTYPE_QZSSORBIT = COBBASE_QZSS + COBOFS_ORBIT;


86  COTYPE_QZSSCLOCK = COTYPE_QZSSORBIT + 1;


87  COTYPE_QZSSCOMBINED = COBBASE_QZSS + COBOFS_COMBINED,


88  COTYPE_QZSSURA = COTYPE_QZSSCOMBINED + 1;


89  COTYPE_QZSSHR = COTYPE_QZSSURA + 1;


90 


91  COTYPE_SBASORBIT = COBBASE_SBAS + COBOFS_ORBIT;


92  COTYPE_SBASCLOCK = COTYPE_SBASORBIT + 1;


93  COTYPE_SBASCOMBINED = COBBASE_SBAS + COBOFS_COMBINED;


94  COTYPE_SBASURA = COTYPE_SBASCOMBINED + 1;


95  COTYPE_SBASHR = COTYPE_SBASURA + 1;


96 


97  COTYPE_BDSORBIT = COBBASE_BDS + COBOFS_ORBIT;


98  COTYPE_BDSCLOCK = COTYPE_BDSORBIT + 1;


99  COTYPE_BDSCOMBINED = COBBASE_BDS + COBOFS_COMBINED,


100  COTYPE_BDSURA = COTYPE_BDSCOMBINED + 1;


101  COTYPE_BDSHR = COTYPE_BDSURA + 1;


102 


103  COTYPE_AUTO = 0;


104  };


105 


106  void setCbType() {


107  CBTYPE_GPS = COBBASE_GPS + COBOFS_CBIAS;


108  CBTYPE_GLONASS = COBBASE_GLONASS + COBOFS_CBIAS;


109  CBTYPE_GALILEO = COBBASE_GALILEO + COBOFS_CBIAS;


110  CBTYPE_QZSS = COBBASE_QZSS + COBOFS_CBIAS;


111  CBTYPE_SBAS = COBBASE_SBAS + COBOFS_CBIAS;


112  CBTYPE_BDS = COBBASE_BDS + COBOFS_CBIAS;


113  CBTYPE_AUTO = 0;


114  };


115 


116  void setPbType() {


117  PBTYPE_BASE = 1265;


118  PBTYPE_GPS = PBTYPE_BASE;


119  PBTYPE_GLONASS = PBTYPE_GPS++;


120  PBTYPE_GALILEO = PBTYPE_GLONASS++;


121  PBTYPE_QZSS = PBTYPE_GALILEO++;


122  PBTYPE_SBAS = PBTYPE_QZSS++;


123  PBTYPE_BDS = PBTYPE_SBAS++;


124  PBTYPE_AUTO = 0;


125  };


126 


127  void setVtecType() {


128  VTEC_BASE = 1264;


129  };


130 


131  void setCodeType() {


132  RESERVED = 99;


133 


134  CODETYPE_GPS_L1_CA = 0;


135  CODETYPE_GPS_L1_P = 1;


136  CODETYPE_GPS_L1_Z = 2;


137 


138 


139  CODETYPE_GPS_L2_CA = 5;


140  CODETYPE_GPS_SEMI_CODELESS = 6;


141  CODETYPE_GPS_L2C_M = 7;


142  CODETYPE_GPS_L2C_L = 8;


143  CODETYPE_GPS_L2C_ML = 9;


144  CODETYPE_GPS_L2_P = 10;


145  CODETYPE_GPS_L2_Z = 11;


146 


147 


148  CODETYPE_GPS_L5_I = 14;


149  CODETYPE_GPS_L5_Q = 15;


150  CODETYPE_GPS_L5_IQ = 16;


151  CODETYPE_GPS_L1C_D = 17;


152  CODETYPE_GPS_L1C_P = 18;


153  CODETYPE_GPS_L1C_DP = 19;


154 


155  CODETYPE_GLONASS_L1_CA = 0;


156  CODETYPE_GLONASS_L1_P = 1;


157  CODETYPE_GLONASS_L2_CA = 2;


158  CODETYPE_GLONASS_L2_P = 3;


159  CODETYPE_GLONASS_L1a_OCd = 4;


160  CODETYPE_GLONASS_L1a_OCp = 5;


161  CODETYPE_GLONASS_L1a_OCdp = 6;


162  CODETYPE_GLONASS_L2a_CSI = 7;


163  CODETYPE_GLONASS_L2a_OCp = 8;


164  CODETYPE_GLONASS_L2a_CSIOCp = 9;


165  CODETYPE_GLONASS_L3_I = 10;


166  CODETYPE_GLONASS_L3_Q = 11;


167  CODETYPE_GLONASS_L3_IQ = 12;


168 


169  CODETYPE_GALILEO_E1_A = 0;


170  CODETYPE_GALILEO_E1_B = 1;


171  CODETYPE_GALILEO_E1_C = 2;


172  CODETYPE_GALILEO_E1_BC = 3;


173  CODETYPE_GALILEO_E1_ABC = 4;


174  CODETYPE_GALILEO_E5A_I = 5;


175  CODETYPE_GALILEO_E5A_Q = 6;


176  CODETYPE_GALILEO_E5A_IQ = 7;


177  CODETYPE_GALILEO_E5B_I = 8;


178  CODETYPE_GALILEO_E5B_Q = 9;


179  CODETYPE_GALILEO_E5B_IQ = 10;


180  CODETYPE_GALILEO_E5_I = 11;


181  CODETYPE_GALILEO_E5_Q = 12;


182  CODETYPE_GALILEO_E5_IQ = 13;


183  CODETYPE_GALILEO_E6_A = 14;


184  CODETYPE_GALILEO_E6_B = 15;


185  CODETYPE_GALILEO_E6_C = 16;


186  CODETYPE_GALILEO_E6_BC = 17;


187  CODETYPE_GALILEO_E6_ABC = 18;


188 


189  CODETYPE_QZSS_L1_CA = 0;


190  CODETYPE_QZSS_L1C_D = 1;


191  CODETYPE_QZSS_L1C_P = 2;


192  CODETYPE_QZSS_L2C_M = 3;


193  CODETYPE_QZSS_L2C_L = 4;


194  CODETYPE_QZSS_L2C_ML = 5;


195  CODETYPE_QZSS_L5_I = 6;


196  CODETYPE_QZSS_L5_Q = 7;


197  CODETYPE_QZSS_L5_IQ = 8;


198  CODETYPE_QZSS_L6_D = 9;


199  CODETYPE_QZSS_L6_P = 10;


200  CODETYPE_QZSS_L6_DP = 11;


201  CODETYPE_QZSS_L1C_DP = 12;


202  CODETYPE_QZSS_L1_S = 13;


203  CODETYPE_QZSS_L5_D = 14;


204  CODETYPE_QZSS_L5_P = 15;


205  CODETYPE_QZSS_L5_DP = 16;


206  CODETYPE_QZSS_L6_E = 17;


207  CODETYPE_QZSS_L6_DE = 18;


208 


209  CODETYPE_SBAS_L1_CA = 0;


210  CODETYPE_SBAS_L5_I = 1;


211  CODETYPE_SBAS_L5_Q = 2;


212  CODETYPE_SBAS_L5_IQ = 3;


213 


214  CODETYPE_BDS_B1_I = 0;


215  CODETYPE_BDS_B1_Q = 1;


216  CODETYPE_BDS_B1_IQ = 2;


217  CODETYPE_BDS_B3_I = 3;


218  CODETYPE_BDS_B3_Q = 4;


219  CODETYPE_BDS_B3_IQ = 5;


220  CODETYPE_BDS_B2_I = 6;


221  CODETYPE_BDS_B2_Q = 7;


222  CODETYPE_BDS_B2_IQ = 8;


223  CODETYPE_BDS_B1a_D = 9;


224  CODETYPE_BDS_B1a_P = 10;


225  CODETYPE_BDS_B1a_DP = 11;


226  CODETYPE_BDS_B2a_D = 12;


227  CODETYPE_BDS_B2a_P = 13;


228  CODETYPE_BDS_B2a_DP = 14;


229 


230 


231 


232 


233  }


234 


235  std::string codeTypeToRnxType(char system, CodeType type);


236  SsrCorr::CodeType rnxTypeToCodeType(char system, std::string type);


237 


238  size_t MakeClockOrbit(const struct ClockOrbit *co, ClockOrbitType type,


239  int moremessagesfollow, char *buffer, size_t size);


240  size_t MakeCodeBias(const struct CodeBias *b, CodeBiasType type,


241  int moremessagesfollow, char *buffer, size_t size);


242  size_t MakePhaseBias(const struct PhaseBias *b, PhaseBiasType type,


243  int moremessagesfollow, char *buffer, size_t size);


244  size_t MakeVTEC(const struct VTEC *v, int moremessagesfollow, char *buffer,


245  size_t size);


246  enum GCOB_RETURN GetSSR(struct ClockOrbit *co, struct CodeBias *b,


247  struct VTEC *v, struct PhaseBias *pb, const char *buffer, size_t size,


248  int *bytesused);


249  };


250 


251  #endif /* RTCM3_CLOCK_ORBIT_RTCM_H */

