Changeset 3001 in ntrip
- Timestamp:
- Feb 22, 2011, 11:20:04 AM (14 years ago)
- Location:
- trunk/BNC/RTCM3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r2770 r3001 81 81 (bncApp*) qApp, SLOT(slotNewGalileoEph(galileoephemeris*))); 82 82 83 // Sub-Decoder for Clock and Orbit Corrections84 // -------------------------------------------85 _coDecoder = new RTCM3coDecoder(staID);86 87 83 // Mode can be either observations or corrections 88 84 // ---------------------------------------------- … … 98 94 //////////////////////////////////////////////////////////////////////////// 99 95 RTCM3Decoder::~RTCM3Decoder() { 100 delete _coDecoder; 96 QMapIterator<QByteArray, RTCM3coDecoder*> it(_coDecoders); 97 while (it.hasNext()) { 98 delete it.next(); 99 } 101 100 } 102 101 … … 109 108 bool decoded = false; 110 109 111 // If read from file, we set the mode according to staID 112 // ----------------------------------------------------- 113 if (!_staID_corrections.isEmpty() && _rawFile) { 114 if (_rawFile->staID() == _staID_corrections) { 115 _mode = corrections; 116 } 117 else { 118 _mode = observations; 119 } 120 } 110 // If read from file, mode is always uknown 111 // ---------------------------------------- 112 if (_rawFile) { 113 _mode = unknown; 114 _staID = _rawFile->staID(); 115 } 116 117 // Find the corresponding coDecoder, initialize a new one if necessary 118 // ------------------------------------------------------------------- 119 if (!_coDecoders.contains(_staID.toAscii())) { 120 _coDecoders[_staID.toAscii()] = new RTCM3coDecoder(_staID); 121 } 122 RTCM3coDecoder* coDecoder = _coDecoders[_staID.toAscii()]; 121 123 122 124 // Try to decode Clock and Orbit Corrections 123 125 // ----------------------------------------- 124 126 if (_mode == unknown || _mode == corrections) { 125 if ( _coDecoder->Decode(buffer, bufLen, errmsg) == success ) {127 if ( coDecoder->Decode(buffer, bufLen, errmsg) == success ) { 126 128 decoded = true; 127 if (_mode == unknown) { 128 if (_rawFile) { 129 _staID_corrections = _rawFile->staID(); 130 } 131 else { 132 _mode = corrections; 133 } 129 if (!_rawFile && _mode == unknown) { 130 _mode = corrections; 134 131 } 135 132 } 136 133 } 137 134 138 // Find the corresponding parser 139 // ----------------------------- 140 QByteArray staID("default"); 141 if (_rawFile) { 142 staID = _rawFile->staID(); 143 } 144 145 bool newParser = !_parsers.contains(staID); 146 147 RTCM3ParserData& parser = _parsers[staID]; 148 149 // Get Glonass Slot Numbers from Global Array 150 // ------------------------------------------ 151 bncApp* app = (bncApp*) qApp; 152 app->getGlonassSlotNums(parser.GLOFreq); 153 154 // Initialize a new parser 155 // ----------------------- 156 if (newParser) { 135 // Find the corresponding parser, initialize a new parser if necessary 136 // ------------------------------------------------------------------- 137 bool newParser = !_parsers.contains(_staID.toAscii()); 138 RTCM3ParserData& parser = _parsers[_staID.toAscii()]; 139 if (newParser) { 157 140 memset(&parser, 0, sizeof(parser)); 158 141 parser.rinex3 = 0; … … 161 144 parser.GPSTOW = int(secGPS); 162 145 } 146 147 // Get Glonass Slot Numbers from Global Array 148 // ------------------------------------------ 149 bncApp* app = (bncApp*) qApp; 150 app->getGlonassSlotNums(parser.GLOFreq); 163 151 164 152 // Remaining part decodes the Observations … … 338 326 unsigned df = (1 << iEntry); 339 327 340 //// beg test341 //// cout << prn.toAscii().data() << " "342 //// << iEntry << " " << df;343 //// if (df & gnssData.dataflags[iSat]) {344 //// cout << " present";345 //// }346 //// cout << endl;347 //// end test348 349 328 if (df & gnssData.dataflags[iSat]) { 350 329 … … 478 457 return false; 479 458 } 459 460 // Time of Corrections 461 ////////////////////////////////////////////////////////////////////////////// 462 int RTCM3Decoder::corrGPSEpochTime() const { 463 if (_mode == corrections && _coDecoders.size() > 0) { 464 return _coDecoders.begin().value()->corrGPSEpochTime(); 465 } 466 else { 467 return -1; 468 } 469 } -
trunk/BNC/RTCM3/RTCM3Decoder.h
r2770 r3001 45 45 virtual ~RTCM3Decoder(); 46 46 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg); 47 virtual int corrGPSEpochTime() const { 48 return (_mode == corrections ? _coDecoder->corrGPSEpochTime() : -1); 49 } 47 virtual int corrGPSEpochTime() const; 50 48 51 49 bool storeEph(const gpsephemeris& gpseph); … … 64 62 QString _checkMountPoint; 65 63 QMap<QByteArray, RTCM3ParserData> _parsers; 66 RTCM3coDecoder* _coDecoder;64 QMap<QByteArray, RTCM3coDecoder*> _coDecoders; 67 65 t_mode _mode; 68 66 … … 70 68 double _antXYZ[3]; 71 69 bncRawFile* _rawFile; 72 QString _staID_corrections;73 70 74 71 QMap<QString, int> _slip_cnt_L1;
Note:
See TracChangeset
for help on using the changeset viewer.