- Timestamp:
- Jul 5, 2012, 6:45:18 PM (12 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 7 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: -
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r4388 r4389 336 336 } 337 337 338 obs._dataflags = gnssData.dataflags[iSat]; 339 obs._dataflags2 = gnssData.dataflags2[iSat]; 340 338 341 // Loop over all data types 339 342 // ------------------------ 340 343 for (int iEntry = 0; iEntry < GNSSENTRY_NUMBER; ++iEntry) { 341 342 unsigned df = (1 << iEntry); 343 344 if (df & gnssData.dataflags[iSat]) { 345 346 // TODO: codetype[1] is e.g. 'W' or 'C' or 'P' 347 const char* codetype = gnssData.codetype[iSat][iEntry]; 348 if (codetype) { 349 // cout << prn.toAscii().data() << " " << codetype << endl; 350 } 351 352 if (iEntry == GNSSENTRY_C1DATA) { 353 obs.C1 = gnssData.measdata[iSat][iEntry]; 354 } 355 else if (iEntry == GNSSENTRY_C2DATA) { 356 obs.C2 = gnssData.measdata[iSat][iEntry]; 357 } 358 else if (iEntry == GNSSENTRY_P1DATA) { 359 obs.P1 = gnssData.measdata[iSat][iEntry]; 360 } 361 else if (iEntry == GNSSENTRY_P2DATA) { 362 obs.P2 = gnssData.measdata[iSat][iEntry]; 363 } 364 else if (iEntry == GNSSENTRY_L1CDATA) { 365 obs.L1C = gnssData.measdata[iSat][iEntry]; 366 } 367 else if (iEntry == GNSSENTRY_L1PDATA) { 368 obs.L1P = gnssData.measdata[iSat][iEntry]; 369 } 370 else if (iEntry == GNSSENTRY_L2CDATA) { 371 obs.L2C = gnssData.measdata[iSat][iEntry]; 372 } 373 else if (iEntry == GNSSENTRY_L2PDATA) { 374 obs.L2P = gnssData.measdata[iSat][iEntry]; 375 } 376 else if (iEntry == GNSSENTRY_D1CDATA) { 377 obs.D1C = gnssData.measdata[iSat][iEntry]; 378 } 379 else if (iEntry == GNSSENTRY_D1PDATA) { 380 obs.D1P = gnssData.measdata[iSat][iEntry]; 381 } 382 else if (iEntry == GNSSENTRY_S1CDATA) { 383 obs.S1C = gnssData.measdata[iSat][iEntry]; 384 } 385 else if (iEntry == GNSSENTRY_S1PDATA) { 386 obs.S1P = gnssData.measdata[iSat][iEntry]; 387 } 388 else if (iEntry == GNSSENTRY_D2CDATA) { 389 obs.D2C = gnssData.measdata[iSat][iEntry]; 390 } 391 else if (iEntry == GNSSENTRY_D2PDATA) { 392 obs.D2P = gnssData.measdata[iSat][iEntry]; 393 } 394 else if (iEntry == GNSSENTRY_S2CDATA) { 395 obs.S2C = gnssData.measdata[iSat][iEntry]; 396 } 397 else if (iEntry == GNSSENTRY_S2PDATA) { 398 obs.S2P = gnssData.measdata[iSat][iEntry]; 399 } 400 else if (iEntry == GNSSENTRY_C5DATA) { 401 obs.C5 = gnssData.measdata[iSat][iEntry]; 402 } 403 else if (iEntry == GNSSENTRY_L5DATA) { 404 obs.L5 = gnssData.measdata[iSat][iEntry]; 405 } 406 else if (iEntry == GNSSENTRY_D5DATA) { 407 obs.D5 = gnssData.measdata[iSat][iEntry]; 408 } 409 else if (iEntry == GNSSENTRY_S5DATA) { 410 obs.S5 = gnssData.measdata[iSat][iEntry]; 411 } 412 } 344 obs._measdata[iEntry] = gnssData.measdata[iSat][iEntry]; 345 obs._codetype[iEntry] = gnssData.codetype[iSat][iEntry]; 413 346 } 414 347 _obsList.push_back(obs); -
trunk/BNC/src/bncpppclient.cpp
r4373 r4389 160 160 // -------------------- 161 161 if (obs.satSys == 'G') { 162 if ( (obs. P1 || obs.C1) && (obs.P2 || obs.C2) && obs.l1() && obs.l2() ) {162 if ( (obs.p1() || obs.c1()) && (obs.p2() || obs.c2()) && obs.l1() && obs.l2() ) { 163 163 double f1 = t_CST::freq1; 164 164 double f2 = t_CST::freq2; 165 165 double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 166 166 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 167 if (obs. P1) {168 satData->P1 = obs. P1+ (bb ? bb->p1 : 0.0);167 if (obs.p1()) { 168 satData->P1 = obs.p1() + (bb ? bb->p1 : 0.0); 169 169 } 170 170 else { 171 satData->P1 = obs. C1+ (bb ? bb->c1 : 0.0);172 } 173 if (obs. P2) {174 satData->P2 = obs. P2+ (bb ? bb->p2 : 0.0);171 satData->P1 = obs.c1() + (bb ? bb->c1 : 0.0); 172 } 173 if (obs.p2()) { 174 satData->P2 = obs.p2() + (bb ? bb->p2 : 0.0); 175 175 } 176 176 else { 177 satData->P2 = obs. C2;177 satData->P2 = obs.c2(); 178 178 } 179 179 satData->L1 = obs.l1() * t_CST::c / f1; … … 193 193 // ------------------------ 194 194 else if (obs.satSys == 'R') { 195 if ( (obs. P1 || obs.C1) && (obs.P2 || obs.C2) && obs.l1() && obs.l2() ) {195 if ( (obs.p1() || obs.c1()) && (obs.p2() || obs.c2()) && obs.l1() && obs.l2() ) { 196 196 double f1 = t_CST::f1(obs.satSys, obs.slotNum); 197 197 double f2 = t_CST::f2(obs.satSys, obs.slotNum); 198 198 double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 199 199 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 200 if (obs. P1) {201 satData->P1 = obs. P1+ (bb ? bb->p1 : 0.0);200 if (obs.p1()) { 201 satData->P1 = obs.p1() + (bb ? bb->p1 : 0.0); 202 202 } 203 203 else { 204 satData->P1 = obs. C1+ (bb ? bb->c1 : 0.0);205 } 206 if (obs. P2) {207 satData->P2 = obs. P2+ (bb ? bb->p2 : 0.0);204 satData->P1 = obs.c1() + (bb ? bb->c1 : 0.0); 205 } 206 if (obs.p2()) { 207 satData->P2 = obs.p2() + (bb ? bb->p2 : 0.0); 208 208 } 209 209 else { 210 satData->P2 = obs. C2;210 satData->P2 = obs.c2(); 211 211 } 212 212 satData->L1 = obs.l1() * t_CST::c / f1; … … 226 226 // ------------------------ 227 227 else if (obs.satSys == 'E') { 228 if ( obs. C1 && obs.C5 && obs.l1() && obs.L5) {228 if ( obs.c1() && obs.c5() && obs.l1() && obs.l5()) { 229 229 double f1 = t_CST::freq1; 230 230 double f5 = t_CST::freq5; … … 232 232 double c5 = - f5 * f5 / (f1 * f1 - f5 * f5); 233 233 234 satData->P1 = obs. C1;235 satData->P5 = obs. C5;234 satData->P1 = obs.c1(); 235 satData->P5 = obs.c5(); 236 236 satData->L1 = obs.l1() * t_CST::c / f1; 237 satData->L5 = obs. L5* t_CST::c / f5;237 satData->L5 = obs.l5() * t_CST::c / f5; 238 238 satData->P3 = c1 * satData->P1 + c5 * satData->P5; 239 239 satData->L3 = c1 * satData->L1 + c5 * satData->L5; -
trunk/BNC/src/bncrinex.cpp
r4387 r4389 659 659 // --------------- 660 660 else { 661 _out << setw(14) << setprecision(3) << obs. C1<< ' ' << ' '662 << setw(14) << setprecision(3) << obs. P1<< ' ' << ' '661 _out << setw(14) << setprecision(3) << obs.c1() << ' ' << ' ' 662 << setw(14) << setprecision(3) << obs.p1() << ' ' << ' ' 663 663 << setw(14) << setprecision(3) << obs.l1() << lli1 << ' ' 664 664 << setw(14) << setprecision(3) << obs.s1() << ' ' << ' ' 665 << setw(14) << setprecision(3) << obs. C2<< ' ' << ' ' << endl666 << setw(14) << setprecision(3) << obs. P2<< ' ' << ' '665 << setw(14) << setprecision(3) << obs.c2() << ' ' << ' ' << endl 666 << setw(14) << setprecision(3) << obs.p2() << ' ' << ' ' 667 667 << setw(14) << setprecision(3) << obs.l2() << lli2 << ' ' 668 668 << setw(14) << setprecision(3) << obs.s2() << endl; … … 702 702 << setw(2) << setfill('0') << obs.satNum << setfill(' '); 703 703 704 if (obs.satSys == 'G') { // GPS 705 str << setw(14) << setprecision(3) << obs.C1 << ' ' << ' ' // C1C 706 << setw(14) << setprecision(3) << obs.L1C << lli1 << ' ' // L1C 707 << setw(14) << setprecision(3) << obs.D1C << ' ' << ' ' // D1C 708 << setw(14) << setprecision(3) << obs.S1C << ' ' << ' ' // S1C 709 << setw(14) << setprecision(3) << obs.P1 << ' ' << ' ' // C1W 710 << setw(14) << setprecision(3) << obs.L1P << lli1 << ' ' // L1W 711 << setw(14) << setprecision(3) << obs.D1P << ' ' << ' ' // D1W 712 << setw(14) << setprecision(3) << obs.S1P << ' ' << ' ' // S1W 713 << setw(14) << setprecision(3) << obs.P2 << ' ' << ' ' // C2P 714 << setw(14) << setprecision(3) << obs.L2P << lli2 << ' ' // L2P 715 << setw(14) << setprecision(3) << obs.D2P << ' ' << ' ' // D2P 716 << setw(14) << setprecision(3) << obs.S2P << ' ' << ' ' // S2P 717 << setw(14) << setprecision(3) << obs.C2 << ' ' << ' ' // C2X 718 << setw(14) << setprecision(3) << obs.L2C << lli2 << ' ' // L2X 719 << setw(14) << setprecision(3) << obs.D2C << ' ' << ' ' // D2X 720 << setw(14) << setprecision(3) << obs.S2C << ' ' << ' ' // S2X 721 << setw(14) << setprecision(3) << obs.C5 << ' ' << ' ' // C5 722 << setw(14) << setprecision(3) << obs.L5 << lli5 << ' ' // L5 723 << setw(14) << setprecision(3) << obs.D5 << ' ' << ' ' // D5 724 << setw(14) << setprecision(3) << obs.S5; // S5 725 } 726 else if (obs.satSys == 'R') { // Glonass 727 str << setw(14) << setprecision(3) << obs.C1 << ' ' << ' ' // C1C 728 << setw(14) << setprecision(3) << obs.L1C << lli1 << ' ' // L1C 729 << setw(14) << setprecision(3) << obs.D1C << ' ' << ' ' // D1C 730 << setw(14) << setprecision(3) << obs.S1C << ' ' << ' ' // S1C 731 << setw(14) << setprecision(3) << obs.P1 << ' ' << ' ' // C1P 732 << setw(14) << setprecision(3) << obs.L1P << lli1 << ' ' // L1P 733 << setw(14) << setprecision(3) << obs.D1P << ' ' << ' ' // D1P 734 << setw(14) << setprecision(3) << obs.S1P << ' ' << ' ' // S1P 735 << setw(14) << setprecision(3) << obs.P2 << ' ' << ' ' // C2P 736 << setw(14) << setprecision(3) << obs.L2P << lli2 << ' ' // L2P 737 << setw(14) << setprecision(3) << obs.D2P << ' ' << ' ' // D2P 738 << setw(14) << setprecision(3) << obs.S2P << ' ' << ' ' // S2P 739 << setw(14) << setprecision(3) << obs.C2 << ' ' << ' ' // C2C 740 << setw(14) << setprecision(3) << obs.L2C << lli2 << ' ' // L2C 741 << setw(14) << setprecision(3) << obs.D2C << ' ' << ' ' // D2C 742 << setw(14) << setprecision(3) << obs.S2C; // S2C 743 } 744 else if (obs.satSys == 'S') { // SBAS 745 str << setw(14) << setprecision(3) << obs.C1 << ' ' << ' ' // C1C 746 << setw(14) << setprecision(3) << obs.L1C << lli1 << ' ' // L1C 747 << setw(14) << setprecision(3) << obs.D1C << ' ' << ' ' // D1C 748 << setw(14) << setprecision(3) << obs.S1C << ' ' << ' ' // S1C 749 << setw(14) << setprecision(3) << obs.P1 << ' ' << ' ' // C1W 750 << setw(14) << setprecision(3) << obs.L1P << lli1 << ' ' // L1W 751 << setw(14) << setprecision(3) << obs.D1P << ' ' << ' ' // D1W 752 << setw(14) << setprecision(3) << obs.S1P; // S1W 753 } 754 else if (obs.satSys == 'E') { // Galileo 755 str << setw(14) << setprecision(3) << obs.C1 << ' ' << ' ' // C1 756 << setw(14) << setprecision(3) << obs.L1C << lli1 << ' ' // L1 757 << setw(14) << setprecision(3) << obs.D1C << ' ' << ' ' // D1 758 << setw(14) << setprecision(3) << obs.S1C << ' ' << ' ' // S1 759 << setw(14) << setprecision(3) << obs.C5 << ' ' << ' ' // C5 760 << setw(14) << setprecision(3) << obs.L5 << lli5 << ' ' // L5 761 << setw(14) << setprecision(3) << obs.D5 << ' ' << ' ' // D5 762 << setw(14) << setprecision(3) << obs.S5; // S5 763 } 764 else if (obs.satSys == 'J') { // QZSS 765 str << setw(14) << setprecision(3) << obs.C1 << ' ' << ' ' // C1C 766 << setw(14) << setprecision(3) << obs.L1C << lli1 << ' ' // L1C 767 << setw(14) << setprecision(3) << obs.D1C << ' ' << ' ' // D1C 768 << setw(14) << setprecision(3) << obs.S1C << ' ' << ' ' // S1C 769 << setw(14) << setprecision(3) << obs.P1 << ' ' << ' ' // C1X 770 << setw(14) << setprecision(3) << obs.L1P << lli1 << ' ' // L1X 771 << setw(14) << setprecision(3) << obs.D1P << ' ' << ' ' // D1X 772 << setw(14) << setprecision(3) << obs.S1P << ' ' << ' ' // S1X 773 << setw(14) << setprecision(3) << obs.C2 << ' ' << ' ' // C2X 774 << setw(14) << setprecision(3) << obs.L2C << lli2 << ' ' // L2X 775 << setw(14) << setprecision(3) << obs.D2C << ' ' << ' ' // D2X 776 << setw(14) << setprecision(3) << obs.S2C << ' ' << ' ' // S2X 777 << setw(14) << setprecision(3) << obs.C5 << ' ' << ' ' // C5 778 << setw(14) << setprecision(3) << obs.L5 << lli5 << ' ' // L5 779 << setw(14) << setprecision(3) << obs.D5 << ' ' << ' ' // D5 780 << setw(14) << setprecision(3) << obs.S5; // S5 781 } 782 else if (obs.satSys == 'C') { // Compass 783 str << setw(14) << setprecision(3) << obs.C2 << ' ' << ' ' // C2I 784 << setw(14) << setprecision(3) << obs.L2C << lli2 << ' ' // L2I 785 << setw(14) << setprecision(3) << obs.D2C << ' ' << ' ' // D2I 786 << setw(14) << setprecision(3) << obs.S2C; // S2I 787 } 704 for (int iEntry = 0; iEntry < GNSSENTRY_NUMBER; iEntry++) { 705 unsigned df = (1 << iEntry); 706 if (df & obs._dataflags) { 707 str << obs.entry2str(iEntry) << ' ' 708 << setw(14) << setprecision(3) << obs._measdata[iEntry] << ' '; 709 } 710 } 711 788 712 return str.str(); 789 713 } … … 819 743 } 820 744 821 if (obs.satSys == 'G') { // GPS 822 if (obs.has1C()) { 823 str << " 1C " 824 << obsToStr(obs.C1) << ' ' 825 << obsToStr(obs.L1C) << ' ' 826 << obsToStr(obs.D1C) << ' ' 827 << obsToStr(obs.S1C, 8, 3) << ' ' 828 << setw(2) << obs.slip_cnt_L1; 829 } 830 if (obs.has1P()) { 831 str << " 1W " 832 << obsToStr(obs.P1) << ' ' 833 << obsToStr(obs.L1P) << ' ' 834 << obsToStr(obs.D1P) << ' ' 835 << obsToStr(obs.S1P, 8, 3) << ' ' 836 << setw(2) << obs.slip_cnt_L1; 837 } 838 if (obs.has2P()) { 839 str << " 2P " 840 << obsToStr(obs.P2) << ' ' 841 << obsToStr(obs.L2P) << ' ' 842 << obsToStr(obs.D2P) << ' ' 843 << obsToStr(obs.S2P, 8, 3) << ' ' 844 << setw(2) << obs.slip_cnt_L2; 845 } 846 if (obs.has2C()) { 847 str << " 2X " 848 << obsToStr(obs.C2) << ' ' 849 << obsToStr(obs.L2C) << ' ' 850 << obsToStr(obs.D2C) << ' ' 851 << obsToStr(obs.S2C, 8, 3) << ' ' 852 << setw(2) << obs.slip_cnt_L2; 853 } 854 if (obs.has5C()) { 855 str << " 5C " 856 << obsToStr(obs.C5) << ' ' 857 << obsToStr(obs.L5) << ' ' 858 << obsToStr(obs.D5) << ' ' 859 << obsToStr(obs.S5, 8, 3) << ' ' 860 << setw(2) << obs.slip_cnt_L5; 861 } 862 } 863 else if (obs.satSys == 'R') { // Glonass 864 if (obs.has1C()) { 865 str << " 1C " 866 << obsToStr(obs.C1) << ' ' 867 << obsToStr(obs.L1C) << ' ' 868 << obsToStr(obs.D1C) << ' ' 869 << obsToStr(obs.S1C, 8, 3) << ' ' 870 << setw(2) << obs.slip_cnt_L1; 871 } 872 if (obs.has1P()) { 873 str << " 1P " 874 << obsToStr(obs.P1) << ' ' 875 << obsToStr(obs.L1P) << ' ' 876 << obsToStr(obs.D1P) << ' ' 877 << obsToStr(obs.S1P, 8, 3) << ' ' 878 << setw(2) << obs.slip_cnt_L1; 879 } 880 if (obs.has2P()) { 881 str << " 2P " 882 << obsToStr(obs.P2) << ' ' 883 << obsToStr(obs.L2P) << ' ' 884 << obsToStr(obs.D2P) << ' ' 885 << obsToStr(obs.S2P, 8, 3) << ' ' 886 << setw(2) << obs.slip_cnt_L2; 887 } 888 if (obs.has2C()) { 889 str << " 2C " 890 << obsToStr(obs.C2) << ' ' 891 << obsToStr(obs.L2C) << ' ' 892 << obsToStr(obs.D2C) << ' ' 893 << obsToStr(obs.S2C, 8, 3) << ' ' 894 << setw(2) << obs.slip_cnt_L2; 895 } 896 } 897 else if (obs.satSys == 'S') { // SBAS 898 if (obs.has1C()) { 899 str << " 1C " 900 << obsToStr(obs.C1) << ' ' 901 << obsToStr(obs.L1C) << ' ' 902 << obsToStr(obs.D1C) << ' ' 903 << obsToStr(obs.S1C, 8, 3) << ' ' 904 << setw(2) << obs.slip_cnt_L1; 905 } 906 if (obs.has1P()) { 907 str << " 1W " 908 << obsToStr(obs.P1) << ' ' 909 << obsToStr(obs.L1P) << ' ' 910 << obsToStr(obs.D1P) << ' ' 911 << obsToStr(obs.S1P, 8, 3) << ' ' 912 << setw(2) << obs.slip_cnt_L1; 913 } 914 } 915 else if (obs.satSys == 'E') { // Galileo 916 if (obs.has1C()) { 917 str << " 1C " 918 << obsToStr(obs.C1) << ' ' 919 << obsToStr(obs.L1C) << ' ' 920 << obsToStr(obs.D1C) << ' ' 921 << obsToStr(obs.S1C, 8, 3) << ' ' 922 << setw(2) << obs.slip_cnt_L1; 923 } 924 if (obs.has5C()) { 925 str << " 5C " 926 << obsToStr(obs.C5) << ' ' 927 << obsToStr(obs.L5) << ' ' 928 << obsToStr(obs.D5) << ' ' 929 << obsToStr(obs.S5, 8, 3) << ' ' 930 << setw(2) << obs.slip_cnt_L5; 931 } 932 } 745 for (int iEntry = 0; iEntry < GNSSENTRY_NUMBER; iEntry++) { 746 unsigned df = (1 << iEntry); 747 if (df & obs._dataflags) { 748 str << obs.entry2str(iEntry) << ' ' 749 << setw(14) << setprecision(3) << obs._measdata[iEntry] << ' '; 750 // TODO: handle slip counters 751 } 752 } 753 933 754 return str.str(); 934 755 } -
trunk/BNC/src/rinex/bncpostprocess.cpp
r4364 r4389 111 111 strncpy(obs.StatID, rnxObsFile->markerName().toAscii().constData(), 112 112 sizeof(obs.StatID)); 113 113 114 obs.satSys = rnxSat.satSys; 114 115 obs.satNum = rnxSat.satNum; 115 116 obs.GPSWeek = epo->tt.gpsw(); 116 117 obs.GPSWeeks = epo->tt.gpssec(); 117 //// TODO: check RINEX Version 3 types 118 118 119 for (int iType = 0; iType < rnxObsFile->nTypes(obs.satSys); iType++) { 119 120 QByteArray type = rnxObsFile->obsType(obs.satSys,iType).toAscii(); 120 if (type.indexOf("C1") == 0 && obs.C1 == 0.0) { 121 obs.C1 = rnxSat.obs[iType]; 122 } 123 else if (type.indexOf("P1") == 0 && obs.P1 == 0.0) { 124 obs.P1 = rnxSat.obs[iType]; 125 } 126 else if (type.indexOf("L1") == 0 && obs.L1C == 0.0) { 127 obs.L1C = rnxSat.obs[iType]; 128 if (obs.slip_cnt_L1 < 0) { // undefined value 129 obs.slip_cnt_L1 = 0; 130 } 131 else if (rnxSat.lli[iType] & 1) { 132 ++obs.slip_cnt_L1; 133 } 134 } 135 else if (type.indexOf("C2") == 0 && obs.C2 == 0.0) { 136 obs.C2 = rnxSat.obs[iType]; 137 } 138 else if (type.indexOf("P2") == 0 && obs.P2 == 0.0) { 139 obs.P2 = rnxSat.obs[iType]; 140 } 141 else if (type.indexOf("L2") == 0 && obs.L2C == 0.0) { 142 obs.L2C = rnxSat.obs[iType]; 143 if (obs.slip_cnt_L2 < 0) { // undefined value 144 obs.slip_cnt_L2 = 0; 145 } 146 else if (rnxSat.lli[iType] & 1) { 147 ++obs.slip_cnt_L2; 148 } 149 } 121 int iEntry = obs.str2entry(type.data()); 122 obs._measdata[iEntry] = rnxSat.obs[iType]; 123 // TOOD: handle slip flags 150 124 } 151 125 }
Note:
See TracChangeset
for help on using the changeset viewer.