Changeset 11192 in ntrip for trunk/BNC/src/rinex/rnxobsfile.h
- Timestamp:
- Nov 10, 2026, 12:13:23 PM (12 days ago)
- File:
-
- 1 edited
-
trunk/BNC/src/rinex/rnxobsfile.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/rnxobsfile.h
r11023 r11192 73 73 void write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const; 74 74 bncTime startTime() const {return _startTime;} 75 int rcvClkOffsAppl() const {return _rcvClkOffsAppl;} 76 int scaleFactor(char sys, const QString& type) const; 77 static QString convertRecord(const QString& line, double outVersion, double inVersion); 75 78 void setStartTime(const bncTime& startTime) {_startTime = startTime;} 76 79 … … 107 110 int _wlFactorsL2[t_prn::MAXPRN_GPS+1]; 108 111 bncTime _startTime; 112 QString _timeSystem; // TIME OF FIRST OBS system time 113 int _rcvClkOffsAppl; // RCV CLOCK OFFS APPL, -1: not given 114 char _satSystem; // RINEX VERSION / TYPE satellite system 115 QMap<char, QMap<QString, int> > _scaleFactors; // SYS / SCALE FACTOR, type "": all types 116 // Header records not interpreted (or not written) by BNC, kept verbatim 117 QStringList _otherRecords; 118 double _otherRecordsVersion; // RINEX version of _otherRecords 119 // TIME OF LAST OBS, # OF SATELLITES and PRN / # OF OBS: written if given 120 // in the input header, with the values of the written file 121 bool _hasLastObs; 122 bool _hasObsCounts; // # OF SATELLITES 123 bool _hasPrnObs; // PRN / # OF OBS 124 bncTime _lastTime; 125 QMap<QString, QVector<int> > _obsCounts; // per PRN and obs. type 109 126 bool _writeRinexOnlyWithSklObsTypes; 110 127 … … 136 153 }; 137 154 155 // Event (epoch flag 2-6) with its special records 156 class t_rnxEvent { 157 public: 158 t_rnxEvent() {flag = 0; epochValid = false; psec = -1; version = 0.0;} 159 int flag; 160 double version; // RINEX version of the input file 161 bool epochValid; // epoch fields not blank 162 bncTime tt; // incl. psec (if given) 163 int psec; 164 QStringList records; // flag 2-5: header records 165 std::vector<t_rnxSat> slips; // flag 6: cycle slip records 166 }; 167 138 168 class t_rnxEpo { 139 169 public: … … 142 172 tt.reset(); 143 173 rnxSat.clear(); 144 } 145 bncTime tt; 174 clkOffset = 0.0; 175 clkOffsetValid = false; 176 psec = -1; 177 flag = 0; 178 events.clear(); 179 } 180 bncTime tt; // incl. psec (if given) 146 181 std::vector<t_rnxSat> rnxSat; 182 double clkOffset; // receiver clock offset estimate [s] 183 bool clkOffsetValid; // clock offset given in epoch record 184 int psec; // additional pico-sec digits of the 185 // epoch (RINEX >= 4.02, 0..99999), 186 // -1: not given 187 int flag; // epoch flag 0 or 1 (power failure) 188 QList<t_rnxEvent> events; // events preceding this epoch 147 189 }; 148 190 … … 233 275 } 234 276 t_rnxEpo epoLocal; 235 epoLocal.tt = epo->tt; 277 epoLocal.tt = epo->tt; 278 epoLocal.clkOffset = epo->clkOffset; 279 epoLocal.clkOffsetValid = epo->clkOffsetValid; 280 epoLocal.psec = epo->psec; 281 epoLocal.flag = epo->flag; 236 282 for (unsigned ii = 0; ii < epo->rnxSat.size(); ii++) { 237 283 const t_rnxSat& rnxSat = epo->rnxSat[ii]; … … 248 294 std::stable_sort(epoLocal.rnxSat.begin(), epoLocal.rnxSat.end(), t_rnxSat::prnSort); 249 295 296 writeEvents(stream, header, epo->events); 250 297 if (header.version() >= 3.0) { 251 298 writeEpochV3(stream, header, &epoLocal); … … 256 303 } 257 304 305 // Write events (e.g. the ones after the last epoch, see pendingEvents()) 306 void writeEvents(const QList<t_rnxEvent>& events) { 307 writeEvents(_epoStream ? _epoStream : _stream, _header, events); 308 } 309 static void writeEvents(QTextStream* stream, const t_rnxObsHeader& header, 310 const QList<t_rnxEvent>& events); 311 312 // Events read after the last observation epoch 313 QList<t_rnxEvent> pendingEvents(); 314 315 // Output: header written on close(), with TIME OF FIRST/LAST OBS and 316 // PRN / # OF OBS of the written epochs; epochs go to a temporary file 317 void writeHeaderOnClose(const QMap<QString, QString>& txtMap); 318 258 319 private: 259 static void writeEpochV2(QTextStream* stream, const t_rnxObsHeader& header, const t_rnxEpo* epo); 260 static void writeEpochV3(QTextStream* stream, const t_rnxObsHeader& header, const t_rnxEpo* epo); 320 typedef QMap<QString, QVector<int> > t_obsCounts; 321 static void writeEpochV2(QTextStream* stream, const t_rnxObsHeader& header, const t_rnxEpo* epo, 322 t_obsCounts* obsCounts = 0); 323 static void writeEpochV3(QTextStream* stream, const t_rnxObsHeader& header, const t_rnxEpo* epo, 324 t_obsCounts* obsCounts = 0); 261 325 t_rnxObsFile() {}; 262 326 void openRead(const QString& fileName); … … 265 329 t_rnxEpo* nextEpochV2(); 266 330 t_rnxEpo* nextEpochV3(); 267 void handleEpochFlag(int flag, const QString& line, bool& headerReRead); 331 static std::vector<t_rnxSat> selectSats(const t_rnxObsHeader& header, 332 const std::vector<t_rnxSat>& rnxSats); 333 void readEvent(int flag, QString& line); 334 void readSatRecordsV3(int numSat, std::vector<t_rnxSat>& rnxSats); 335 void readSatRecordsV2(QString& line, int numSat, std::vector<t_rnxSat>& rnxSats); 336 void writeDeferredHeader(); 268 337 269 338 e_inpOut _inpOut; … … 274 343 t_rnxEpo _currEpo; 275 344 bool _flgPowerFail; 345 QList<t_rnxEvent> _pendingEvents; 346 // header written on close 347 QTemporaryFile* _epoFile; 348 QTextStream* _epoStream; 349 QMap<QString, QString> _txtMap; 350 bncTime _firstEpoTime; 351 bncTime _lastEpoTime; 352 t_obsCounts _obsCounts; 276 353 }; 277 354
Note:
See TracChangeset
for help on using the changeset viewer.
