| 1 | // Part of BNC, a utility for retrieving decoding and
|
|---|
| 2 | // converting GNSS data streams from NTRIP broadcasters.
|
|---|
| 3 | //
|
|---|
| 4 | // Copyright (C) 2007
|
|---|
| 5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
|---|
| 6 | // http://www.bkg.bund.de
|
|---|
| 7 | // Czech Technical University Prague, Department of Geodesy
|
|---|
| 8 | // http://www.fsv.cvut.cz
|
|---|
| 9 | //
|
|---|
| 10 | // Email: euref-ip@bkg.bund.de
|
|---|
| 11 | //
|
|---|
| 12 | // This program is free software; you can redistribute it and/or
|
|---|
| 13 | // modify it under the terms of the GNU General Public License
|
|---|
| 14 | // as published by the Free Software Foundation, version 2.
|
|---|
| 15 | //
|
|---|
| 16 | // This program is distributed in the hope that it will be useful,
|
|---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | // GNU General Public License for more details.
|
|---|
| 20 | //
|
|---|
| 21 | // You should have received a copy of the GNU General Public License
|
|---|
| 22 | // along with this program; if not, write to the Free Software
|
|---|
| 23 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|---|
| 24 |
|
|---|
| 25 | /* -------------------------------------------------------------------------
|
|---|
| 26 | * BKG NTRIP Client
|
|---|
| 27 | * -------------------------------------------------------------------------
|
|---|
| 28 | *
|
|---|
| 29 | * Class: bncRinex
|
|---|
| 30 | *
|
|---|
| 31 | * Purpose: writes RINEX files
|
|---|
| 32 | *
|
|---|
| 33 | * Author: L. Mervart
|
|---|
| 34 | *
|
|---|
| 35 | * Created: 27-Aug-2006
|
|---|
| 36 | *
|
|---|
| 37 | * Changes:
|
|---|
| 38 | *
|
|---|
| 39 | * -----------------------------------------------------------------------*/
|
|---|
| 40 |
|
|---|
| 41 | #include <stdlib.h>
|
|---|
| 42 | #include <iostream>
|
|---|
| 43 | #include <iomanip>
|
|---|
| 44 | #include <math.h>
|
|---|
| 45 | #include <sstream>
|
|---|
| 46 |
|
|---|
| 47 | #include <QtCore>
|
|---|
| 48 | #include <QUrl>
|
|---|
| 49 | #include <QString>
|
|---|
| 50 |
|
|---|
| 51 | #include "bncrinex.h"
|
|---|
| 52 | #include "bncapp.h"
|
|---|
| 53 | #include "bncutils.h"
|
|---|
| 54 | #include "bncconst.h"
|
|---|
| 55 | #include "bnctabledlg.h"
|
|---|
| 56 | #include "bncgetthread.h"
|
|---|
| 57 | #include "bncnetqueryv1.h"
|
|---|
| 58 | #include "bncnetqueryv2.h"
|
|---|
| 59 | #include "bncsettings.h"
|
|---|
| 60 | #include "bncversion.h"
|
|---|
| 61 | #include "rtcm3torinex.h"
|
|---|
| 62 |
|
|---|
| 63 | using namespace std;
|
|---|
| 64 |
|
|---|
| 65 | // Constructor
|
|---|
| 66 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 67 | bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint,
|
|---|
| 68 | const QByteArray& latitude, const QByteArray& longitude,
|
|---|
| 69 | const QByteArray& nmea, const QByteArray& ntripVersion) {
|
|---|
| 70 |
|
|---|
| 71 | _statID = statID;
|
|---|
| 72 | _mountPoint = mountPoint;
|
|---|
| 73 | _latitude = latitude;
|
|---|
| 74 | _longitude = longitude;
|
|---|
| 75 | _nmea = nmea;
|
|---|
| 76 | _ntripVersion = ntripVersion;
|
|---|
| 77 | _headerWritten = false;
|
|---|
| 78 | _reconnectFlag = false;
|
|---|
| 79 | _reloadTable = false;
|
|---|
| 80 | _reloadDone = false;
|
|---|
| 81 |
|
|---|
| 82 | bncSettings settings;
|
|---|
| 83 | _rnxScriptName = settings.value("rnxScript").toString();
|
|---|
| 84 | expandEnvVar(_rnxScriptName);
|
|---|
| 85 |
|
|---|
| 86 | _pgmName = QString(BNCPGMNAME).leftJustified(20, ' ', true);
|
|---|
| 87 | #ifdef WIN32
|
|---|
| 88 | _userName = QString("${USERNAME}");
|
|---|
| 89 | #else
|
|---|
| 90 | _userName = QString("${USER}");
|
|---|
| 91 | #endif
|
|---|
| 92 | expandEnvVar(_userName);
|
|---|
| 93 | _userName = _userName.leftJustified(20, ' ', true);
|
|---|
| 94 |
|
|---|
| 95 | if ( Qt::CheckState(settings.value("rnxV3").toInt()) == Qt::Checked) {
|
|---|
| 96 | _rinexVers = 3;
|
|---|
| 97 | }
|
|---|
| 98 | else {
|
|---|
| 99 | _rinexVers = 2;
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 | _approxPos[0] = _approxPos[1] = _approxPos[2] = 0.0;
|
|---|
| 103 |
|
|---|
| 104 | _samplingRate = settings.value("rnxSampl").toInt();
|
|---|
| 105 |
|
|---|
| 106 | // Initialize RINEX v3 Types
|
|---|
| 107 | // -------------------------
|
|---|
| 108 | _rnxTypes['G'] << "C1C" << "C1P" << "L1C" << "L1P"
|
|---|
| 109 | << "D1C" << "D1P" << "S1C" << "S1P"
|
|---|
| 110 | << "C2X" << "C2P" << "L2X" << "L2P"
|
|---|
| 111 | << "D2X" << "D2P" << "S2X" << "S2P"
|
|---|
| 112 | << "C5" << "D5" << "L5" << "S5";
|
|---|
| 113 |
|
|---|
| 114 | _rnxTypes['R'] << "C1C" << "C1P" << "L1C" << "L1P"
|
|---|
| 115 | << "D1C" << "D1P" << "S1C" << "S1P"
|
|---|
| 116 | << "C2C" << "C2P" << "L2C" << "L2P"
|
|---|
| 117 | << "D2C" << "D2P" << "S2C" << "S2P";
|
|---|
| 118 |
|
|---|
| 119 | _rnxTypes['E'] << "C1" << "L1" << "D1" << "S1"
|
|---|
| 120 | << "C5" << "L5" << "D5" << "S5"
|
|---|
| 121 | << "C6" << "L6" << "D6" << "S6"
|
|---|
| 122 | << "C7" << "L7" << "D7" << "S7"
|
|---|
| 123 | << "C8" << "L8" << "D8" << "S8";
|
|---|
| 124 |
|
|---|
| 125 | _rnxTypes['J'] << "C1C" << "C1Z" << "L1C" << "L1Z"
|
|---|
| 126 | << "D1C" << "D1Z" << "S1C" << "S1Z"
|
|---|
| 127 | << "C2" << "L2" << "D2" << "S2"
|
|---|
| 128 | << "C5" << "L5" << "D5" << "S5"
|
|---|
| 129 | << "C6" << "D6" << "L6" << "S6";
|
|---|
| 130 |
|
|---|
| 131 | _rnxTypes['S'] << "C1C" << "C1W" << "L1C" << "L1W"
|
|---|
| 132 | << "D1C" << "D1W" << "S1C" << "S1W"
|
|---|
| 133 | << "C5" << "L5" << "D5" << "S5";
|
|---|
| 134 |
|
|---|
| 135 | _rnxTypes['C'] << "C2I" << "L2I" << "D2I" << "S2I"
|
|---|
| 136 | << "C6I" << "L6I" << "D6I" << "S6I"
|
|---|
| 137 | << "C7I" << "L7I" << "D7I" << "S7I";
|
|---|
| 138 | }
|
|---|
| 139 |
|
|---|
| 140 | // Destructor
|
|---|
| 141 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 142 | bncRinex::~bncRinex() {
|
|---|
| 143 | bncSettings settings;
|
|---|
| 144 | if ((_rinexVers == 3) && ( Qt::CheckState(settings.value("rnxAppend").toInt()) != Qt::Checked) ) {
|
|---|
| 145 | _out << "> 4 1" << endl;
|
|---|
| 146 | _out << "END OF FILE" << endl;
|
|---|
| 147 | }
|
|---|
| 148 | _out.close();
|
|---|
| 149 | }
|
|---|
| 150 |
|
|---|
| 151 | // Download Skeleton Header File
|
|---|
| 152 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 153 | t_irc bncRinex::downloadSkeleton() {
|
|---|
| 154 |
|
|---|
| 155 | t_irc irc = failure;
|
|---|
| 156 |
|
|---|
| 157 | QStringList table;
|
|---|
| 158 | bncTableDlg::getFullTable(_ntripVersion, _mountPoint.host(),
|
|---|
| 159 | _mountPoint.port(), table, _reloadTable);
|
|---|
| 160 | QString net;
|
|---|
| 161 | QStringListIterator it(table);
|
|---|
| 162 | while (it.hasNext()) {
|
|---|
| 163 | QString line = it.next();
|
|---|
| 164 | if (line.indexOf("STR") == 0) {
|
|---|
| 165 | QStringList tags = line.split(";");
|
|---|
| 166 | if (tags.size() > 7) {
|
|---|
| 167 | if (tags.at(1) == _mountPoint.path().mid(1).toAscii()) {
|
|---|
| 168 | net = tags.at(7);
|
|---|
| 169 | break;
|
|---|
| 170 | }
|
|---|
| 171 | }
|
|---|
| 172 | }
|
|---|
| 173 | }
|
|---|
| 174 | QString sklDir;
|
|---|
| 175 | if (!net.isEmpty()) {
|
|---|
| 176 | it.toFront();
|
|---|
| 177 | while (it.hasNext()) {
|
|---|
| 178 | QString line = it.next();
|
|---|
| 179 | if (line.indexOf("NET") == 0) {
|
|---|
| 180 | QStringList tags = line.split(";");
|
|---|
| 181 | if (tags.size() > 6) {
|
|---|
| 182 | if (tags.at(1) == net) {
|
|---|
| 183 | sklDir = tags.at(6).trimmed();
|
|---|
| 184 | break;
|
|---|
| 185 | }
|
|---|
| 186 | }
|
|---|
| 187 | }
|
|---|
| 188 | }
|
|---|
| 189 | }
|
|---|
| 190 | if (!sklDir.isEmpty() && sklDir != "none") {
|
|---|
| 191 | QUrl url(sklDir + "/" + _mountPoint.path().mid(1,4).toLower() + ".skl");
|
|---|
| 192 | if (url.port() == -1) {
|
|---|
| 193 | url.setPort(80);
|
|---|
| 194 | }
|
|---|
| 195 |
|
|---|
| 196 | bncNetQuery* query;
|
|---|
| 197 | if (_ntripVersion == "2s") {
|
|---|
| 198 | query = new bncNetQueryV2(true);
|
|---|
| 199 | }
|
|---|
| 200 | else if (_ntripVersion == "2") {
|
|---|
| 201 | query = new bncNetQueryV2(false);
|
|---|
| 202 | }
|
|---|
| 203 | else {
|
|---|
| 204 | query = new bncNetQueryV1;
|
|---|
| 205 | }
|
|---|
| 206 |
|
|---|
| 207 | QByteArray outData;
|
|---|
| 208 | query->waitForRequestResult(url, outData);
|
|---|
| 209 | if (query->status() == bncNetQuery::finished) {
|
|---|
| 210 | _headerLines.clear();
|
|---|
| 211 | bool firstLineRead = false;
|
|---|
| 212 | QTextStream in(outData);
|
|---|
| 213 | QString line = in.readLine();
|
|---|
| 214 | while ( !line.isNull() ) {
|
|---|
| 215 | if (line.indexOf("MARKER NAME") != -1) {
|
|---|
| 216 | irc = success;
|
|---|
| 217 | }
|
|---|
| 218 | if (line.indexOf("RINEX VERSION") != -1) {
|
|---|
| 219 | if (_rinexVers == 3) {
|
|---|
| 220 | _headerLines.append(" 3.00 OBSERVATION DATA"
|
|---|
| 221 | " M (MIXED)"
|
|---|
| 222 | " RINEX VERSION / TYPE");
|
|---|
| 223 | }
|
|---|
| 224 | else {
|
|---|
| 225 | _headerLines.append(" 2.11 OBSERVATION DATA"
|
|---|
| 226 | " M (MIXED)"
|
|---|
| 227 | " RINEX VERSION / TYPE");
|
|---|
| 228 | }
|
|---|
| 229 | _headerLines.append("PGM / RUN BY / DATE");
|
|---|
| 230 | firstLineRead = true;
|
|---|
| 231 | }
|
|---|
| 232 | else if (firstLineRead) {
|
|---|
| 233 | if (line.indexOf("END OF HEADER") != -1) {
|
|---|
| 234 | _headerLines.append("# / TYPES OF OBSERV");
|
|---|
| 235 | if (_rinexVers == 2) {
|
|---|
| 236 | _headerLines.append(
|
|---|
| 237 | QString(" 1 1").leftJustified(60, ' ', true) +
|
|---|
| 238 | "WAVELENGTH FACT L1/2");
|
|---|
| 239 | }
|
|---|
| 240 | _headerLines.append("TIME OF FIRST OBS");
|
|---|
| 241 | _headerLines.append( line );
|
|---|
| 242 | break;
|
|---|
| 243 | }
|
|---|
| 244 | else {
|
|---|
| 245 | _headerLines.append( line );
|
|---|
| 246 | }
|
|---|
| 247 | }
|
|---|
| 248 | line = in.readLine();
|
|---|
| 249 | }
|
|---|
| 250 | }
|
|---|
| 251 | else {
|
|---|
| 252 | delete query;
|
|---|
| 253 | return failure;
|
|---|
| 254 | }
|
|---|
| 255 | delete query;
|
|---|
| 256 | }
|
|---|
| 257 |
|
|---|
| 258 | return irc;
|
|---|
| 259 | }
|
|---|
| 260 |
|
|---|
| 261 | // Read Skeleton Header File
|
|---|
| 262 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 263 | void bncRinex::readSkeleton() {
|
|---|
| 264 |
|
|---|
| 265 | // Read the local file
|
|---|
| 266 | // -------------------
|
|---|
| 267 | QFile skl(_sklName);
|
|---|
| 268 | if ( skl.exists() && skl.open(QIODevice::ReadOnly) ) {
|
|---|
| 269 | _headerLines.clear();
|
|---|
| 270 | QTextStream in(&skl);
|
|---|
| 271 | while ( !in.atEnd() ) {
|
|---|
| 272 | _headerLines.append( in.readLine() );
|
|---|
| 273 | if (_headerLines.last().indexOf("END OF HEADER") != -1) {
|
|---|
| 274 | break;
|
|---|
| 275 | }
|
|---|
| 276 | }
|
|---|
| 277 | }
|
|---|
| 278 |
|
|---|
| 279 | // Read downloaded file
|
|---|
| 280 | // --------------------
|
|---|
| 281 | else if ( _ntripVersion != "N" && _ntripVersion != "UN" &&
|
|---|
| 282 | _ntripVersion != "S" ) {
|
|---|
| 283 | QDate currDate = currentDateAndTimeGPS().date();
|
|---|
| 284 | if ( !_skeletonDate.isValid() || _skeletonDate != currDate ) {
|
|---|
| 285 | if ( downloadSkeleton() == success) {
|
|---|
| 286 | _skeletonDate = currDate;
|
|---|
| 287 | _reloadDone = false;
|
|---|
| 288 | }
|
|---|
| 289 | else {
|
|---|
| 290 | if(!_reloadDone) {
|
|---|
| 291 | _reloadTable = true;
|
|---|
| 292 | if ( downloadSkeleton() == success) {
|
|---|
| 293 | _skeletonDate = currDate;
|
|---|
| 294 | }
|
|---|
| 295 | _reloadTable = false;
|
|---|
| 296 | _reloadDone = true;
|
|---|
| 297 | }
|
|---|
| 298 | }
|
|---|
| 299 | }
|
|---|
| 300 | }
|
|---|
| 301 | }
|
|---|
| 302 |
|
|---|
| 303 | // Next File Epoch (static)
|
|---|
| 304 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 305 | QString bncRinex::nextEpochStr(const QDateTime& datTim,
|
|---|
| 306 | const QString& intStr, QDateTime* nextEpoch) {
|
|---|
| 307 |
|
|---|
| 308 | QString epoStr;
|
|---|
| 309 |
|
|---|
| 310 | QTime nextTime;
|
|---|
| 311 | QDate nextDate;
|
|---|
| 312 |
|
|---|
| 313 | int indHlp = intStr.indexOf("min");
|
|---|
| 314 |
|
|---|
| 315 | if ( indHlp != -1) {
|
|---|
| 316 | int step = intStr.left(indHlp-1).toInt();
|
|---|
| 317 | char ch = 'A' + datTim.time().hour();
|
|---|
| 318 | epoStr = ch;
|
|---|
| 319 | if (datTim.time().minute() >= 60-step) {
|
|---|
| 320 | epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
|
|---|
| 321 | if (datTim.time().hour() < 23) {
|
|---|
| 322 | nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
|
|---|
| 323 | nextDate = datTim.date();
|
|---|
| 324 | }
|
|---|
| 325 | else {
|
|---|
| 326 | nextTime.setHMS(0, 0, 0);
|
|---|
| 327 | nextDate = datTim.date().addDays(1);
|
|---|
| 328 | }
|
|---|
| 329 | }
|
|---|
| 330 | else {
|
|---|
| 331 | for (int limit = step; limit <= 60-step; limit += step) {
|
|---|
| 332 | if (datTim.time().minute() < limit) {
|
|---|
| 333 | epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
|
|---|
| 334 | nextTime.setHMS(datTim.time().hour(), limit, 0);
|
|---|
| 335 | nextDate = datTim.date();
|
|---|
| 336 | break;
|
|---|
| 337 | }
|
|---|
| 338 | }
|
|---|
| 339 | }
|
|---|
| 340 | }
|
|---|
| 341 | else if (intStr == "1 hour") {
|
|---|
| 342 | char ch = 'A' + datTim.time().hour();
|
|---|
| 343 | epoStr = ch;
|
|---|
| 344 | if (datTim.time().hour() < 23) {
|
|---|
| 345 | nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
|
|---|
| 346 | nextDate = datTim.date();
|
|---|
| 347 | }
|
|---|
| 348 | else {
|
|---|
| 349 | nextTime.setHMS(0, 0, 0);
|
|---|
| 350 | nextDate = datTim.date().addDays(1);
|
|---|
| 351 | }
|
|---|
| 352 | }
|
|---|
| 353 | else {
|
|---|
| 354 | epoStr = "0";
|
|---|
| 355 | nextTime.setHMS(0, 0, 0);
|
|---|
| 356 | nextDate = datTim.date().addDays(1);
|
|---|
| 357 | }
|
|---|
| 358 |
|
|---|
| 359 | if (nextEpoch) {
|
|---|
| 360 | *nextEpoch = QDateTime(nextDate, nextTime);
|
|---|
| 361 | }
|
|---|
| 362 |
|
|---|
| 363 | return epoStr;
|
|---|
| 364 | }
|
|---|
| 365 |
|
|---|
| 366 | // File Name according to RINEX Standards
|
|---|
| 367 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 368 | void bncRinex::resolveFileName(const QDateTime& datTim) {
|
|---|
| 369 |
|
|---|
| 370 | bncSettings settings;
|
|---|
| 371 | QString path = settings.value("rnxPath").toString();
|
|---|
| 372 | expandEnvVar(path);
|
|---|
| 373 |
|
|---|
| 374 | if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
|
|---|
| 375 | path += QDir::separator();
|
|---|
| 376 | }
|
|---|
| 377 |
|
|---|
| 378 | QString hlpStr = nextEpochStr(datTim, settings.value("rnxIntr").toString(),
|
|---|
| 379 | &_nextCloseEpoch);
|
|---|
| 380 |
|
|---|
| 381 | QString ID4 = _statID.left(4);
|
|---|
| 382 |
|
|---|
| 383 | // Check name conflict
|
|---|
| 384 | // -------------------
|
|---|
| 385 | QString distStr;
|
|---|
| 386 | int num = 0;
|
|---|
| 387 | QListIterator<QString> it(settings.value("mountPoints").toStringList());
|
|---|
| 388 | while (it.hasNext()) {
|
|---|
| 389 | QString mp = it.next();
|
|---|
| 390 | if (mp.indexOf(ID4) != -1) {
|
|---|
| 391 | ++num;
|
|---|
| 392 | }
|
|---|
| 393 | }
|
|---|
| 394 | if (num > 1) {
|
|---|
| 395 | distStr = "_" + _statID.mid(4);
|
|---|
| 396 | }
|
|---|
| 397 |
|
|---|
| 398 | QString sklExt = settings.value("rnxSkel").toString();
|
|---|
| 399 | if (!sklExt.isEmpty()) {
|
|---|
| 400 | _sklName = path + ID4 + distStr + "." + sklExt;
|
|---|
| 401 | }
|
|---|
| 402 |
|
|---|
| 403 | path += ID4 +
|
|---|
| 404 | QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
|
|---|
| 405 | hlpStr + distStr + datTim.toString(".yyO");
|
|---|
| 406 |
|
|---|
| 407 | _fName = path.toAscii();
|
|---|
| 408 | }
|
|---|
| 409 |
|
|---|
| 410 | // Write RINEX Header
|
|---|
| 411 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 412 | void bncRinex::writeHeader(const QByteArray& format, const QDateTime& datTim,
|
|---|
| 413 | const QDateTime& datTimNom) {
|
|---|
| 414 |
|
|---|
| 415 | bncSettings settings;
|
|---|
| 416 |
|
|---|
| 417 | // Open the Output File
|
|---|
| 418 | // --------------------
|
|---|
| 419 | resolveFileName(datTimNom);
|
|---|
| 420 |
|
|---|
| 421 | // Append to existing file and return
|
|---|
| 422 | // ----------------------------------
|
|---|
| 423 | if ( QFile::exists(_fName) ) {
|
|---|
| 424 | if (_reconnectFlag ||
|
|---|
| 425 | Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
|
|---|
| 426 | _out.open(_fName.data(), ios::app);
|
|---|
| 427 | _out.setf(ios::showpoint | ios::fixed);
|
|---|
| 428 | _headerWritten = true;
|
|---|
| 429 | _reconnectFlag = false;
|
|---|
| 430 | return;
|
|---|
| 431 | }
|
|---|
| 432 | }
|
|---|
| 433 |
|
|---|
| 434 | _out.open(_fName.data());
|
|---|
| 435 | _out.setf(ios::showpoint | ios::fixed);
|
|---|
| 436 |
|
|---|
| 437 | // Copy Skeleton Header
|
|---|
| 438 | // --------------------
|
|---|
| 439 | readSkeleton();
|
|---|
| 440 | if (_headerLines.size() > 0) {
|
|---|
| 441 | bool typesOfObservationsWritten = false;
|
|---|
| 442 | QStringListIterator it(_headerLines);
|
|---|
| 443 | while (it.hasNext()) {
|
|---|
| 444 | QString line = it.next();
|
|---|
| 445 | if (line.indexOf("PGM / RUN BY / DATE") != -1) {
|
|---|
| 446 | if (_rinexVers == 3) {
|
|---|
| 447 | QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
|
|---|
| 448 | _out << _pgmName.toAscii().data() << _userName.toAscii().data()
|
|---|
| 449 | << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
|
|---|
| 450 | }
|
|---|
| 451 | else {
|
|---|
| 452 | QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
|
|---|
| 453 | _out << _pgmName.toAscii().data() << _userName.toAscii().data()
|
|---|
| 454 | << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
|
|---|
| 455 | }
|
|---|
| 456 | }
|
|---|
| 457 | else if ( !typesOfObservationsWritten &&
|
|---|
| 458 | (line.indexOf("# / TYPES OF OBSERV") != -1 ||
|
|---|
| 459 | line.indexOf("SYS / # / OBS TYPES") != -1) ) {
|
|---|
| 460 | typesOfObservationsWritten = true;
|
|---|
| 461 | if (_rinexVers == 3) {
|
|---|
| 462 | _out << "G 20 C1C L1C D1C S1C C1W L1W D1W S1W C2P L2P D2P S2P C2X SYS / # / OBS TYPES" << endl;
|
|---|
| 463 | _out << " L2X D2X S2X C5 L5 D5 S5 SYS / # / OBS TYPES" << endl;
|
|---|
| 464 | _out << "R 16 C1C L1C D1C S1C C1P L1P D1P S1P C2P L2P D2P S2P C2C SYS / # / OBS TYPES" << endl;
|
|---|
| 465 | _out << " L2C D2C S2C SYS / # / OBS TYPES" << endl;
|
|---|
| 466 | _out << "S 8 C1C L1C D1C S1C C1W L1W D1W S1W SYS / # / OBS TYPES" << endl;
|
|---|
| 467 | _out << "E 8 C1 L1 D1 S1 C5 L5 D5 S5 SYS / # / OBS TYPES" << endl;
|
|---|
| 468 | _out << "J 16 C1C L1C D1C S1C C1X L1X D1X S1X C2X L2X D2X S2X C5 SYS / # / OBS TYPES" << endl;
|
|---|
| 469 | _out << " L5 D5 S5 SYS / # / OBS TYPES" << endl;
|
|---|
| 470 | _out << "C 4 C2I L2I D2I S2I SYS / # / OBS TYPES" << endl;
|
|---|
| 471 | }
|
|---|
| 472 | else {
|
|---|
| 473 | _out << " 8 C1 P1 L1 S1 C2 P2 L2 S2"
|
|---|
| 474 | " # / TYPES OF OBSERV" << endl;
|
|---|
| 475 | }
|
|---|
| 476 | }
|
|---|
| 477 | else if (line.indexOf("TIME OF FIRST OBS") != -1) {
|
|---|
| 478 | _out << datTim.toString(" yyyy MM dd"
|
|---|
| 479 | " hh mm ss.zzz0000").toAscii().data();
|
|---|
| 480 | _out << " GPS TIME OF FIRST OBS" << endl;
|
|---|
| 481 | QString hlp = (format.left(6) + QString(" %1").arg(_mountPoint.host() +
|
|---|
| 482 | _mountPoint.path())).leftJustified(60, ' ', true);
|
|---|
| 483 | _out << hlp.toAscii().data() << "COMMENT" << endl;
|
|---|
| 484 | }
|
|---|
| 485 | else if (line.indexOf("MARKER NAME") != -1) {
|
|---|
| 486 | if (_rinexVers == 3) {
|
|---|
| 487 | _out << line.toAscii().data() << endl;
|
|---|
| 488 | _out << setw(71) << "GEODETIC MARKER TYPE" << endl;
|
|---|
| 489 | }
|
|---|
| 490 | else {
|
|---|
| 491 | _out << line.toAscii().data() << endl;
|
|---|
| 492 | }
|
|---|
| 493 | }
|
|---|
| 494 | else {
|
|---|
| 495 | _out << line.toAscii().data() << endl;
|
|---|
| 496 | }
|
|---|
| 497 | }
|
|---|
| 498 | }
|
|---|
| 499 |
|
|---|
| 500 | // Write Dummy Header
|
|---|
| 501 | // ------------------
|
|---|
| 502 | else {
|
|---|
| 503 | double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0;
|
|---|
| 504 |
|
|---|
| 505 | if (_rinexVers == 3) {
|
|---|
| 506 | _out << " 3.00 OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE" << endl;
|
|---|
| 507 | QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
|
|---|
| 508 | _out << _pgmName.toAscii().data() << _userName.toAscii().data()
|
|---|
| 509 | << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
|
|---|
| 510 | }
|
|---|
| 511 | else {
|
|---|
| 512 | _out << " 2.11 OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE" << endl;
|
|---|
| 513 | QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
|
|---|
| 514 | _out << _pgmName.toAscii().data() << _userName.toAscii().data()
|
|---|
| 515 | << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
|
|---|
| 516 | }
|
|---|
| 517 | _out.setf(ios::left);
|
|---|
| 518 | _out << setw(60) << _statID.data() << "MARKER NAME" << endl;
|
|---|
| 519 | if (_rinexVers == 3) {
|
|---|
| 520 | _out << setw(60) << "unknown" << "MARKER TYPE " << endl;
|
|---|
| 521 | }
|
|---|
| 522 | _out << setw(60) << "unknown unknown" << "OBSERVER / AGENCY" << endl;
|
|---|
| 523 | _out << setw(20) << "unknown"
|
|---|
| 524 | << setw(20) << "unknown"
|
|---|
| 525 | << setw(20) << "unknown" << "REC # / TYPE / VERS" << endl;
|
|---|
| 526 | _out << setw(20) << "unknown"
|
|---|
| 527 | << setw(20) << "unknown"
|
|---|
| 528 | << setw(20) << " " << "ANT # / TYPE" << endl;
|
|---|
| 529 | _out.unsetf(ios::left);
|
|---|
| 530 | _out << setw(14) << setprecision(4) << _approxPos[0]
|
|---|
| 531 | << setw(14) << setprecision(4) << _approxPos[1]
|
|---|
| 532 | << setw(14) << setprecision(4) << _approxPos[2]
|
|---|
| 533 | << " " << "APPROX POSITION XYZ" << endl;
|
|---|
| 534 | _out << setw(14) << setprecision(4) << antennaNEU[0]
|
|---|
| 535 | << setw(14) << setprecision(4) << antennaNEU[1]
|
|---|
| 536 | << setw(14) << setprecision(4) << antennaNEU[2]
|
|---|
| 537 | << " " << "ANTENNA: DELTA H/E/N" << endl;
|
|---|
| 538 | if (_rinexVers == 3) {
|
|---|
| 539 | QMapIterator<char, QVector<QString> > it(_rnxTypes);
|
|---|
| 540 | while (it.hasNext()) {
|
|---|
| 541 | it.next();
|
|---|
| 542 | char sys = it.key();
|
|---|
| 543 | const QVector<QString>& types = it.value();
|
|---|
| 544 | QString hlp;
|
|---|
| 545 | QTextStream(&hlp) << QString("%1 %2").arg(sys).arg(types.size(), 3);
|
|---|
| 546 | for (int ii = 0; ii < types.size(); ii++) {
|
|---|
| 547 | QTextStream(&hlp) << QString(" %1").arg(types[ii], -3);
|
|---|
| 548 | if ((ii+1) % 13 == 0 || ii == types.size()-1) {
|
|---|
| 549 | _out << QString(hlp.leftJustified(60) + "SYS / # / OBS TYPES\n").toAscii().data();
|
|---|
| 550 | hlp = QString().leftJustified(6);
|
|---|
| 551 | }
|
|---|
| 552 | }
|
|---|
| 553 | }
|
|---|
| 554 | }
|
|---|
| 555 | else {
|
|---|
| 556 | _out << " 1 1 WAVELENGTH FACT L1/2" << endl;
|
|---|
| 557 | _out << " 8 C1 P1 L1 S1 C2 P2 L2 S2 # / TYPES OF OBSERV" << endl;
|
|---|
| 558 | }
|
|---|
| 559 | _out << datTim.toString(" yyyy MM dd"
|
|---|
| 560 | " hh mm ss.zzz0000").toAscii().data();
|
|---|
| 561 | _out << " GPS TIME OF FIRST OBS" << endl;
|
|---|
| 562 | QString hlp = (format.left(6) + QString(" %1").arg(_mountPoint.host() +
|
|---|
| 563 | _mountPoint.path())).leftJustified(60, ' ', true);
|
|---|
| 564 | _out << hlp.toAscii().data() << "COMMENT" << endl;
|
|---|
| 565 |
|
|---|
| 566 | if (_nmea == "yes") {
|
|---|
| 567 | hlp = ("NMEA LAT=" + _latitude + " " + "LONG=" + _longitude).leftJustified(60, ' ',true);
|
|---|
| 568 | _out << hlp.toAscii().data() << "COMMENT" << endl; }
|
|---|
| 569 |
|
|---|
| 570 | _out << " END OF HEADER" << endl;
|
|---|
| 571 | }
|
|---|
| 572 |
|
|---|
| 573 | _headerWritten = true;
|
|---|
| 574 | }
|
|---|
| 575 |
|
|---|
| 576 | // Stores Observation into Internal Array
|
|---|
| 577 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 578 | void bncRinex::deepCopy(t_obs obs) {
|
|---|
| 579 | _obs.push_back(obs);
|
|---|
| 580 | }
|
|---|
| 581 |
|
|---|
| 582 | // Write One Epoch into the RINEX File
|
|---|
| 583 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 584 | void bncRinex::dumpEpoch(const QByteArray& format, long maxTime) {
|
|---|
| 585 |
|
|---|
| 586 | // Select observations older than maxTime
|
|---|
| 587 | // --------------------------------------
|
|---|
| 588 | QList<t_obs> dumpList;
|
|---|
| 589 | QMutableListIterator<t_obs> mIt(_obs);
|
|---|
| 590 | while (mIt.hasNext()) {
|
|---|
| 591 | t_obs obs = mIt.next();
|
|---|
| 592 | if (obs.GPSWeek * 7*24*3600 + obs.GPSWeeks < maxTime - 0.05) {
|
|---|
| 593 | dumpList.push_back(obs);
|
|---|
| 594 | mIt.remove();
|
|---|
| 595 | }
|
|---|
| 596 | }
|
|---|
| 597 |
|
|---|
| 598 | // Easy Return
|
|---|
| 599 | // -----------
|
|---|
| 600 | if (dumpList.isEmpty()) {
|
|---|
| 601 | return;
|
|---|
| 602 | }
|
|---|
| 603 |
|
|---|
| 604 | // Time of Epoch
|
|---|
| 605 | // -------------
|
|---|
| 606 | const t_obs& fObs = dumpList.first();
|
|---|
| 607 | QDateTime datTim = dateAndTimeFromGPSweek(fObs.GPSWeek, fObs.GPSWeeks);
|
|---|
| 608 | QDateTime datTimNom = dateAndTimeFromGPSweek(fObs.GPSWeek,
|
|---|
| 609 | floor(fObs.GPSWeeks+0.5));
|
|---|
| 610 |
|
|---|
| 611 | // Close the file
|
|---|
| 612 | // --------------
|
|---|
| 613 | if (_nextCloseEpoch.isValid() && datTimNom >= _nextCloseEpoch) {
|
|---|
| 614 | closeFile();
|
|---|
| 615 | _headerWritten = false;
|
|---|
| 616 | }
|
|---|
| 617 |
|
|---|
| 618 | // Write RINEX Header
|
|---|
| 619 | // ------------------
|
|---|
| 620 | if (!_headerWritten) {
|
|---|
| 621 | writeHeader(format, datTim, datTimNom);
|
|---|
| 622 | }
|
|---|
| 623 |
|
|---|
| 624 | double sec = double(datTim.time().second()) + fmod(fObs.GPSWeeks,1.0);
|
|---|
| 625 |
|
|---|
| 626 | // Epoch header line: RINEX Version 3
|
|---|
| 627 | // ----------------------------------
|
|---|
| 628 | if (_rinexVers == 3) {
|
|---|
| 629 | _out << datTim.toString("> yyyy MM dd hh mm ").toAscii().data()
|
|---|
| 630 | << setw(10) << setprecision(7) << sec
|
|---|
| 631 | << " " << 0 << setw(3) << dumpList.size() << endl;
|
|---|
| 632 | }
|
|---|
| 633 | // Epoch header line: RINEX Version 2
|
|---|
| 634 | // ----------------------------------
|
|---|
| 635 | else {
|
|---|
| 636 | _out << datTim.toString(" yy MM dd hh mm ").toAscii().data()
|
|---|
| 637 | << setw(10) << setprecision(7) << sec
|
|---|
| 638 | << " " << 0 << setw(3) << dumpList.size();
|
|---|
| 639 |
|
|---|
| 640 | QListIterator<t_obs> it(dumpList); int iSat = 0;
|
|---|
| 641 | while (it.hasNext()) {
|
|---|
| 642 | iSat++;
|
|---|
| 643 | const t_obs& obs = it.next();
|
|---|
| 644 | _out << obs.satSys << setw(2) << obs.satNum;
|
|---|
| 645 | if (iSat == 12 && it.hasNext()) {
|
|---|
| 646 | _out << endl << " ";
|
|---|
| 647 | iSat = 0;
|
|---|
| 648 | }
|
|---|
| 649 | }
|
|---|
| 650 | _out << endl;
|
|---|
| 651 | }
|
|---|
| 652 |
|
|---|
| 653 | QListIterator<t_obs> it(dumpList);
|
|---|
| 654 | while (it.hasNext()) {
|
|---|
| 655 | const t_obs& obs = it.next();
|
|---|
| 656 |
|
|---|
| 657 | // Cycle slips detection
|
|---|
| 658 | // ---------------------
|
|---|
| 659 | QString prn = QString("%1%2").arg(obs.satSys)
|
|---|
| 660 | .arg(obs.satNum, 2, 10, QChar('0'));
|
|---|
| 661 |
|
|---|
| 662 | char lli1 = ' ';
|
|---|
| 663 | char lli2 = ' ';
|
|---|
| 664 | char lli5 = ' ';
|
|---|
| 665 | if ( obs.slip_cnt_L1 >= 0 ) {
|
|---|
| 666 | if ( _slip_cnt_L1.find(prn) != _slip_cnt_L1.end() &&
|
|---|
| 667 | _slip_cnt_L1.find(prn).value() != obs.slip_cnt_L1 ) {
|
|---|
| 668 | lli1 = '1';
|
|---|
| 669 | }
|
|---|
| 670 | }
|
|---|
| 671 |
|
|---|
| 672 | if ( obs.slip_cnt_L2 >= 0 ) {
|
|---|
| 673 | if ( _slip_cnt_L2.find(prn) != _slip_cnt_L2.end() &&
|
|---|
| 674 | _slip_cnt_L2.find(prn).value() != obs.slip_cnt_L2 ) {
|
|---|
| 675 | lli2 = '1';
|
|---|
| 676 | }
|
|---|
| 677 | }
|
|---|
| 678 |
|
|---|
| 679 | if ( obs.slip_cnt_L5 >= 0 ) {
|
|---|
| 680 | if ( _slip_cnt_L5.find(prn) != _slip_cnt_L5.end() &&
|
|---|
| 681 | _slip_cnt_L5.find(prn).value() != obs.slip_cnt_L5 ) {
|
|---|
| 682 | lli5 = '1';
|
|---|
| 683 | }
|
|---|
| 684 | }
|
|---|
| 685 |
|
|---|
| 686 | _slip_cnt_L1[prn] = obs.slip_cnt_L1;
|
|---|
| 687 | _slip_cnt_L2[prn] = obs.slip_cnt_L2;
|
|---|
| 688 | _slip_cnt_L5[prn] = obs.slip_cnt_L5;
|
|---|
| 689 |
|
|---|
| 690 | // RINEX Version 3
|
|---|
| 691 | // ---------------
|
|---|
| 692 | if (_rinexVers == 3) {
|
|---|
| 693 | _out << rinexSatLine(obs, lli1, lli2, lli5);
|
|---|
| 694 | _out << endl;
|
|---|
| 695 | }
|
|---|
| 696 |
|
|---|
| 697 | // RINEX Version 2
|
|---|
| 698 | // ---------------
|
|---|
| 699 | else {
|
|---|
| 700 | _out << setw(14) << setprecision(3) << obs.measdata("C1", _rinexVers) << ' ' << ' '
|
|---|
| 701 | << setw(14) << setprecision(3) << obs.measdata("P1", _rinexVers) << ' ' << ' '
|
|---|
| 702 | << setw(14) << setprecision(3) << obs.measdata("L1", _rinexVers) << lli1 << ' '
|
|---|
| 703 | << setw(14) << setprecision(3) << obs.measdata("S1", _rinexVers) << ' ' << ' '
|
|---|
| 704 | << setw(14) << setprecision(3) << obs.measdata("C2", _rinexVers) << ' ' << ' ' << endl
|
|---|
| 705 | << setw(14) << setprecision(3) << obs.measdata("P2", _rinexVers) << ' ' << ' '
|
|---|
| 706 | << setw(14) << setprecision(3) << obs.measdata("L2", _rinexVers) << lli2 << ' '
|
|---|
| 707 | << setw(14) << setprecision(3) << obs.measdata("S2", _rinexVers) << endl;
|
|---|
| 708 | }
|
|---|
| 709 | }
|
|---|
| 710 |
|
|---|
| 711 | _out.flush();
|
|---|
| 712 | }
|
|---|
| 713 |
|
|---|
| 714 | // Close the Old RINEX File
|
|---|
| 715 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 716 | void bncRinex::closeFile() {
|
|---|
| 717 | if (_rinexVers == 3) {
|
|---|
| 718 | _out << "> 4 1" << endl;
|
|---|
| 719 | _out << "END OF FILE" << endl;
|
|---|
| 720 | }
|
|---|
| 721 | _out.close();
|
|---|
| 722 | if (!_rnxScriptName.isEmpty()) {
|
|---|
| 723 | qApp->thread()->wait(100);
|
|---|
| 724 | #ifdef WIN32
|
|---|
| 725 | QProcess::startDetached(_rnxScriptName, QStringList() << _fName) ;
|
|---|
| 726 | #else
|
|---|
| 727 | QProcess::startDetached("nohup", QStringList() << _rnxScriptName << _fName) ;
|
|---|
| 728 | #endif
|
|---|
| 729 |
|
|---|
| 730 | }
|
|---|
| 731 | }
|
|---|
| 732 |
|
|---|
| 733 | // One Line in RINEX v3
|
|---|
| 734 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 735 | string bncRinex::rinexSatLine(const t_obs& obs, char lli1, char lli2,
|
|---|
| 736 | char lli5) {
|
|---|
| 737 | ostringstream str;
|
|---|
| 738 | str.setf(ios::showpoint | ios::fixed);
|
|---|
| 739 |
|
|---|
| 740 | str << obs.satSys
|
|---|
| 741 | << setw(2) << setfill('0') << obs.satNum << setfill(' ');
|
|---|
| 742 |
|
|---|
| 743 | const QVector<QString>& types = _rnxTypes[obs.satSys];
|
|---|
| 744 | for (int ii = 0; ii < types.size(); ii++) {
|
|---|
| 745 | str << setw(14) << setprecision(3) << obs.measdata(types[ii], _rinexVers) << ' ';
|
|---|
| 746 | }
|
|---|
| 747 |
|
|---|
| 748 | return str.str();
|
|---|
| 749 | }
|
|---|
| 750 |
|
|---|
| 751 | //
|
|---|
| 752 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 753 | string bncRinex::obsToStr(double val, int width, int precision) {
|
|---|
| 754 | if (val != 0.0) {
|
|---|
| 755 | ostringstream str;
|
|---|
| 756 | str.setf(ios::showpoint | ios::fixed);
|
|---|
| 757 | str << setw(width) << setprecision(precision) << val;
|
|---|
| 758 | return str.str();
|
|---|
| 759 | }
|
|---|
| 760 | else {
|
|---|
| 761 | return "0.0";
|
|---|
| 762 | }
|
|---|
| 763 | }
|
|---|
| 764 |
|
|---|
| 765 | // One Line in ASCII (Internal) Format
|
|---|
| 766 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 767 | string bncRinex::asciiSatLine(const t_obs& obs) {
|
|---|
| 768 |
|
|---|
| 769 | ostringstream str;
|
|---|
| 770 | str.setf(ios::showpoint | ios::fixed);
|
|---|
| 771 |
|
|---|
| 772 | str << obs.satSys << setw(2) << setfill('0') << obs.satNum << setfill(' ');
|
|---|
| 773 |
|
|---|
| 774 | if (obs.satSys == 'R') { // Glonass
|
|---|
| 775 | str << ' ' << setw(2) << obs.slotNum;
|
|---|
| 776 | }
|
|---|
| 777 | else {
|
|---|
| 778 | str << " ";
|
|---|
| 779 | }
|
|---|
| 780 |
|
|---|
| 781 | float rnxVers = 3.0;
|
|---|
| 782 |
|
|---|
| 783 | if (obs.satSys == 'G') { // GPS
|
|---|
| 784 | str << " 1C "
|
|---|
| 785 | << obsToStr(obs.measdata("C1C", rnxVers)) << ' '
|
|---|
| 786 | << obsToStr(obs.measdata("L1C", rnxVers)) << ' '
|
|---|
| 787 | << obsToStr(obs.measdata("D1C", rnxVers)) << ' '
|
|---|
| 788 | << obsToStr(obs.measdata("S1C", rnxVers), 8, 3) << ' '
|
|---|
| 789 | << setw(2) << obs.slip_cnt_L1;
|
|---|
| 790 | str << " 1P "
|
|---|
| 791 | << obsToStr(obs.measdata("C1P", rnxVers)) << ' '
|
|---|
| 792 | << obsToStr(obs.measdata("L1P", rnxVers)) << ' '
|
|---|
| 793 | << obsToStr(obs.measdata("D1P", rnxVers)) << ' '
|
|---|
| 794 | << obsToStr(obs.measdata("S1P", rnxVers), 8, 3) << ' '
|
|---|
| 795 | << setw(2) << obs.slip_cnt_L1;
|
|---|
| 796 | str << " 2P "
|
|---|
| 797 | << obsToStr(obs.measdata("C2P", rnxVers)) << ' '
|
|---|
| 798 | << obsToStr(obs.measdata("L2P", rnxVers)) << ' '
|
|---|
| 799 | << obsToStr(obs.measdata("D2P", rnxVers)) << ' '
|
|---|
| 800 | << obsToStr(obs.measdata("S2P", rnxVers), 8, 3) << ' '
|
|---|
| 801 | << setw(2) << obs.slip_cnt_L2;
|
|---|
| 802 | str << " 5C "
|
|---|
| 803 | << obsToStr(obs.measdata("C5", rnxVers)) << ' '
|
|---|
| 804 | << obsToStr(obs.measdata("L5", rnxVers)) << ' '
|
|---|
| 805 | << obsToStr(obs.measdata("D5", rnxVers)) << ' '
|
|---|
| 806 | << obsToStr(obs.measdata("S5", rnxVers), 8, 3) << ' '
|
|---|
| 807 | << setw(2) << obs.slip_cnt_L5;
|
|---|
| 808 | }
|
|---|
| 809 | else if (obs.satSys == 'R') { // Glonass
|
|---|
| 810 | str << " 1C "
|
|---|
| 811 | << obsToStr(obs.measdata("C1C", rnxVers)) << ' '
|
|---|
| 812 | << obsToStr(obs.measdata("L1C", rnxVers)) << ' '
|
|---|
| 813 | << obsToStr(obs.measdata("D1C", rnxVers)) << ' '
|
|---|
| 814 | << obsToStr(obs.measdata("S1C", rnxVers), 8, 3) << ' '
|
|---|
| 815 | << setw(2) << obs.slip_cnt_L1;
|
|---|
| 816 | str << " 1P "
|
|---|
| 817 | << obsToStr(obs.measdata("C1P", rnxVers)) << ' '
|
|---|
| 818 | << obsToStr(obs.measdata("L1P", rnxVers)) << ' '
|
|---|
| 819 | << obsToStr(obs.measdata("D1P", rnxVers)) << ' '
|
|---|
| 820 | << obsToStr(obs.measdata("S1P", rnxVers), 8, 3) << ' '
|
|---|
| 821 | << setw(2) << obs.slip_cnt_L1;
|
|---|
| 822 | str << " 2P "
|
|---|
| 823 | << obsToStr(obs.measdata("C2P", rnxVers)) << ' '
|
|---|
| 824 | << obsToStr(obs.measdata("L2P", rnxVers)) << ' '
|
|---|
| 825 | << obsToStr(obs.measdata("D2P", rnxVers)) << ' '
|
|---|
| 826 | << obsToStr(obs.measdata("S2P", rnxVers), 8, 3) << ' '
|
|---|
| 827 | << setw(2) << obs.slip_cnt_L2;
|
|---|
| 828 | str << " 2C "
|
|---|
| 829 | << obsToStr(obs.measdata("C2C", rnxVers)) << ' '
|
|---|
| 830 | << obsToStr(obs.measdata("L2C", rnxVers)) << ' '
|
|---|
| 831 | << obsToStr(obs.measdata("D2C", rnxVers)) << ' '
|
|---|
| 832 | << obsToStr(obs.measdata("S2C", rnxVers), 8, 3) << ' '
|
|---|
| 833 | << setw(2) << obs.slip_cnt_L2;
|
|---|
| 834 | }
|
|---|
| 835 | else if (obs.satSys == 'E') { // Galileo
|
|---|
| 836 | str << " 1C "
|
|---|
| 837 | << obsToStr(obs.measdata("C1", rnxVers)) << ' '
|
|---|
| 838 | << obsToStr(obs.measdata("L1", rnxVers)) << ' '
|
|---|
| 839 | << obsToStr(obs.measdata("D1", rnxVers)) << ' '
|
|---|
| 840 | << obsToStr(obs.measdata("S1", rnxVers), 8, 3) << ' '
|
|---|
| 841 | << setw(2) << obs.slip_cnt_L1;
|
|---|
| 842 |
|
|---|
| 843 | str << " 5C "
|
|---|
| 844 | << obsToStr(obs.measdata("C5", rnxVers)) << ' '
|
|---|
| 845 | << obsToStr(obs.measdata("L5", rnxVers)) << ' '
|
|---|
| 846 | << obsToStr(obs.measdata("D5", rnxVers)) << ' '
|
|---|
| 847 | << obsToStr(obs.measdata("S5", rnxVers), 8, 3) << ' '
|
|---|
| 848 | << setw(2) << obs.slip_cnt_L5;
|
|---|
| 849 | }
|
|---|
| 850 | return str.str();
|
|---|
| 851 | }
|
|---|