Changeset 3571 in ntrip for branches/BNC_LM
- Timestamp:
- Dec 25, 2011, 7:27:03 PM (13 years ago)
- Location:
- branches/BNC_LM
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_LM/GPSS/hassDecoder.cpp
r3508 r3571 16 16 * -----------------------------------------------------------------------*/ 17 17 18 #include <iostream> 18 19 #include "hassDecoder.h" 19 20 #include "bnctime.h" 21 #include "bncutils.h" 20 22 21 23 using namespace std; … … 44 46 while ( (indexEOL = _buffer.indexOf('\n')) != -1) { 45 47 QByteArray line = _buffer.left(indexEOL-1); 46 _buffer = _buffer.mid(indexEOL );48 _buffer = _buffer.mid(indexEOL+1); 47 49 48 if (QString(line).split(QRegExp("\\s+") ).count() != 11) {50 if (QString(line).split(QRegExp("\\s+"), QString::SkipEmptyParts).count() != 11) { 49 51 continue; 50 52 } … … 56 58 int mjd, IOD; 57 59 double daySec; 58 double deltaX, deltaY, deltaZ, deltaClk; 59 double rateDeltaX, rateDeltaY, rateDeltaZ; 60 ColumnVector dx(3); 61 ColumnVector dxRate(3); 62 double clkFull; 63 60 64 QString prn; 61 65 62 in >> mjd >> daySec >> prn >> IOD >> d eltaX >> deltaY >> deltaZ63 >> d eltaClk >> rateDeltaX >> rateDeltaY >> rateDeltaZ;66 in >> mjd >> daySec >> prn >> IOD >> dx[0] >> dx[1] >> dx[2] >> clkFull 67 >> dxRate[0] >> dxRate[1] >> dxRate[2]; 64 68 69 // Correction Time 70 // --------------- 65 71 bncTime tt; 66 72 tt.setmjd(daySec, mjd); … … 69 75 long coTime = tt.gpsw() * 7*24*3600 + long(floor(_GPSweeks+0.5)); 70 76 77 // Transform Correction 78 // -------------------- 79 dx = -dx; 80 dxRate = -dxRate; 81 82 //// beg test 83 continue; 84 //// end test 85 //// t_eph* eph = 0; 86 //// if (_eph.contains(prn)) { 87 //// if (_eph.value(prn)->last && _eph.value(prn)->last->IOD() == IOD) { 88 //// eph = _eph.value(prn)->last; 89 //// } 90 //// else if (_eph.value(prn)->prev && _eph.value(prn)->prev->IOD() == IOD) { 91 //// eph = _eph.value(prn)->prev; 92 //// } 93 //// } 94 //// if (!eph) { 95 //// continue; 96 //// } 97 98 ColumnVector xc(4); 99 ColumnVector vv(3); 100 //// eph->position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data()); 101 102 ColumnVector rao(3); 103 XYZ_to_RSW(xc.Rows(1,3), vv, dx, rao); 104 105 ColumnVector dotRao(3); 106 XYZ_to_RSW(xc.Rows(1,3), vv, dxRate, dotRao); 107 108 double dClk = clkFull - xc[3] * t_CST::c; 109 110 // Print Correction Line 111 // --------------------- 71 112 QString corrLine; 72 113 73 int updateInterval = 74 int messageType = 0;114 int updateInterval = 0; 115 int messageType = 0; 75 116 if (prn[0] == 'G') { 76 messageType = -COTYPE_GPSCOMBINED;117 messageType = COTYPE_GPSCOMBINED; 77 118 } 78 119 else if (prn[0] == 'R') { 79 messageType = -COTYPE_GLONASSCOMBINED;120 messageType = COTYPE_GLONASSCOMBINED; 80 121 } 81 122 … … 87 128 messageType, updateInterval, tt.gpsw(), _GPSweeks, 88 129 prn.toAscii().data(), IOD, 89 deltaClk, deltaX, deltaY, deltaZ, 90 0.0, rateDeltaX, rateDeltaY, rateDeltaZ, 0.0); 91 130 dClk, rao[0], rao[1], rao[2], 131 0.0, dotRao[0], dotRao[1], dotRao[2], 0.0); 132 133 reopen(_fileNameSkl, _fileName, _out); 92 134 printLine(corrLine, coTime); 93 135 } -
branches/BNC_LM/RTCM3/ephemeris.cpp
r3280 r3571 395 395 //////////////////////////////////////////////////////////////////////////// 396 396 int t_ephGlo::IOD() const { 397 398 bool old = false; 399 400 if (old) { // 5 LSBs of iod are equal to 5 LSBs of tb 401 unsigned int tb = int(fmod(_GPSweeks,86400.0)); //sec of day 402 const int shift = sizeof(tb) * 8 - 5; 403 unsigned int iod = tb << shift; 404 return (iod >> shift); 405 } 406 else { 407 bncTime tGPS(_GPSweek, _GPSweeks); 408 int hlpWeek = _GPSweek; 409 int hlpSec = int(_GPSweeks); 410 int hlpMsec = int(_GPSweeks * 1000); 411 updatetime(&hlpWeek, &hlpSec, hlpMsec, 0); 412 bncTime tHlp(hlpWeek, hlpSec); 413 double diffSec = tGPS - tHlp; 414 bncTime tMoscow = tGPS + diffSec; 415 return int(tMoscow.daysec() / 900); 416 } 397 bncTime tGPS(_GPSweek, _GPSweeks); 398 bncTime tMoscow = tGPS - _gps_utc + 3 * 3600.0; 399 return int(tMoscow.daysec() / 900); 417 400 } 418 401 -
branches/BNC_LM/bncantex.cpp
r3295 r3571 119 119 else if (line.indexOf("END OF ANTENNA") == 60) { 120 120 if (newAntMap) { 121 if (_maps.contains(newAntMap->antName)) { 122 delete _maps[newAntMap->antName]; 123 } 121 124 _maps[newAntMap->antName] = newAntMap; 122 125 newAntMap = 0; … … 163 166 if (newFrqMap) { 164 167 if (line.indexOf("G01") == 3 || line.indexOf("R01") == 3) { 168 delete newAntMap->frqMapL1; 165 169 newAntMap->frqMapL1 = newFrqMap; 166 170 } 167 171 else if (line.indexOf("G02") == 3 || line.indexOf("R02") == 3) { 172 delete newAntMap->frqMapL2; 168 173 newAntMap->frqMapL2 = newFrqMap; 169 174 } -
branches/BNC_LM/bncapp.cpp
r3371 r3571 867 867 QByteArray fileName = settings.value("rawOutFile").toByteArray(); 868 868 if (!fileName.isEmpty()) { 869 _rawFile = new bncRawFile(fileName, staID, format,bncRawFile::output);869 _rawFile = new bncRawFile(fileName, staID, bncRawFile::output); 870 870 } 871 871 } -
branches/BNC_LM/bnccaster.cpp
r3341 r3571 127 127 _epochs = new QMultiMap<long, t_obs>; 128 128 129 _samplingRate = settings.value("binSampl").toInt(); 130 _waitTime = settings.value("waitTime").toInt(); 129 131 _lastDumpSec = 0; 130 _waitTime = 0;131 132 _confInterval = -1; 132 133 } … … 262 263 qRegisterMetaType<gpsephemeris>("gpsephemeris"); 263 264 qRegisterMetaType<glonassephemeris>("glonassephemeris"); 265 qRegisterMetaType<galileoephemeris>("galileoephemeris"); 264 266 265 267 connect(getThread, SIGNAL(newObs(QByteArray, bool, t_obs)), … … 271 273 connect(getThread, SIGNAL(newNMEAstr(QByteArray)), 272 274 this, SLOT(slotNewNMEAstr(QByteArray))); 273 274 connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),275 getThread, SLOT(slotNewEphGPS(gpsephemeris)));276 275 277 276 _staIDs.push_back(getThread->staID()); … … 314 313 for (long sec = minTime; sec <= maxTime; sec++) { 315 314 316 bool first = true;317 315 QList<t_obs> allObs = _epochs->values(sec); 318 316 … … 365 363 366 364 _epochs->remove(sec); 367 first = false;368 365 } 369 366 } -
branches/BNC_LM/bncephuser.cpp
r3508 r3571 165 165 if (!relevantMessageType(messageType)) { 166 166 return failure; 167 }168 169 if (messageType < 0) {170 xyzCorr = true; // correction in xyz instead of rao171 167 } 172 168 -
branches/BNC_LM/bncephuser.h
r3508 r3571 44 44 eph = 0; 45 45 hrClk = 0.0; 46 xyzCorr = false;47 46 } 48 47 bool ready() {return raoSet && dClkSet;} 49 48 50 49 static bool relevantMessageType(int msgType) { 51 if (msgType < 0) {52 msgType = -msgType;53 }54 50 return ( msgType == COTYPE_GPSCOMBINED || 55 51 msgType == COTYPE_GLONASSCOMBINED || … … 76 72 bool raoSet; 77 73 bool dClkSet; 78 bool xyzCorr;79 74 const t_eph* eph; 80 75 }; -
branches/BNC_LM/bncgetthread.cpp
r3509 r3571 141 141 } 142 142 else { 143 _rnx = new bncRinex(_staID, _mountPoint, _ format, _latitude,143 _rnx = new bncRinex(_staID, _mountPoint, _latitude, 144 144 _longitude, _nmea, _ntripVersion); 145 145 } … … 491 491 _rnx->deepCopy(obs); 492 492 } 493 _rnx->dumpEpoch( obsTime);493 _rnx->dumpEpoch(_format, obsTime); 494 494 } 495 495 -
branches/BNC_LM/bncmain.cpp
r3364 r3571 64 64 bool GUIenabled = true; 65 65 QByteArray rawFileName; 66 QByteArray format;67 QByteArray staID;68 66 QString confFileName; 69 67 … … 80 78 rawFileName = QByteArray(argv[ii+1]); 81 79 } 82 if (QByteArray(argv[ii]).indexOf("-format") != -1) {83 format = QByteArray(argv[ii+1]);84 }85 if (QByteArray(argv[ii]).indexOf("-mountpoint") != -1) {86 staID = QByteArray(argv[ii+1]);87 }88 80 } 89 81 } … … 95 87 QString printHelp = "Usage: bnc --nw\n" 96 88 " --conf <confFileName>\n" 97 " --file <rawFileName>\n" 98 " --mountpoint <station>\n" 99 " --format <RTCM_2 | RTCM_3>\n"; 89 " --file <rawFileName>\n"; 100 90 101 91 bncApp app(argc, argv, GUIenabled); … … 162 152 else { 163 153 app.setMode(bncApp::batchPostProcessing); 164 165 if ( format.isEmpty() || staID.isEmpty() ) { 166 cout << printHelp.toAscii().data() << endl; 167 exit(0); 168 } 169 170 bncRawFile* rawFile = new bncRawFile(rawFileName, staID, format, 171 bncRawFile::input); 172 154 bncRawFile* rawFile = new bncRawFile(rawFileName, "", 155 bncRawFile::input); 173 156 bncGetThread* getThread = new bncGetThread(rawFile); 174 157 caster->addGetThread(getThread, true); -
branches/BNC_LM/bncmodel.cpp
r3422 r3571 272 272 delete _params[iPar-1]; 273 273 } 274 for (int iPar = 1; iPar <= _params_sav.size(); iPar++) { 275 delete _params_sav[iPar-1]; 276 } 274 277 delete _epoData_sav; 275 278 } … … 477 480 bncSettings settings; 478 481 479 _time = epoData->tt; // current epoch time480 481 482 _maxSolGap = settings.value("pppMaxSolGap").toDouble(); 482 483 … … 642 643 643 644 _log.clear(); 645 646 _time = epoData->tt; // current epoch time 644 647 645 648 if (settings.value("pppSPP").toString() == "PPP") { -
branches/BNC_LM/bncnetqueryv0.cpp
r2011 r3571 28 28 bncNetQueryV0::bncNetQueryV0() { 29 29 _socket = 0; 30 _timeOut = 20000;30 _timeOut = 120000; 31 31 } 32 32 -
branches/BNC_LM/bncpppclient.cpp
r3508 r3571 399 399 //////////////////////////////////////////////////////////////////////////// 400 400 t_irc bncPPPclient::applyCorr(const bncTime& tt, const t_corr* cc, 401 ColumnVector& xc, ColumnVector& vv) { 402 ColumnVector dx(3); 401 ColumnVector& xc, ColumnVector& vv) { 403 402 404 403 double dt = tt - cc->tt; … … 409 408 } 410 409 411 if (cc->xyzCorr) { 412 dx = raoHlp; 413 } 414 else { 415 RSW_to_XYZ(xc.Rows(1,3), vv, raoHlp, dx); 416 } 417 410 ColumnVector dx(3); 411 RSW_to_XYZ(xc.Rows(1,3), vv, raoHlp, dx); 418 412 xc[0] -= dx[0]; 419 413 xc[1] -= dx[1]; -
branches/BNC_LM/bncpppclient.h
r3408 r3571 126 126 static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc, 127 127 ColumnVector& vv); 128 QByteArray staID() const {return _staID;} 128 129 129 130 public slots: -
branches/BNC_LM/bncrawfile.cpp
r3327 r3571 51 51 //////////////////////////////////////////////////////////////////////////// 52 52 bncRawFile::bncRawFile(const QByteArray& fileName, const QByteArray& staID, 53 const QByteArray& format,inpOutFlag ioFlg) {53 inpOutFlag ioFlg) { 54 54 55 55 _fileName = fileName; expandEnvVar(_fileName); 56 _format = "unset"; 56 57 _staID = staID; 57 _format = format;58 58 _inpFile = 0; 59 59 _outFile = 0; -
branches/BNC_LM/bncrawfile.h
r3004 r3571 37 37 38 38 bncRawFile(const QByteArray& fileName, const QByteArray& staID, 39 const QByteArray& format,inpOutFlag ioflg);39 inpOutFlag ioflg); 40 40 41 41 ~bncRawFile(); -
branches/BNC_LM/bncrinex.cpp
r3344 r3571 66 66 //////////////////////////////////////////////////////////////////////////// 67 67 bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint, 68 const QByteArray& format, const QByteArray& latitude, 69 const QByteArray& longitude, const QByteArray& nmea, 70 const QByteArray& ntripVersion) { 68 const QByteArray& latitude, const QByteArray& longitude, 69 const QByteArray& nmea, const QByteArray& ntripVersion) { 71 70 72 71 _statID = statID; 73 72 _mountPoint = mountPoint; 74 _format = format.left(6);75 73 _latitude = latitude; 76 74 _longitude = longitude; … … 103 101 104 102 _approxPos[0] = _approxPos[1] = _approxPos[2] = 0.0; 103 104 _samplingRate = settings.value("rnxSampl").toInt(); 105 105 } 106 106 … … 377 377 // Write RINEX Header 378 378 //////////////////////////////////////////////////////////////////////////// 379 void bncRinex::writeHeader(const Q DateTime& datTim,379 void bncRinex::writeHeader(const QByteArray& format, const QDateTime& datTim, 380 380 const QDateTime& datTimNom) { 381 381 … … 439 439 " hh mm ss.zzz0000").toAscii().data(); 440 440 _out << " GPS TIME OF FIRST OBS" << endl; 441 QString hlp = ( _format+ QString(" %1").arg(_mountPoint.host() +441 QString hlp = (format.left(6) + QString(" %1").arg(_mountPoint.host() + 442 442 _mountPoint.path())).leftJustified(60, ' ', true); 443 443 _out << hlp.toAscii().data() << "COMMENT" << endl; … … 511 511 " hh mm ss.zzz0000").toAscii().data(); 512 512 _out << " GPS TIME OF FIRST OBS" << endl; 513 QString hlp = ( _format+ QString(" %1").arg(_mountPoint.host() +513 QString hlp = (format.left(6) + QString(" %1").arg(_mountPoint.host() + 514 514 _mountPoint.path())).leftJustified(60, ' ', true); 515 515 _out << hlp.toAscii().data() << "COMMENT" << endl; … … 533 533 // Write One Epoch into the RINEX File 534 534 //////////////////////////////////////////////////////////////////////////// 535 void bncRinex::dumpEpoch( long maxTime) {535 void bncRinex::dumpEpoch(const QByteArray& format, long maxTime) { 536 536 537 537 // Select observations older than maxTime … … 570 570 // ------------------ 571 571 if (!_headerWritten) { 572 writeHeader( datTim, datTimNom);572 writeHeader(format, datTim, datTimNom); 573 573 } 574 574 -
branches/BNC_LM/bncrinex.h
r3344 r3571 26 26 #define BNCRINEX_H 27 27 28 #include <QByteArray> 29 #include <QDateTime> 30 #include <QList> 31 28 #include <QtCore> 32 29 #include <fstream> 33 30 34 31 #include "bncconst.h" 35 #include "RTCM/GPSDecoder.h" 32 33 class t_obs; 36 34 37 35 class bncRinex { 38 36 public: 39 37 bncRinex(const QByteArray& statID, const QUrl& mountPoint, 40 const QByteArray& format, const QByteArray& latitude, 41 const QByteArray& longitude, const QByteArray& nmea, 42 const QByteArray& ntripVersion); 38 const QByteArray& latitude, const QByteArray& longitude, 39 const QByteArray& nmea, const QByteArray& ntripVersion); 43 40 ~bncRinex(); 44 41 void deepCopy(t_obs obs); 45 void dumpEpoch( long maxTime);42 void dumpEpoch(const QByteArray& format, long maxTime); 46 43 void setReconnectFlag(bool flag){_reconnectFlag = flag;} 47 44 static QString nextEpochStr(const QDateTime& datTim, 48 45 const QString& intStr, 49 46 QDateTime* nextEpoch = 0); 47 48 int samplingRate() const {return _samplingRate;} 50 49 51 50 void setApproxPos(double stax, double stay, double staz) { … … 64 63 void resolveFileName(const QDateTime& datTim); 65 64 void readSkeleton(); 66 void writeHeader(const QDateTime& datTim, const QDateTime& datTimNom); 65 void writeHeader(const QByteArray& format, const QDateTime& datTim, 66 const QDateTime& datTimNom); 67 67 void closeFile(); 68 68 t_irc downloadSkeleton(); … … 80 80 QString _userName; 81 81 QString _sklName; 82 QByteArray _format;83 82 QByteArray _latitude; 84 83 QByteArray _longitude; … … 91 90 bool _reloadDone; 92 91 double _approxPos[3]; 92 int _samplingRate; 93 93 94 94 QMap<QString, int> _slip_cnt_L1; -
branches/BNC_LM/combination/bnccomb.cpp
r3503 r3571 257 257 delete _params[iPar-1]; 258 258 } 259 QVectorIterator<cmbCorr*> itCorr(corrs()); 260 while (itCorr.hasNext()) { 261 delete itCorr.next(); 259 QListIterator<bncTime> itTime(_buffer.keys()); 260 while (itTime.hasNext()) { 261 bncTime epoTime = itTime.next(); 262 _buffer.remove(epoTime); 262 263 } 263 264 } … … 355 356 while (itCorr.hasNext()) { 356 357 cmbCorr* hlp = itCorr.next(); 357 if (hlp->prn == newCorr->prn && hlp->acName == newCorr-> prn) {358 if (hlp->prn == newCorr->prn && hlp->acName == newCorr->acName) { 358 359 existingCorr = hlp; 359 360 break; … … 875 876 } 876 877 if (!foundMaster) { 878 delete corr; 877 879 it.remove(); 878 880 } … … 973 975 if (maxRes > _MAXRES) { 974 976 out << " Outlier" << endl; 977 delete corrs()[maxResIndex-1]; 975 978 corrs().remove(maxResIndex-1); 976 979 } … … 1010 1013 if (_eph.find(prn) == _eph.end()) { 1011 1014 out << "checkOrbit: missing eph (not found) " << corr->prn << endl; 1015 delete corr; 1012 1016 im.remove(); 1013 1017 } 1014 1018 else if (corr->eph == 0) { 1015 1019 out << "checkOrbit: missing eph (zero) " << corr->prn << endl; 1020 delete corr; 1016 1021 im.remove(); 1017 1022 } … … 1022 1027 else { 1023 1028 out << "checkOrbit: missing eph (deleted) " << corr->prn << endl; 1029 delete corr; 1024 1030 im.remove(); 1025 1031 } … … 1086 1092 QString prn = corr->prn; 1087 1093 if (numCorr[prn] < 2) { 1094 delete corr; 1088 1095 im.remove(); 1089 1096 } … … 1098 1105 << corr->iod << " " 1099 1106 << norm << endl; 1107 delete corr; 1100 1108 im.remove(); 1101 1109 removed = true;
Note:
See TracChangeset
for help on using the changeset viewer.