Changeset 2709 in ntrip
- Timestamp:
- Nov 18, 2010, 12:28:40 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/GPSS/gpssDecoder.cpp
r2585 r2709 1 \ 1 2 2 /* ------------------------------------------------------------------------- 3 3 * BKG NTRIP Client … … 87 87 sizeof(epochHdr)); 88 88 89 reqLength += epochHdr.n_svs * sizeof(t_obs Internal) + sizeof(crc) + 1;89 reqLength += epochHdr.n_svs * sizeof(t_obs) + sizeof(crc) + 1; 90 90 91 91 if (_buffer.length() >= reqLength) { 92 92 93 93 int checkLen = 2 + sizeof(recordSize) + sizeof(EPOCHHEADER) + 94 epochHdr.n_svs * sizeof(t_obs Internal);94 epochHdr.n_svs * sizeof(t_obs); 95 95 memcpy(&crc, _buffer.data() + checkLen, sizeof(crc)); 96 96 int crcCal = cal_crc((unsigned char*) _buffer.data(), checkLen); … … 100 100 obsFound = true; 101 101 t_obs* obs = new t_obs(); 102 memcpy(&(obs->_o), _buffer.data() + 2 + sizeof(recordSize) + 103 sizeof(epochHdr) + is * sizeof(t_obsInternal), 104 sizeof(t_obsInternal)); 102 memcpy(obs, _buffer.data() + 2 + sizeof(recordSize) + 103 sizeof(epochHdr) + is * sizeof(t_obs), sizeof(t_obs)); 105 104 _obsList.push_back(obs); 106 105 } -
trunk/BNC/RTCM/GPSDecoder.h
r2702 r2709 29 29 #include <vector> 30 30 #include <string> 31 #include <QPointer>32 31 #include <QList> 33 32 #include <QStringList> … … 35 34 #include "bncconst.h" 36 35 37 struct t_obsInternal { 36 class t_obs { 37 public: 38 enum t_obs_status {initial, posted, received}; 39 t_obs() { 40 _status = initial; 41 satSys = 'G'; 42 satNum = 0; 43 slotNum = 0; 44 GPSWeek = 0; 45 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; 66 slip_cnt_L1 = -1; 67 slip_cnt_L2 = -1; 68 slip_cnt_L5 = -1; 69 StatID[0] = '\x0'; 70 } 71 72 ~t_obs() {} 73 74 double L1() const {return (L1P != 0.0 ? L1P : L1C);} 75 double L2() const {return (L2P != 0.0 ? L2P : L2C);} 76 double S1() const {return (L1P != 0.0 ? S1P : S1C);} 77 double S2() const {return (L2P != 0.0 ? S2P : S2C);} 78 79 t_obs_status _status; 80 38 81 char StatID[20+1]; // Station ID 39 82 char satSys; // Satellite System ('G' or 'R') … … 71 114 }; 72 115 73 class t_obs : public QObject{ 74 public: 75 enum t_obs_status {initial, posted, received}; 76 t_obs() { 77 _status = initial; 78 _o.satSys = 'G'; 79 _o.satNum = 0; 80 _o.slotNum = 0; 81 _o.GPSWeek = 0; 82 _o.GPSWeeks = 0.0; 83 _o.C1 = 0.0; 84 _o.P1 = 0.0; 85 _o.L1C = 0.0; 86 _o.D1C = 0.0; 87 _o.S1C = 0.0; 88 _o.L1P = 0.0; 89 _o.D1P = 0.0; 90 _o.S1P = 0.0; 91 _o.C2 = 0.0; 92 _o.P2 = 0.0; 93 _o.L2C = 0.0; 94 _o.D2C = 0.0; 95 _o.S2C = 0.0; 96 _o.L2P = 0.0; 97 _o.D2P = 0.0; 98 _o.S2P = 0.0; 99 _o.C5 = 0.0; 100 _o.L5 = 0.0; 101 _o.D5 = 0.0; 102 _o.S5 = 0.0; 103 _o.slip_cnt_L1 = -1; 104 _o.slip_cnt_L2 = -1; 105 _o.slip_cnt_L5 = -1; 106 _o.StatID[0] = '\x0'; 107 } 108 ~t_obs() {} 109 double L1() const {return (_o.L1P != 0.0 ? _o.L1P : _o.L1C);} 110 double L2() const {return (_o.L2P != 0.0 ? _o.L2P : _o.L2C);} 111 double S1() const {return (_o.L1P != 0.0 ? _o.S1P : _o.S1C);} 112 double S2() const {return (_o.L2P != 0.0 ? _o.S2P : _o.S2C);} 113 t_obsInternal _o; 114 t_obs_status _status; 115 }; 116 117 typedef QPointer<t_obs> p_obs; 116 typedef t_obs* p_obs; 118 117 119 118 class GPSDecoder { … … 125 124 while (it.hasNext()) { 126 125 p_obs obs = it.next(); 127 if ( !obs.isNull()&& obs->_status == t_obs::initial) {126 if (obs && obs->_status == t_obs::initial) { 128 127 delete obs; 129 128 } -
trunk/BNC/RTCM/RTCM2Decoder.cpp
r2702 r2709 143 143 _obsList.push_back(obs); 144 144 if (_ObsBlock.PRN[iSat] > 100) { 145 obs-> _o.satNum = _ObsBlock.PRN[iSat] % 100;146 obs-> _o.satSys = 'R';145 obs->satNum = _ObsBlock.PRN[iSat] % 100; 146 obs->satSys = 'R'; 147 147 } 148 148 else { 149 obs-> _o.satNum = _ObsBlock.PRN[iSat];150 obs-> _o.satSys = 'G';149 obs->satNum = _ObsBlock.PRN[iSat]; 150 obs->satSys = 'G'; 151 151 } 152 obs-> _o.GPSWeek = epochWeek;153 obs-> _o.GPSWeeks = epochSecs;154 obs-> _o.C1 = _ObsBlock.rng_C1[iSat];155 obs-> _o.P1 = _ObsBlock.rng_P1[iSat];156 obs-> _o.P2 = _ObsBlock.rng_P2[iSat];157 obs-> _o.L1P = _ObsBlock.resolvedPhase_L1(iSat);158 obs-> _o.L2P = _ObsBlock.resolvedPhase_L2(iSat);159 obs-> _o.slip_cnt_L1 = _ObsBlock.slip_L1[iSat];160 obs-> _o.slip_cnt_L2 = _ObsBlock.slip_L2[iSat];152 obs->GPSWeek = epochWeek; 153 obs->GPSWeeks = epochSecs; 154 obs->C1 = _ObsBlock.rng_C1[iSat]; 155 obs->P1 = _ObsBlock.rng_P1[iSat]; 156 obs->P2 = _ObsBlock.rng_P2[iSat]; 157 obs->L1P = _ObsBlock.resolvedPhase_L1(iSat); 158 obs->L2P = _ObsBlock.resolvedPhase_L2(iSat); 159 obs->slip_cnt_L1 = _ObsBlock.slip_L1[iSat]; 160 obs->slip_cnt_L2 = _ObsBlock.slip_L2[iSat]; 161 161 } 162 162 _ObsBlock.clear(); … … 382 382 new_obs = new t_obs(); 383 383 384 new_obs-> _o.StatID[0] = '\x0';385 new_obs-> _o.satSys = (corr->PRN < 200 ? 'G' : 'R');386 new_obs-> _o.satNum = (corr->PRN < 200 ? corr->PRN : corr->PRN - 200);384 new_obs->StatID[0] = '\x0'; 385 new_obs->satSys = (corr->PRN < 200 ? 'G' : 'R'); 386 new_obs->satNum = (corr->PRN < 200 ? corr->PRN : corr->PRN - 200); 387 387 388 new_obs-> _o.GPSWeek = GPSWeek_rcv;389 new_obs-> _o.GPSWeeks = GPSWeeks_rcv;388 new_obs->GPSWeek = GPSWeek_rcv; 389 new_obs->GPSWeeks = GPSWeeks_rcv; 390 390 } 391 391 … … 394 394 switch (ii) { 395 395 case 0: // --- L1 --- 396 new_obs-> _o.L1P = *obsVal / LAMBDA_1;397 new_obs-> _o.slip_cnt_L1 = corr->lock1;396 new_obs->L1P = *obsVal / LAMBDA_1; 397 new_obs->slip_cnt_L1 = corr->lock1; 398 398 break; 399 399 case 1: // --- L2 --- 400 new_obs-> _o.L2P = *obsVal / LAMBDA_2;401 new_obs-> _o.slip_cnt_L2 = corr->lock2;400 new_obs->L2P = *obsVal / LAMBDA_2; 401 new_obs->slip_cnt_L2 = corr->lock2; 402 402 break; 403 403 case 2: // --- C1 / P1 --- 404 404 if ( corr->Pind1 ) 405 new_obs-> _o.P1 = *obsVal;405 new_obs->P1 = *obsVal; 406 406 else 407 new_obs-> _o.C1 = *obsVal;407 new_obs->C1 = *obsVal; 408 408 break; 409 409 case 3: // --- C2 / P2 --- 410 410 if ( corr->Pind2 ) 411 new_obs-> _o.P2 = *obsVal;411 new_obs->P2 = *obsVal; 412 412 else 413 new_obs-> _o.C2 = *obsVal;413 new_obs->C2 = *obsVal; 414 414 break; 415 415 default: -
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r2702 r2709 243 243 // --- 244 244 if (satID >= PRN_GPS_START && satID <= PRN_GPS_END) { 245 obs-> _o.satSys = 'G';246 obs-> _o.satNum = satID;245 obs->satSys = 'G'; 246 obs->satNum = satID; 247 247 } 248 248 … … 250 250 // ------- 251 251 else if (satID >= PRN_GLONASS_START && satID <= PRN_GLONASS_END) { 252 obs-> _o.satSys = 'R';253 obs-> _o.satNum = satID - PRN_GLONASS_START + 1;254 if (obs-> _o.satNum <= PRN_GLONASS_NUM &&255 parser.GLOFreq[obs-> _o.satNum-1] != 0) {256 obs-> _o.slotNum = parser.GLOFreq[obs->_o.satNum-1] - 100;252 obs->satSys = 'R'; 253 obs->satNum = satID - PRN_GLONASS_START + 1; 254 if (obs->satNum <= PRN_GLONASS_NUM && 255 parser.GLOFreq[obs->satNum-1] != 0) { 256 obs->slotNum = parser.GLOFreq[obs->satNum-1] - 100; 257 257 } 258 258 else { … … 265 265 // ------- 266 266 else if (satID >= PRN_GALILEO_START && satID <= PRN_GALILEO_END) { 267 obs-> _o.satSys = 'E';268 obs-> _o.satNum = satID - PRN_GALILEO_START + 1;267 obs->satSys = 'E'; 268 obs->satNum = satID - PRN_GALILEO_START + 1; 269 269 } 270 270 … … 272 272 // ---- 273 273 else if (satID >= PRN_WAAS_START && satID <= PRN_WAAS_END) { 274 obs-> _o.satSys = 'S';275 obs-> _o.satNum = satID - PRN_WAAS_START + 20;274 obs->satSys = 'S'; 275 obs->satNum = satID - PRN_WAAS_START + 20; 276 276 } 277 277 … … 279 279 // ------------- 280 280 else if (satID >= PRN_GIOVE_START && satID <= PRN_GIOVE_END) { 281 obs-> _o.satSys = 'E';282 obs-> _o.satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET;281 obs->satSys = 'E'; 282 obs->satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET; 283 283 } 284 284 … … 297 297 } 298 298 299 obs-> _o.GPSWeek = gnssData.week;300 obs-> _o.GPSWeeks = gnssData.timeofweek / 1000.0;301 302 QString prn = QString("%1%2").arg(obs-> _o.satSys)303 .arg(obs-> _o.satNum, 2, 10, QChar('0'));299 obs->GPSWeek = gnssData.week; 300 obs->GPSWeeks = gnssData.timeofweek / 1000.0; 301 302 QString prn = QString("%1%2").arg(obs->satSys) 303 .arg(obs->satNum, 2, 10, QChar('0')); 304 304 305 305 // Handle loss-of-lock flags … … 318 318 _slip_cnt_L1[prn] = 1; 319 319 } 320 obs-> _o.slip_cnt_L1 = _slip_cnt_L1[prn];320 obs->slip_cnt_L1 = _slip_cnt_L1[prn]; 321 321 } 322 322 if (GNSSDF2_LOCKLOSSL2 & gnssData.dataflags2[iSat]) { … … 327 327 _slip_cnt_L2[prn] = 1; 328 328 } 329 obs-> _o.slip_cnt_L2 = _slip_cnt_L2[prn];329 obs->slip_cnt_L2 = _slip_cnt_L2[prn]; 330 330 } 331 331 if (GNSSDF2_LOCKLOSSL5 & gnssData.dataflags2[iSat]) { … … 336 336 _slip_cnt_L5[prn] = 1; 337 337 } 338 obs-> _o.slip_cnt_L5 = _slip_cnt_L5[prn];338 obs->slip_cnt_L5 = _slip_cnt_L5[prn]; 339 339 } 340 340 … … 357 357 358 358 if (iEntry == GNSSENTRY_C1DATA) { 359 obs-> _o.C1 = gnssData.measdata[iSat][iEntry];359 obs->C1 = gnssData.measdata[iSat][iEntry]; 360 360 } 361 361 else if (iEntry == GNSSENTRY_C2DATA) { 362 obs-> _o.C2 = gnssData.measdata[iSat][iEntry];362 obs->C2 = gnssData.measdata[iSat][iEntry]; 363 363 } 364 364 else if (iEntry == GNSSENTRY_P1DATA) { 365 obs-> _o.P1 = gnssData.measdata[iSat][iEntry];365 obs->P1 = gnssData.measdata[iSat][iEntry]; 366 366 } 367 367 else if (iEntry == GNSSENTRY_P2DATA) { 368 obs-> _o.P2 = gnssData.measdata[iSat][iEntry];368 obs->P2 = gnssData.measdata[iSat][iEntry]; 369 369 } 370 370 else if (iEntry == GNSSENTRY_L1CDATA) { 371 obs-> _o.L1C = gnssData.measdata[iSat][iEntry];371 obs->L1C = gnssData.measdata[iSat][iEntry]; 372 372 } 373 373 else if (iEntry == GNSSENTRY_L1PDATA) { 374 obs-> _o.L1P = gnssData.measdata[iSat][iEntry];374 obs->L1P = gnssData.measdata[iSat][iEntry]; 375 375 } 376 376 else if (iEntry == GNSSENTRY_L2CDATA) { 377 obs-> _o.L2C = gnssData.measdata[iSat][iEntry];377 obs->L2C = gnssData.measdata[iSat][iEntry]; 378 378 } 379 379 else if (iEntry == GNSSENTRY_L2PDATA) { 380 obs-> _o.L2P = gnssData.measdata[iSat][iEntry];380 obs->L2P = gnssData.measdata[iSat][iEntry]; 381 381 } 382 382 else if (iEntry == GNSSENTRY_D1CDATA) { 383 obs-> _o.D1C = gnssData.measdata[iSat][iEntry];383 obs->D1C = gnssData.measdata[iSat][iEntry]; 384 384 } 385 385 else if (iEntry == GNSSENTRY_D1PDATA) { 386 obs-> _o.D1P = gnssData.measdata[iSat][iEntry];386 obs->D1P = gnssData.measdata[iSat][iEntry]; 387 387 } 388 388 else if (iEntry == GNSSENTRY_S1CDATA) { 389 obs-> _o.S1C = gnssData.measdata[iSat][iEntry];389 obs->S1C = gnssData.measdata[iSat][iEntry]; 390 390 } 391 391 else if (iEntry == GNSSENTRY_S1PDATA) { 392 obs-> _o.S1P = gnssData.measdata[iSat][iEntry];392 obs->S1P = gnssData.measdata[iSat][iEntry]; 393 393 } 394 394 else if (iEntry == GNSSENTRY_D2CDATA) { 395 obs-> _o.D2C = gnssData.measdata[iSat][iEntry];395 obs->D2C = gnssData.measdata[iSat][iEntry]; 396 396 } 397 397 else if (iEntry == GNSSENTRY_D2PDATA) { 398 obs-> _o.D2P = gnssData.measdata[iSat][iEntry];398 obs->D2P = gnssData.measdata[iSat][iEntry]; 399 399 } 400 400 else if (iEntry == GNSSENTRY_S2CDATA) { 401 obs-> _o.S2C = gnssData.measdata[iSat][iEntry];401 obs->S2C = gnssData.measdata[iSat][iEntry]; 402 402 } 403 403 else if (iEntry == GNSSENTRY_S2PDATA) { 404 obs-> _o.S2P = gnssData.measdata[iSat][iEntry];404 obs->S2P = gnssData.measdata[iSat][iEntry]; 405 405 } 406 406 else if (iEntry == GNSSENTRY_C5DATA) { 407 obs-> _o.C5 = gnssData.measdata[iSat][iEntry];407 obs->C5 = gnssData.measdata[iSat][iEntry]; 408 408 } 409 409 else if (iEntry == GNSSENTRY_L5DATA) { 410 obs-> _o.L5 = gnssData.measdata[iSat][iEntry];410 obs->L5 = gnssData.measdata[iSat][iEntry]; 411 411 } 412 412 else if (iEntry == GNSSENTRY_D5DATA) { 413 obs-> _o.D5 = gnssData.measdata[iSat][iEntry];413 obs->D5 = gnssData.measdata[iSat][iEntry]; 414 414 } 415 415 else if (iEntry == GNSSENTRY_S5DATA) { 416 obs-> _o.S5 = gnssData.measdata[iSat][iEntry];416 obs->S5 = gnssData.measdata[iSat][iEntry]; 417 417 } 418 418 } -
trunk/BNC/RTIGS/RTIGSDecoder.cpp
r2702 r2709 118 118 p_obs obs = new t_obs(); 119 119 _obsList.push_back(obs); 120 obs-> _o.satSys = 'G';121 obs-> _o.satNum = _GPSTrans.DecObs.Obs[ii].sat_prn;122 obs-> _o.GPSWeek = _GPSTrans.DecObs.Obs[ii].GPSTime / (7 * 86400);123 obs-> _o.GPSWeeks = _GPSTrans.DecObs.Obs[ii].GPSTime % (7 * 86400);124 obs-> _o.C1 = _GPSTrans.DecObs.Obs[ii].l1_pseudo_range;125 obs-> _o.P1 = _GPSTrans.DecObs.Obs[ii].p1_pseudo_range;126 obs-> _o.P2 = _GPSTrans.DecObs.Obs[ii].p2_pseudo_range;127 obs-> _o.L1P = _GPSTrans.DecObs.Obs[ii].p1_phase;128 obs-> _o.L2P = _GPSTrans.DecObs.Obs[ii].p2_phase;129 obs-> _o.S1P = _GPSTrans.DecObs.Obs[ii].l1_sn;130 obs-> _o.S2P = _GPSTrans.DecObs.Obs[ii].l2_sn;120 obs->satSys = 'G'; 121 obs->satNum = _GPSTrans.DecObs.Obs[ii].sat_prn; 122 obs->GPSWeek = _GPSTrans.DecObs.Obs[ii].GPSTime / (7 * 86400); 123 obs->GPSWeeks = _GPSTrans.DecObs.Obs[ii].GPSTime % (7 * 86400); 124 obs->C1 = _GPSTrans.DecObs.Obs[ii].l1_pseudo_range; 125 obs->P1 = _GPSTrans.DecObs.Obs[ii].p1_pseudo_range; 126 obs->P2 = _GPSTrans.DecObs.Obs[ii].p2_pseudo_range; 127 obs->L1P = _GPSTrans.DecObs.Obs[ii].p1_phase; 128 obs->L2P = _GPSTrans.DecObs.Obs[ii].p2_phase; 129 obs->S1P = _GPSTrans.DecObs.Obs[ii].l1_sn; 130 obs->S2P = _GPSTrans.DecObs.Obs[ii].l2_sn; 131 131 } 132 132 } -
trunk/BNC/bnccaster.cpp
r2702 r2709 56 56 57 57 t_oldObsInternal(const t_obs* obs) { 58 strcpy(StatID, obs-> _o.StatID);58 strcpy(StatID, obs->StatID); 59 59 flags = 0; 60 satSys = obs-> _o.satSys;61 satNum = obs-> _o.satNum;62 slot = obs-> _o.slotNum;63 GPSWeek = obs-> _o.GPSWeek;64 GPSWeeks = obs-> _o.GPSWeeks;65 C1 = obs-> _o.C1;66 C2 = obs-> _o.C2;67 P1 = obs-> _o.P1;68 P2 = obs-> _o.P2;60 satSys = obs->satSys; 61 satNum = obs->satNum; 62 slot = obs->slotNum; 63 GPSWeek = obs->GPSWeek; 64 GPSWeeks = obs->GPSWeeks; 65 C1 = obs->C1; 66 C2 = obs->C2; 67 P1 = obs->P1; 68 P2 = obs->P2; 69 69 L1 = obs->L1(); 70 70 L2 = obs->L2(); 71 slip_cnt_L1 = obs-> _o.slip_cnt_L1;72 slip_cnt_L2 = obs-> _o.slip_cnt_L2;71 slip_cnt_L1 = obs->slip_cnt_L1; 72 slip_cnt_L2 = obs->slip_cnt_L2; 73 73 lock_timei_L1 = -1; 74 74 lock_timei_L2 = -1; … … 214 214 obs->_status = t_obs::received; 215 215 216 long iSec = long(floor(obs-> _o.GPSWeeks+0.5));217 long newTime = obs-> _o.GPSWeek * 7*24*3600 + iSec;216 long iSec = long(floor(obs->GPSWeeks+0.5)); 217 long newTime = obs->GPSWeek * 7*24*3600 + iSec; 218 218 219 219 // Rename the Station 220 220 // ------------------ 221 strncpy(obs-> _o.StatID, staID.constData(),sizeof(obs->_o.StatID));222 obs-> _o.StatID[sizeof(obs->_o.StatID)-1] = '\0';221 strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID)); 222 obs->StatID[sizeof(obs->StatID)-1] = '\0'; 223 223 224 224 const char begObs[] = "BEGOBS"; … … 244 244 } 245 245 else { 246 int numBytes = sizeof(obs ->_o);247 if (myWrite(sock, (const char*)(&obs ->_o), numBytes) != numBytes) {246 int numBytes = sizeof(obs); 247 if (myWrite(sock, (const char*)(&obs), numBytes) != numBytes) { 248 248 ok = false; 249 249 } … … 394 394 395 395 if (first) { 396 QTime enomtime = QTime(0,0,0).addSecs(static_cast<int>(floor(obs-> _o.GPSWeeks+0.5)));396 QTime enomtime = QTime(0,0,0).addSecs(static_cast<int>(floor(obs->GPSWeeks+0.5))); 397 397 // emit( newMessage( QString("Epoch %1 dumped").arg(enomtime.toString("HH:mm:ss")).toAscii(), true) ); // weber 398 398 } … … 404 404 } 405 405 406 *_out << obs-> _o.StatID << " " << obs->_o.GPSWeek << " ";406 *_out << obs->StatID << " " << obs->GPSWeek << " "; 407 407 _out->setRealNumberPrecision(7); 408 *_out << obs-> _o.GPSWeeks << " ";409 410 *_out << bncRinex::rinexSatLine(obs ->_o, ' ', ' ', ' ').c_str()408 *_out << obs->GPSWeeks << " "; 409 410 *_out << bncRinex::rinexSatLine(obs, ' ', ' ', ' ').c_str() 411 411 << endl; 412 412 … … 438 438 } 439 439 else { 440 int numBytes = sizeof(obs ->_o);441 if (myWrite(sock, (const char*)(&obs ->_o), numBytes) != numBytes) {440 int numBytes = sizeof(obs); 441 if (myWrite(sock, (const char*)(&obs), numBytes) != numBytes) { 442 442 ok = false; 443 443 } -
trunk/BNC/bncgetthread.cpp
r2647 r2709 451 451 const double secPerWeek = 7.0 * 24.0 * 3600.0; 452 452 453 double currSec = week 454 double obsSec = obs-> _o.GPSWeek * secPerWeek + obs->_o.GPSWeeks;453 double currSec = week * secPerWeek + sec; 454 double obsSec = obs->GPSWeek * secPerWeek + obs->GPSWeeks; 455 455 456 456 const double maxDt = 600.0; … … 466 466 // ------------ 467 467 if (_rnx) { 468 long iSec = long(floor(obs-> _o.GPSWeeks+0.5));469 long newTime = obs-> _o.GPSWeek * 7*24*3600 + iSec;468 long iSec = long(floor(obs->GPSWeeks+0.5)); 469 long newTime = obs->GPSWeek * 7*24*3600 + iSec; 470 470 if (_samplingRate == 0 || iSec % _samplingRate == 0) { 471 471 _rnx->deepCopy(obs); -
trunk/BNC/bncpppclient.cpp
r2702 r2709 119 119 // 120 120 //////////////////////////////////////////////////////////////////////////// 121 void bncPPPclient::putNewObs(p_obs pObs) {121 void bncPPPclient::putNewObs(p_obs obs) { 122 122 QMutexLocker locker(&_mutex); 123 124 t_obsInternal* obs = &(pObs->_o);125 123 126 124 if (obs->satSys != 'G' && !_useGlonass) { … … 206 204 // Set Phase Observations 207 205 // ---------------------- 208 if ( pObs->L1() && pObs->L2()) {209 satData->L1 = pObs->L1() * t_CST::c / f1;210 satData->L2 = pObs->L2() * t_CST::c / f2;206 if (obs->L1() && obs->L2()) { 207 satData->L1 = obs->L1() * t_CST::c / f1; 208 satData->L2 = obs->L2() * t_CST::c / f2; 211 209 } 212 210 else { -
trunk/BNC/bncrinex.cpp
r2703 r2709 520 520 void bncRinex::deepCopy(const p_obs obs) { 521 521 p_obs newObs = new t_obs(); 522 memcpy( &newObs->_o, &obs->_o, sizeof(t_obsInternal));522 memcpy(newObs, obs, sizeof(t_obs)); 523 523 _obs.push_back(newObs); 524 524 } … … 534 534 while (mIt.hasNext()) { 535 535 p_obs obs = mIt.next(); 536 if (obs-> _o.GPSWeek * 7*24*3600 + obs->_o.GPSWeeks < maxTime - 0.05) {536 if (obs->GPSWeek * 7*24*3600 + obs->GPSWeeks < maxTime - 0.05) { 537 537 dumpList.push_back(obs); 538 538 mIt.remove(); … … 549 549 // ------------- 550 550 p_obs fObs = *dumpList.begin(); 551 QDateTime datTim = dateAndTimeFromGPSweek(fObs-> _o.GPSWeek, fObs->_o.GPSWeeks);552 QDateTime datTimNom = dateAndTimeFromGPSweek(fObs-> _o.GPSWeek,553 floor(fObs-> _o.GPSWeeks+0.5));551 QDateTime datTim = dateAndTimeFromGPSweek(fObs->GPSWeek, fObs->GPSWeeks); 552 QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->GPSWeek, 553 floor(fObs->GPSWeeks+0.5)); 554 554 555 555 // Close the file … … 566 566 } 567 567 568 double sec = double(datTim.time().second()) + fmod(fObs-> _o.GPSWeeks,1.0);568 double sec = double(datTim.time().second()) + fmod(fObs->GPSWeeks,1.0); 569 569 570 570 // Epoch header line: RINEX Version 3 … … 586 586 iSat++; 587 587 p_obs obs = it.next(); 588 _out << obs-> _o.satSys << setw(2) << obs->_o.satNum;588 _out << obs->satSys << setw(2) << obs->satNum; 589 589 if (iSat == 12 && it.hasNext()) { 590 590 _out << endl << " "; … … 601 601 // Cycle slips detection 602 602 // --------------------- 603 QString prn = QString("%1%2").arg(obs-> _o.satSys)604 .arg(obs-> _o.satNum, 2, 10, QChar('0'));603 QString prn = QString("%1%2").arg(obs->satSys) 604 .arg(obs->satNum, 2, 10, QChar('0')); 605 605 606 606 char lli1 = ' '; 607 607 char lli2 = ' '; 608 608 char lli5 = ' '; 609 if ( obs-> _o.slip_cnt_L1 >= 0 ) {609 if ( obs->slip_cnt_L1 >= 0 ) { 610 610 if ( _slip_cnt_L1.find(prn) != _slip_cnt_L1.end() && 611 _slip_cnt_L1.find(prn).value() != obs-> _o.slip_cnt_L1 ) {611 _slip_cnt_L1.find(prn).value() != obs->slip_cnt_L1 ) { 612 612 lli1 = '1'; 613 613 } 614 614 } 615 615 616 if ( obs-> _o.slip_cnt_L2 >= 0 ) {616 if ( obs->slip_cnt_L2 >= 0 ) { 617 617 if ( _slip_cnt_L2.find(prn) != _slip_cnt_L2.end() && 618 _slip_cnt_L2.find(prn).value() != obs-> _o.slip_cnt_L2 ) {618 _slip_cnt_L2.find(prn).value() != obs->slip_cnt_L2 ) { 619 619 lli2 = '1'; 620 620 } 621 621 } 622 622 623 if ( obs-> _o.slip_cnt_L5 >= 0 ) {623 if ( obs->slip_cnt_L5 >= 0 ) { 624 624 if ( _slip_cnt_L5.find(prn) != _slip_cnt_L5.end() && 625 _slip_cnt_L5.find(prn).value() != obs-> _o.slip_cnt_L5 ) {625 _slip_cnt_L5.find(prn).value() != obs->slip_cnt_L5 ) { 626 626 lli5 = '1'; 627 627 } 628 628 } 629 629 630 _slip_cnt_L1[prn] = obs-> _o.slip_cnt_L1;631 _slip_cnt_L2[prn] = obs-> _o.slip_cnt_L2;632 _slip_cnt_L5[prn] = obs-> _o.slip_cnt_L5;630 _slip_cnt_L1[prn] = obs->slip_cnt_L1; 631 _slip_cnt_L2[prn] = obs->slip_cnt_L2; 632 _slip_cnt_L5[prn] = obs->slip_cnt_L5; 633 633 634 634 // RINEX Version 3 635 635 // --------------- 636 636 if (_rinexVers == 3) { 637 _out << rinexSatLine(obs ->_o, lli1, lli2, lli5);637 _out << rinexSatLine(obs, lli1, lli2, lli5); 638 638 _out << endl; 639 639 } … … 642 642 // --------------- 643 643 else { 644 _out << setw(14) << setprecision(3) << obs-> _o.C1 << ' ' << ' '645 << setw(14) << setprecision(3) << obs-> _o.P1 << ' ' << ' '644 _out << setw(14) << setprecision(3) << obs->C1 << ' ' << ' ' 645 << setw(14) << setprecision(3) << obs->P1 << ' ' << ' ' 646 646 << setw(14) << setprecision(3) << obs->L1() << lli1 << ' ' 647 647 << setw(14) << setprecision(3) << obs->S1() << ' ' << ' ' 648 << setw(14) << setprecision(3) << obs-> _o.C2 << ' ' << ' ' << endl649 << setw(14) << setprecision(3) << obs-> _o.P2 << ' ' << ' '648 << setw(14) << setprecision(3) << obs->C2 << ' ' << ' ' << endl 649 << setw(14) << setprecision(3) << obs->P2 << ' ' << ' ' 650 650 << setw(14) << setprecision(3) << obs->L2() << lli2 << ' ' 651 651 << setw(16) << setprecision(3) << obs->S2() << endl; … … 679 679 // One Line in RINEX v3 (static) 680 680 //////////////////////////////////////////////////////////////////////////// 681 string bncRinex::rinexSatLine(const t_obs Internal&obs,681 string bncRinex::rinexSatLine(const t_obs* obs, 682 682 char lli1, char lli2, char lli5) { 683 683 ostringstream str; 684 684 str.setf(ios::showpoint | ios::fixed); 685 685 686 if (obs .satSys == 'G') { // GPS687 str << obs .satSys688 << setw(2) << setfill('0') << obs .satNum << setfill(' ')689 << setw(14) << setprecision(3) << obs .C1 << ' ' << ' '690 << setw(14) << setprecision(3) << obs .L1C << lli1 << ' '691 << setw(14) << setprecision(3) << obs .D1C << ' ' << ' '692 << setw(14) << setprecision(3) << obs .S1C << ' ' << ' '693 << setw(14) << setprecision(3) << obs .P1 << ' ' << ' '694 << setw(14) << setprecision(3) << obs .L1P << lli1 << ' '695 << setw(14) << setprecision(3) << obs .D1P << ' ' << ' '696 << setw(14) << setprecision(3) << obs .S1P << ' ' << ' '697 << setw(14) << setprecision(3) << obs .P2 << ' ' << ' '698 << setw(14) << setprecision(3) << obs .L2P << lli2 << ' '699 << setw(14) << setprecision(3) << obs .D2P << ' ' << ' '700 << setw(14) << setprecision(3) << obs .S2P << ' ' << ' '701 << setw(14) << setprecision(3) << obs .C2 << ' ' << ' '702 << setw(14) << setprecision(3) << obs .L2C << lli2 << ' '703 << setw(14) << setprecision(3) << obs .D2C << ' ' << ' '704 << setw(14) << setprecision(3) << obs .S2C << ' ' << ' '705 << setw(14) << setprecision(3) << obs .C5 << ' ' << ' '706 << setw(14) << setprecision(3) << obs .L5 << lli5 << ' '707 << setw(14) << setprecision(3) << obs .D5 << ' ' << ' '708 << setw(14) << setprecision(3) << obs .S5;709 } 710 else if (obs .satSys == 'R') { // Glonass711 str << obs .satSys712 << setw(2) << setfill('0') << obs .satNum << setfill(' ')713 << setw(14) << setprecision(3) << obs .C1 << ' ' << ' '714 << setw(14) << setprecision(3) << obs .L1C << lli1 << ' '715 << setw(14) << setprecision(3) << obs .D1C << ' ' << ' '716 << setw(14) << setprecision(3) << obs .S1C << ' ' << ' '717 << setw(14) << setprecision(3) << obs .P1 << ' ' << ' '718 << setw(14) << setprecision(3) << obs .L1P << lli1 << ' '719 << setw(14) << setprecision(3) << obs .D1P << ' ' << ' '720 << setw(14) << setprecision(3) << obs .S1P << ' ' << ' '721 << setw(14) << setprecision(3) << obs .P2 << ' ' << ' '722 << setw(14) << setprecision(3) << obs .L2P << lli2 << ' '723 << setw(14) << setprecision(3) << obs .D2P << ' ' << ' '724 << setw(14) << setprecision(3) << obs .S2P << ' ' << ' '725 << setw(14) << setprecision(3) << obs .C2 << ' ' << ' '726 << setw(14) << setprecision(3) << obs .L2C << lli2 << ' '727 << setw(14) << setprecision(3) << obs .D2C << ' ' << ' '728 << setw(14) << setprecision(3) << obs .S2C;729 } 730 else if (obs .satSys == 'S') { // SBAS731 str << obs .satSys732 << setw(2) << setfill('0') << obs .satNum << setfill(' ')733 << setw(14) << setprecision(3) << obs .C1 << ' ' << ' '734 << setw(14) << setprecision(3) << obs .L1C << lli1 << ' '735 << setw(14) << setprecision(3) << obs .D1C << ' ' << ' '736 << setw(14) << setprecision(3) << obs .S1C << ' ' << ' '737 << setw(14) << setprecision(3) << obs .P1 << ' ' << ' '738 << setw(14) << setprecision(3) << obs .L1P << lli1 << ' '739 << setw(14) << setprecision(3) << obs .D1P << ' ' << ' '740 << setw(14) << setprecision(3) << obs .S1P;741 } 742 else if (obs .satSys == 'E') { // Galileo743 str << obs .satSys744 << setw(2) << setfill('0') << obs .satNum << setfill(' ')745 << setw(14) << setprecision(3) << obs .C1 << ' ' << ' '746 << setw(14) << setprecision(3) << obs .L1C << lli1 << ' '747 << setw(14) << setprecision(3) << obs .D1C << ' ' << ' '748 << setw(14) << setprecision(3) << obs .S1C << ' ' << ' '749 << setw(14) << setprecision(3) << obs .C5 << ' ' << ' '750 << setw(14) << setprecision(3) << obs .L5 << lli5 << ' '751 << setw(14) << setprecision(3) << obs .D5 << ' ' << ' '752 << setw(14) << setprecision(3) << obs .S5;686 if (obs->satSys == 'G') { // GPS 687 str << obs->satSys 688 << setw(2) << setfill('0') << obs->satNum << setfill(' ') 689 << setw(14) << setprecision(3) << obs->C1 << ' ' << ' ' 690 << setw(14) << setprecision(3) << obs->L1C << lli1 << ' ' 691 << setw(14) << setprecision(3) << obs->D1C << ' ' << ' ' 692 << setw(14) << setprecision(3) << obs->S1C << ' ' << ' ' 693 << setw(14) << setprecision(3) << obs->P1 << ' ' << ' ' 694 << setw(14) << setprecision(3) << obs->L1P << lli1 << ' ' 695 << setw(14) << setprecision(3) << obs->D1P << ' ' << ' ' 696 << setw(14) << setprecision(3) << obs->S1P << ' ' << ' ' 697 << setw(14) << setprecision(3) << obs->P2 << ' ' << ' ' 698 << setw(14) << setprecision(3) << obs->L2P << lli2 << ' ' 699 << setw(14) << setprecision(3) << obs->D2P << ' ' << ' ' 700 << setw(14) << setprecision(3) << obs->S2P << ' ' << ' ' 701 << setw(14) << setprecision(3) << obs->C2 << ' ' << ' ' 702 << setw(14) << setprecision(3) << obs->L2C << lli2 << ' ' 703 << setw(14) << setprecision(3) << obs->D2C << ' ' << ' ' 704 << setw(14) << setprecision(3) << obs->S2C << ' ' << ' ' 705 << setw(14) << setprecision(3) << obs->C5 << ' ' << ' ' 706 << setw(14) << setprecision(3) << obs->L5 << lli5 << ' ' 707 << setw(14) << setprecision(3) << obs->D5 << ' ' << ' ' 708 << setw(14) << setprecision(3) << obs->S5; 709 } 710 else if (obs->satSys == 'R') { // Glonass 711 str << obs->satSys 712 << setw(2) << setfill('0') << obs->satNum << setfill(' ') 713 << setw(14) << setprecision(3) << obs->C1 << ' ' << ' ' 714 << setw(14) << setprecision(3) << obs->L1C << lli1 << ' ' 715 << setw(14) << setprecision(3) << obs->D1C << ' ' << ' ' 716 << setw(14) << setprecision(3) << obs->S1C << ' ' << ' ' 717 << setw(14) << setprecision(3) << obs->P1 << ' ' << ' ' 718 << setw(14) << setprecision(3) << obs->L1P << lli1 << ' ' 719 << setw(14) << setprecision(3) << obs->D1P << ' ' << ' ' 720 << setw(14) << setprecision(3) << obs->S1P << ' ' << ' ' 721 << setw(14) << setprecision(3) << obs->P2 << ' ' << ' ' 722 << setw(14) << setprecision(3) << obs->L2P << lli2 << ' ' 723 << setw(14) << setprecision(3) << obs->D2P << ' ' << ' ' 724 << setw(14) << setprecision(3) << obs->S2P << ' ' << ' ' 725 << setw(14) << setprecision(3) << obs->C2 << ' ' << ' ' 726 << setw(14) << setprecision(3) << obs->L2C << lli2 << ' ' 727 << setw(14) << setprecision(3) << obs->D2C << ' ' << ' ' 728 << setw(14) << setprecision(3) << obs->S2C; 729 } 730 else if (obs->satSys == 'S') { // SBAS 731 str << obs->satSys 732 << setw(2) << setfill('0') << obs->satNum << setfill(' ') 733 << setw(14) << setprecision(3) << obs->C1 << ' ' << ' ' 734 << setw(14) << setprecision(3) << obs->L1C << lli1 << ' ' 735 << setw(14) << setprecision(3) << obs->D1C << ' ' << ' ' 736 << setw(14) << setprecision(3) << obs->S1C << ' ' << ' ' 737 << setw(14) << setprecision(3) << obs->P1 << ' ' << ' ' 738 << setw(14) << setprecision(3) << obs->L1P << lli1 << ' ' 739 << setw(14) << setprecision(3) << obs->D1P << ' ' << ' ' 740 << setw(14) << setprecision(3) << obs->S1P; 741 } 742 else if (obs->satSys == 'E') { // Galileo 743 str << obs->satSys 744 << setw(2) << setfill('0') << obs->satNum << setfill(' ') 745 << setw(14) << setprecision(3) << obs->C1 << ' ' << ' ' 746 << setw(14) << setprecision(3) << obs->L1C << lli1 << ' ' 747 << setw(14) << setprecision(3) << obs->D1C << ' ' << ' ' 748 << setw(14) << setprecision(3) << obs->S1C << ' ' << ' ' 749 << setw(14) << setprecision(3) << obs->C5 << ' ' << ' ' 750 << setw(14) << setprecision(3) << obs->L5 << lli5 << ' ' 751 << setw(14) << setprecision(3) << obs->D5 << ' ' << ' ' 752 << setw(14) << setprecision(3) << obs->S5; 753 753 } 754 754 return str.str(); -
trunk/BNC/bncrinex.h
r2695 r2709 55 55 } 56 56 57 static std::string rinexSatLine(const t_obs Internal&obs,57 static std::string rinexSatLine(const t_obs* obs, 58 58 char lli1, char lli2, char lli5); 59 59 -
trunk/BNC/latencychecker.cpp
r2485 r2709 315 315 p_obs obs = it.next(); 316 316 317 _newSecGPS = static_cast<int>(obs-> _o.GPSWeeks);317 _newSecGPS = static_cast<int>(obs->GPSWeeks); 318 318 if (_newSecGPS != _oldSecGPS) { 319 319 if (_newSecGPS % _perfIntr < _oldSecGPS % _perfIntr) { … … 368 368 currentGPSWeeks(week, sec); 369 369 const double secPerWeek = 7.0 * 24.0 * 3600.0; 370 if (week < obs-> _o.GPSWeek) {370 if (week < obs->GPSWeek) { 371 371 week += 1; 372 372 sec -= secPerWeek; 373 373 } 374 if (week > obs-> _o.GPSWeek) {374 if (week > obs->GPSWeek) { 375 375 week -= 1; 376 376 sec += secPerWeek; 377 377 } 378 _curLat = sec - obs-> _o.GPSWeeks;378 _curLat = sec - obs->GPSWeeks; 379 379 _sumLat += _curLat; 380 380 _sumLatQ += _curLat * _curLat;
Note:
See TracChangeset
for help on using the changeset viewer.