Changeset 4389 in ntrip for trunk/BNC/src/RTCM
- Timestamp:
- Jul 5, 2012, 6:45:18 PM (13 years ago)
- Location:
- trunk/BNC/src/RTCM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM/GPSDecoder.cpp
r3529 r4389 89 89 } 90 90 } 91 92 // 93 ////////////////////////////////////////////////////////////////////////////// 94 double t_obs::c1() const { 95 if (_measdata[GNSSENTRY_C1DATA] != 0.0) return _measdata[GNSSENTRY_C1DATA]; 96 if (_measdata[GNSSENTRY_C1NDATA] != 0.0) return _measdata[GNSSENTRY_C1NDATA]; 97 return 0.0; 98 } 99 100 double t_obs::c2() const { 101 if (_measdata[GNSSENTRY_C2DATA] != 0.0) return _measdata[GNSSENTRY_C2DATA]; 102 return 0.0; 103 } 104 105 double t_obs::c5() const { 106 if (_measdata[GNSSENTRY_C5DATA] != 0.0) return _measdata[GNSSENTRY_C5DATA]; 107 if (_measdata[GNSSENTRY_C5BDATA] != 0.0) return _measdata[GNSSENTRY_C5BDATA]; 108 if (_measdata[GNSSENTRY_C5ABDATA] != 0.0) return _measdata[GNSSENTRY_C5ABDATA]; 109 return 0.0; 110 } 111 112 double t_obs::p1() const { 113 if (_measdata[GNSSENTRY_P1DATA] != 0.0) return _measdata[GNSSENTRY_P1DATA]; 114 return 0.0; 115 } 116 117 double t_obs::p2() const { 118 if (_measdata[GNSSENTRY_P2DATA] != 0.0) return _measdata[GNSSENTRY_P2DATA]; 119 return 0.0; 120 } 121 122 double t_obs::l1() const { 123 if (_measdata[GNSSENTRY_L1CDATA] != 0.0) return _measdata[GNSSENTRY_L1CDATA]; 124 if (_measdata[GNSSENTRY_L1PDATA] != 0.0) return _measdata[GNSSENTRY_L1PDATA]; 125 if (_measdata[GNSSENTRY_L1NDATA] != 0.0) return _measdata[GNSSENTRY_L1NDATA]; 126 return 0.0; 127 } 128 129 double t_obs::l2() const { 130 if (_measdata[GNSSENTRY_L2CDATA] != 0.0) return _measdata[GNSSENTRY_L2CDATA]; 131 if (_measdata[GNSSENTRY_L2PDATA] != 0.0) return _measdata[GNSSENTRY_L2PDATA]; 132 return 0.0; 133 } 134 135 double t_obs::l5() const { 136 if (_measdata[GNSSENTRY_L5DATA] != 0.0) return _measdata[GNSSENTRY_L5DATA]; 137 if (_measdata[GNSSENTRY_L5BDATA] != 0.0) return _measdata[GNSSENTRY_L5BDATA]; 138 if (_measdata[GNSSENTRY_L5ABDATA] != 0.0) return _measdata[GNSSENTRY_L5ABDATA]; 139 return 0.0; 140 } 141 142 double t_obs::s1() const { 143 if (_measdata[GNSSENTRY_S1CDATA] != 0.0) return _measdata[GNSSENTRY_S1CDATA]; 144 if (_measdata[GNSSENTRY_S1PDATA] != 0.0) return _measdata[GNSSENTRY_S1PDATA]; 145 if (_measdata[GNSSENTRY_S1NDATA] != 0.0) return _measdata[GNSSENTRY_S1NDATA]; 146 return 0.0; 147 } 148 149 double t_obs::s2() const { 150 if (_measdata[GNSSENTRY_S2CDATA] != 0.0) return _measdata[GNSSENTRY_S2CDATA]; 151 if (_measdata[GNSSENTRY_S2PDATA] != 0.0) return _measdata[GNSSENTRY_S2PDATA]; 152 return 0.0; 153 } 154 155 // 156 ////////////////////////////////////////////////////////////////////////////// 157 std::string t_obs::entry2str(int iEntry) const { 158 if (iEntry == GNSSENTRY_C1DATA ) return "C1"; 159 if (iEntry == GNSSENTRY_L1CDATA ) return "L1C"; 160 if (iEntry == GNSSENTRY_D1CDATA ) return "D1C"; 161 if (iEntry == GNSSENTRY_S1CDATA ) return "S1C"; 162 if (iEntry == GNSSENTRY_C2DATA ) return "C2"; 163 if (iEntry == GNSSENTRY_L2CDATA ) return "L2C"; 164 if (iEntry == GNSSENTRY_D2CDATA ) return "D2C"; 165 if (iEntry == GNSSENTRY_S2CDATA ) return "S2C"; 166 if (iEntry == GNSSENTRY_P1DATA ) return "P1"; 167 if (iEntry == GNSSENTRY_L1PDATA ) return "L1P"; 168 if (iEntry == GNSSENTRY_D1PDATA ) return "D1P"; 169 if (iEntry == GNSSENTRY_S1PDATA ) return "S1P"; 170 if (iEntry == GNSSENTRY_P2DATA ) return "P2"; 171 if (iEntry == GNSSENTRY_L2PDATA ) return "L2P"; 172 if (iEntry == GNSSENTRY_D2PDATA ) return "D2P"; 173 if (iEntry == GNSSENTRY_S2PDATA ) return "S2P"; 174 if (iEntry == GNSSENTRY_C5DATA ) return "C5"; 175 if (iEntry == GNSSENTRY_L5DATA ) return "L5"; 176 if (iEntry == GNSSENTRY_D5DATA ) return "D5"; 177 if (iEntry == GNSSENTRY_S5DATA ) return "S5"; 178 if (iEntry == GNSSENTRY_C6DATA ) return "C6"; 179 if (iEntry == GNSSENTRY_L6DATA ) return "L6"; 180 if (iEntry == GNSSENTRY_D6DATA ) return "D6"; 181 if (iEntry == GNSSENTRY_S6DATA ) return "S6"; 182 if (iEntry == GNSSENTRY_C5BDATA ) return "C5B"; 183 if (iEntry == GNSSENTRY_L5BDATA ) return "L5B"; 184 if (iEntry == GNSSENTRY_D5BDATA ) return "D5B"; 185 if (iEntry == GNSSENTRY_S5BDATA ) return "S5B"; 186 if (iEntry == GNSSENTRY_C5ABDATA ) return "C5AB"; 187 if (iEntry == GNSSENTRY_L5ABDATA ) return "L5AB"; 188 if (iEntry == GNSSENTRY_D5ABDATA ) return "D5AB"; 189 if (iEntry == GNSSENTRY_S5ABDATA ) return "S5AB"; 190 if (iEntry == GNSSENTRY_CSAIFDATA) return "CSAIF"; 191 if (iEntry == GNSSENTRY_LSAIFDATA) return "LSAIF"; 192 if (iEntry == GNSSENTRY_DSAIFDATA) return "DSAIF"; 193 if (iEntry == GNSSENTRY_SSAIFDATA) return "SSAIF"; 194 if (iEntry == GNSSENTRY_C1NDATA ) return "C1N"; 195 if (iEntry == GNSSENTRY_L1NDATA ) return "L1N"; 196 if (iEntry == GNSSENTRY_D1NDATA ) return "D1N"; 197 if (iEntry == GNSSENTRY_S1NDATA ) return "S1N"; 198 199 throw "Error in t_obs::entry2str"; 200 } 201 202 // 203 ////////////////////////////////////////////////////////////////////////////// 204 int t_obs::str2entry(const char* strIn) const { 205 206 string str(strIn); 207 208 if (str == "C1" ) return GNSSENTRY_C1DATA; 209 if (str == "L1C" ) return GNSSENTRY_L1CDATA; 210 if (str == "D1C" ) return GNSSENTRY_D1CDATA; 211 if (str == "S1C" ) return GNSSENTRY_S1CDATA; 212 if (str == "C2" ) return GNSSENTRY_C2DATA; 213 if (str == "L2C" ) return GNSSENTRY_L2CDATA; 214 if (str == "D2C" ) return GNSSENTRY_D2CDATA; 215 if (str == "S2C" ) return GNSSENTRY_S2CDATA; 216 if (str == "P1" ) return GNSSENTRY_P1DATA; 217 if (str == "L1P" ) return GNSSENTRY_L1PDATA; 218 if (str == "D1P" ) return GNSSENTRY_D1PDATA; 219 if (str == "S1P" ) return GNSSENTRY_S1PDATA; 220 if (str == "P2" ) return GNSSENTRY_P2DATA; 221 if (str == "L2P" ) return GNSSENTRY_L2PDATA; 222 if (str == "D2P" ) return GNSSENTRY_D2PDATA; 223 if (str == "S2P" ) return GNSSENTRY_S2PDATA; 224 if (str == "C5" ) return GNSSENTRY_C5DATA; 225 if (str == "L5" ) return GNSSENTRY_L5DATA; 226 if (str == "D5" ) return GNSSENTRY_D5DATA; 227 if (str == "S5" ) return GNSSENTRY_S5DATA; 228 if (str == "C6" ) return GNSSENTRY_C6DATA; 229 if (str == "L6" ) return GNSSENTRY_L6DATA; 230 if (str == "D6" ) return GNSSENTRY_D6DATA; 231 if (str == "S6" ) return GNSSENTRY_S6DATA; 232 if (str == "C5B" ) return GNSSENTRY_C5BDATA; 233 if (str == "L5B" ) return GNSSENTRY_L5BDATA; 234 if (str == "D5B" ) return GNSSENTRY_D5BDATA; 235 if (str == "S5B" ) return GNSSENTRY_S5BDATA; 236 if (str == "C5AB" ) return GNSSENTRY_C5ABDATA; 237 if (str == "L5AB" ) return GNSSENTRY_L5ABDATA; 238 if (str == "D5AB" ) return GNSSENTRY_D5ABDATA; 239 if (str == "S5AB" ) return GNSSENTRY_S5ABDATA; 240 if (str == "CSAIF") return GNSSENTRY_CSAIFDATA; 241 if (str == "LSAIF") return GNSSENTRY_LSAIFDATA; 242 if (str == "DSAIF") return GNSSENTRY_DSAIFDATA; 243 if (str == "SSAIF") return GNSSENTRY_SSAIFDATA; 244 if (str == "C1N" ) return GNSSENTRY_C1NDATA; 245 if (str == "L1N" ) return GNSSENTRY_L1NDATA; 246 if (str == "D1N" ) return GNSSENTRY_D1NDATA; 247 if (str == "S1N" ) return GNSSENTRY_S1NDATA; 248 249 throw "Error in t_obs::str2entry"; 250 } -
trunk/BNC/src/RTCM/GPSDecoder.h
r4376 r4389 35 35 #include "bncrinex.h" 36 36 37 extern "C" { 38 #include "rtcm3torinex.h" 39 } 40 37 41 class t_obs { 38 42 public: … … 44 48 GPSWeek = 0; 45 49 GPSWeeks = 0.0; 46 C1 = 0.0; 47 P1 = 0.0; 48 L1C = 0.0; 49 D1C = 0.0; 50 S1C = 0.0; 51 L1P = 0.0; 52 D1P = 0.0; 53 S1P = 0.0; 54 C2 = 0.0; 55 P2 = 0.0; 56 L2C = 0.0; 57 D2C = 0.0; 58 S2C = 0.0; 59 L2P = 0.0; 60 D2P = 0.0; 61 S2P = 0.0; 62 C5 = 0.0; 63 L5 = 0.0; 64 D5 = 0.0; 65 S5 = 0.0; 50 _dataflags = 0; 51 _dataflags2 = 0; 52 for (int iEntry = 0; iEntry < GNSSENTRY_NUMBER; iEntry++) { 53 _measdata[iEntry] = 0.0; 54 _codetype[iEntry] = 0; 55 } 66 56 slip_cnt_L1 = -1; 67 57 slip_cnt_L2 = -1; … … 71 61 ~t_obs() {} 72 62 73 double p1() const {return (P1 != 0.0 ? P1 : C1);} 74 double p2() const {return (P2 != 0.0 ? P2 : C2);} 75 double l1() const {return (L1P != 0.0 ? L1P : L1C);} 76 double l2() const {return (L2P != 0.0 ? L2P : L2C);} 77 double s1() const {return (L1P != 0.0 ? S1P : S1C);} 78 double s2() const {return (L2P != 0.0 ? S2P : S2C);} 63 double c1() const; 64 double c2() const; 65 double c5() const; 66 double p1() const; 67 double p2() const; 68 double l1() const; 69 double l2() const; 70 double l5() const; 71 double s1() const; 72 double s2() const; 73 std::string entry2str(int iEntry) const; 74 int str2entry(const char* str) const; 79 75 80 76 char StatID[20+1]; // Station ID … … 85 81 double GPSWeeks; // Second of Week (GPS-Time) 86 82 87 double C1; // CA-code pseudorange (meters)88 double L1C; // L1 carrier phase (cycles)89 double D1C; // Doppler L190 double S1C; // raw L1 signal strength91 bool has1C() const {return C1 != 0.0 || L1C != 0.0 || D1C != 0.0 || S1C != 0.0;}92 93 double P1; // P1-code pseudorange (meters)94 double L1P; // L1 carrier phase (cycles)95 double D1P; // Doppler L196 double S1P; // raw L1 signal strength97 bool has1P() const {return P1 != 0.0 || L1P != 0.0 || D1P != 0.0 || S1P != 0.0;}98 99 double C2; // CA-code pseudorange (meters)100 double L2C; // L2 carrier phase (cycles)101 double D2C; // Doppler L2102 double S2C; // raw L2 signal strength103 bool has2C() const {return C2 != 0.0 || L2C != 0.0 || D2C != 0.0 || S2C != 0.0;}104 105 double P2; // P2-code pseudorange (meters)106 double L2P; // L2 carrier phase (cycles)107 double D2P; // Doppler L2108 double S2P; // raw L2 signal strength109 bool has2P() const {return P2 != 0.0 || L2P != 0.0 || D2P != 0.0 || S2P != 0.0;}110 111 double C5; // Pseudorange (meters)112 double L5; // L5 carrier phase (cycles)113 double D5; // Doppler L5114 double S5; // raw L5 signal strength115 bool has5C() const {return C5 != 0.0 || L5 != 0.0 || D5 != 0.0 || S5 != 0.0;}116 117 83 int slip_cnt_L1; // L1 cumulative loss of continuity indicator (negative value = undefined) 118 84 int slip_cnt_L2; // L2 cumulative loss of continuity indicator (negative value = undefined) 119 85 int slip_cnt_L5; // L5 cumulative loss of continuity indicator (negative value = undefined) 86 87 double _measdata[GNSSENTRY_NUMBER]; // data fields */ 88 unsigned long long _dataflags; // GNSSDF_xxx */ 89 unsigned int _dataflags2; // GNSSDF2_xxx */ 90 const char* _codetype[GNSSENTRY_NUMBER]; 120 91 }; 121 92 -
trunk/BNC/src/RTCM/RTCM2Decoder.cpp
r3594 r4389 148 148 obs.GPSWeek = epochWeek; 149 149 obs.GPSWeeks = epochSecs; 150 obs. C1= _ObsBlock.rng_C1[iSat];151 obs. P1= _ObsBlock.rng_P1[iSat];152 obs. P2= _ObsBlock.rng_P2[iSat];153 obs. L1P= _ObsBlock.resolvedPhase_L1(iSat);154 obs. L2P= _ObsBlock.resolvedPhase_L2(iSat);150 obs._measdata[obs.str2entry("C1")] = _ObsBlock.rng_C1[iSat]; 151 obs._measdata[obs.str2entry("P1")] = _ObsBlock.rng_P1[iSat]; 152 obs._measdata[obs.str2entry("P2")] = _ObsBlock.rng_P2[iSat]; 153 obs._measdata[obs.str2entry("L1")] = _ObsBlock.resolvedPhase_L1(iSat); 154 obs._measdata[obs.str2entry("L2")] = _ObsBlock.resolvedPhase_L2(iSat); 155 155 obs.slip_cnt_L1 = _ObsBlock.slip_L1[iSat]; 156 156 obs.slip_cnt_L2 = _ObsBlock.slip_L2[iSat]; … … 368 368 switch (ii) { 369 369 case 0: // --- L1 --- 370 new_obs->L1P= *obsVal / LAMBDA_1;370 new_obs->_measdata[new_obs->str2entry("L1")] = *obsVal / LAMBDA_1; 371 371 new_obs->slip_cnt_L1 = corr->lock1; 372 372 break; 373 373 case 1: // --- L2 --- 374 new_obs->L2P= *obsVal / LAMBDA_2;374 new_obs->_measdata[new_obs->str2entry("L2")] = *obsVal / LAMBDA_2; 375 375 new_obs->slip_cnt_L2 = corr->lock2; 376 376 break; 377 377 case 2: // --- C1 / P1 --- 378 378 if ( corr->Pind1 ) 379 new_obs->P1= *obsVal;379 new_obs->_measdata[new_obs->str2entry("P1")] = *obsVal; 380 380 else 381 new_obs->C1= *obsVal;381 new_obs->_measdata[new_obs->str2entry("C1")] = *obsVal; 382 382 break; 383 383 case 3: // --- C2 / P2 --- 384 384 if ( corr->Pind2 ) 385 new_obs->P2= *obsVal;385 new_obs->_measdata[new_obs->str2entry("P2")] = *obsVal; 386 386 else 387 new_obs->C2= *obsVal;387 new_obs->_measdata[new_obs->str2entry("C2")] = *obsVal; 388 388 break; 389 389 default:
Note:
See TracChangeset
for help on using the changeset viewer.