source: ntrip/trunk/BNC/src/bncrinex.cpp@ 6147

Last change on this file since 6147 was 6147, checked in by mervart, 10 years ago
File size: 20.2 KB
RevLine 
[280]1// Part of BNC, a utility for retrieving decoding and
[464]2// converting GNSS data streams from NTRIP broadcasters.
[280]3//
[464]4// Copyright (C) 2007
[280]5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
[464]7// Czech Technical University Prague, Department of Geodesy
[280]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.
[73]24
25/* -------------------------------------------------------------------------
[93]26 * BKG NTRIP Client
[73]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
[292]41#include <stdlib.h>
[300]42#include <iostream>
[75]43#include <iomanip>
[221]44#include <math.h>
[2695]45#include <sstream>
[75]46
[300]47#include <QtCore>
48#include <QUrl>
49#include <QString>
50
[73]51#include "bncrinex.h"
[5070]52#include "bnccore.h"
[82]53#include "bncutils.h"
[126]54#include "bncconst.h"
[298]55#include "bnctabledlg.h"
[301]56#include "bncgetthread.h"
[3337]57#include "bncnetqueryv1.h"
[1858]58#include "bncnetqueryv2.h"
[1535]59#include "bncsettings.h"
[2012]60#include "bncversion.h"
[75]61
62using namespace std;
63
[73]64// Constructor
65////////////////////////////////////////////////////////////////////////////
[408]66bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint,
[3525]67 const QByteArray& latitude, const QByteArray& longitude,
68 const QByteArray& nmea, const QByteArray& ntripVersion) {
[1387]69
[408]70 _statID = statID;
[336]71 _mountPoint = mountPoint;
[366]72 _latitude = latitude;
73 _longitude = longitude;
74 _nmea = nmea;
[1639]75 _ntripVersion = ntripVersion;
[77]76 _headerWritten = false;
[369]77 _reconnectFlag = false;
[132]78
[1535]79 bncSettings settings;
[132]80 _rnxScriptName = settings.value("rnxScript").toString();
81 expandEnvVar(_rnxScriptName);
[153]82
[2012]83 _pgmName = QString(BNCPGMNAME).leftJustified(20, ' ', true);
[319]84#ifdef WIN32
85 _userName = QString("${USERNAME}");
86#else
[158]87 _userName = QString("${USER}");
[319]88#endif
[157]89 expandEnvVar(_userName);
[158]90 _userName = _userName.leftJustified(20, ' ', true);
[539]91
[3528]92 _samplingRate = settings.value("rnxSampl").toInt();
[73]93}
94
95// Destructor
96////////////////////////////////////////////////////////////////////////////
97bncRinex::~bncRinex() {
[1535]98 bncSettings settings;
[4483]99 if ((_header._version >= 3.0) && ( Qt::CheckState(settings.value("rnxAppend").toInt()) != Qt::Checked) ) {
[843]100 _out << "> 4 1" << endl;
[698]101 _out << "END OF FILE" << endl;
102 }
[77]103 _out.close();
[73]104}
105
[420]106// Download Skeleton Header File
107////////////////////////////////////////////////////////////////////////////
108t_irc bncRinex::downloadSkeleton() {
109
110 t_irc irc = failure;
111
112 QStringList table;
[3335]113 bncTableDlg::getFullTable(_ntripVersion, _mountPoint.host(),
[4481]114 _mountPoint.port(), table, true);
[420]115 QString net;
116 QStringListIterator it(table);
117 while (it.hasNext()) {
118 QString line = it.next();
119 if (line.indexOf("STR") == 0) {
120 QStringList tags = line.split(";");
[1495]121 if (tags.size() > 7) {
122 if (tags.at(1) == _mountPoint.path().mid(1).toAscii()) {
123 net = tags.at(7);
124 break;
125 }
[420]126 }
127 }
128 }
129 QString sklDir;
[1495]130 if (!net.isEmpty()) {
131 it.toFront();
132 while (it.hasNext()) {
133 QString line = it.next();
134 if (line.indexOf("NET") == 0) {
135 QStringList tags = line.split(";");
136 if (tags.size() > 6) {
137 if (tags.at(1) == net) {
138 sklDir = tags.at(6).trimmed();
139 break;
140 }
141 }
142 }
[420]143 }
144 }
145 if (!sklDir.isEmpty() && sklDir != "none") {
146 QUrl url(sklDir + "/" + _mountPoint.path().mid(1,4).toLower() + ".skl");
147 if (url.port() == -1) {
148 url.setPort(80);
149 }
150
[3337]151 bncNetQuery* query;
152 if (_ntripVersion == "2s") {
153 query = new bncNetQueryV2(true);
154 }
155 else if (_ntripVersion == "2") {
156 query = new bncNetQueryV2(false);
157 }
158 else {
159 query = new bncNetQueryV1;
160 }
161
[1386]162 QByteArray outData;
[3337]163 query->waitForRequestResult(url, outData);
164 if (query->status() == bncNetQuery::finished) {
[4481]165 irc = success;
[6120]166 _header._obsTypes.clear();
[1386]167 QTextStream in(outData);
[4481]168 _header.read(&in);
[420]169 }
[4481]170
[3337]171 delete query;
172 }
[1386]173
[420]174 return irc;
175}
176
[82]177// Read Skeleton Header File
178////////////////////////////////////////////////////////////////////////////
[4532]179bool bncRinex::readSkeleton() {
[82]180
[4532]181 bool readDone = false;
182
[420]183 // Read the local file
184 // -------------------
[276]185 QFile skl(_sklName);
[82]186 if ( skl.exists() && skl.open(QIODevice::ReadOnly) ) {
[4532]187 readDone = true;
[6120]188 _header._obsTypes.clear();
[82]189 QTextStream in(&skl);
[4481]190 _header.read(&in);
[82]191 }
[298]192
[420]193 // Read downloaded file
194 // --------------------
[2376]195 else if ( _ntripVersion != "N" && _ntripVersion != "UN" &&
196 _ntripVersion != "S" ) {
[1154]197 QDate currDate = currentDateAndTimeGPS().date();
[420]198 if ( !_skeletonDate.isValid() || _skeletonDate != currDate ) {
[4532]199 if (downloadSkeleton() == success) {
200 readDone = true;
201 }
[4481]202 _skeletonDate = currDate;
[298]203 }
204 }
[4532]205
206 return readDone;
[82]207}
208
[647]209// Next File Epoch (static)
[82]210////////////////////////////////////////////////////////////////////////////
[647]211QString bncRinex::nextEpochStr(const QDateTime& datTim,
212 const QString& intStr, QDateTime* nextEpoch) {
[82]213
[647]214 QString epoStr;
[82]215
[129]216 QTime nextTime;
217 QDate nextDate;
218
[204]219 int indHlp = intStr.indexOf("min");
220
221 if ( indHlp != -1) {
222 int step = intStr.left(indHlp-1).toInt();
[127]223 char ch = 'A' + datTim.time().hour();
[647]224 epoStr = ch;
[204]225 if (datTim.time().minute() >= 60-step) {
[647]226 epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
[199]227 if (datTim.time().hour() < 23) {
228 nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
229 nextDate = datTim.date();
230 }
231 else {
232 nextTime.setHMS(0, 0, 0);
233 nextDate = datTim.date().addDays(1);
234 }
235 }
236 else {
[204]237 for (int limit = step; limit <= 60-step; limit += step) {
238 if (datTim.time().minute() < limit) {
[647]239 epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
[204]240 nextTime.setHMS(datTim.time().hour(), limit, 0);
241 nextDate = datTim.date();
242 break;
243 }
[199]244 }
245 }
246 }
[127]247 else if (intStr == "1 hour") {
248 char ch = 'A' + datTim.time().hour();
[647]249 epoStr = ch;
[129]250 if (datTim.time().hour() < 23) {
251 nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
252 nextDate = datTim.date();
253 }
254 else {
255 nextTime.setHMS(0, 0, 0);
256 nextDate = datTim.date().addDays(1);
257 }
[127]258 }
259 else {
[647]260 epoStr = "0";
[129]261 nextTime.setHMS(0, 0, 0);
262 nextDate = datTim.date().addDays(1);
[127]263 }
[82]264
[647]265 if (nextEpoch) {
266 *nextEpoch = QDateTime(nextDate, nextTime);
267 }
268
269 return epoStr;
270}
271
272// File Name according to RINEX Standards
273////////////////////////////////////////////////////////////////////////////
274void bncRinex::resolveFileName(const QDateTime& datTim) {
275
[1535]276 bncSettings settings;
[647]277 QString path = settings.value("rnxPath").toString();
278 expandEnvVar(path);
279
280 if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
281 path += QDir::separator();
282 }
283
284 QString hlpStr = nextEpochStr(datTim, settings.value("rnxIntr").toString(),
285 &_nextCloseEpoch);
286
[183]287 QString ID4 = _statID.left(4);
288
289 // Check name conflict
290 // -------------------
291 QString distStr;
292 int num = 0;
293 QListIterator<QString> it(settings.value("mountPoints").toStringList());
294 while (it.hasNext()) {
295 QString mp = it.next();
296 if (mp.indexOf(ID4) != -1) {
297 ++num;
298 }
299 }
300 if (num > 1) {
301 distStr = "_" + _statID.mid(4);
302 }
303
[276]304 QString sklExt = settings.value("rnxSkel").toString();
305 if (!sklExt.isEmpty()) {
306 _sklName = path + ID4 + distStr + "." + sklExt;
307 }
308
[183]309 path += ID4 +
[127]310 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
[276]311 hlpStr + distStr + datTim.toString(".yyO");
[82]312
313 _fName = path.toAscii();
314}
315
[77]316// Write RINEX Header
317////////////////////////////////////////////////////////////////////////////
[4489]318void bncRinex::writeHeader(const QByteArray& format,
[267]319 const QDateTime& datTimNom) {
[77]320
[1535]321 bncSettings settings;
[356]322
[77]323 // Open the Output File
324 // --------------------
[267]325 resolveFileName(datTimNom);
[260]326
327 // Append to existing file and return
328 // ----------------------------------
[5530]329 if ( QFile::exists(_fName) &&
330 (_reconnectFlag || Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) ) {
331 _out.open(_fName.data(), ios::app);
332 _out.setf(ios::showpoint | ios::fixed);
333 _headerWritten = true;
334 _reconnectFlag = false;
[260]335 }
[5530]336 else {
337 _out.open(_fName.data());
338 }
[260]339
[85]340 _out.setf(ios::showpoint | ios::fixed);
[77]341
[4502]342 // Read Skeleton Header
[82]343 // --------------------
[4532]344 bool skelRead = readSkeleton();
[4502]345
346 // Set RINEX Version
347 // -----------------
348 if ( Qt::CheckState(settings.value("rnxV3").toInt()) == Qt::Checked) {
[5376]349 _header._version = t_rnxObsHeader::defaultRnxObsVersion3;
[4502]350 }
351 else {
[5376]352 _header._version = t_rnxObsHeader::defaultRnxObsVersion2;
[4502]353 }
354
[4503]355 // A Few Additional Comments
356 // -------------------------
[4532]357 if (skelRead || _addComments.size() == 0) {
358 _addComments.clear();
359 _addComments << format.left(6) + " "
360 + _mountPoint.host() + _mountPoint.path();
[6120]361 if (_header._obsTypes.size() == 0) {
[4533]362 _addComments << "Default set of observation types used";
363 }
[4532]364 if (_nmea == "yes") {
365 _addComments << "NMEA LAT=" + _latitude + " " + "LONG=" + _longitude;
366 }
[4503]367 }
368
[4502]369 // Set Marker Name
370 // ---------------
[4495]371 if (_header._markerName.isEmpty()) {
372 _header._markerName = _statID;
373 }
[78]374
[6120]375 // Set Default Observation Types
376 // -----------------------------
377 if (_header._obsTypes.size() == 0) {
378 if (_header._version < 3.0) {
379 _header._obsTypes['G'] << "C1" << "P1" << "L1" << "S1"
380 << "C2" << "P2" << "L2" << "S2";
381 _header._obsTypes['R'] = _header._obsTypes['G'];
382 _header._obsTypes['E'] = _header._obsTypes['G'];
383 _header._obsTypes['J'] = _header._obsTypes['G'];
384 _header._obsTypes['S'] = _header._obsTypes['G'];
385 _header._obsTypes['C'] = _header._obsTypes['G'];
386 }
387 else {
388 _header._obsTypes['G'] << "C1C" << "L1C" << "D1C" << "S1C"
[4502]389 << "C1P" << "L1P" << "D1P" << "S1P"
390 << "C2C" << "L2C" << "D2C" << "S2C"
391 << "C2P" << "L2P" << "D2P" << "S2P"
392 << "C5" << "D5" << "L5" << "S5";
[6120]393
394 _header._obsTypes['R'] << "C1C" << "L1C" << "D1C" << "S1C"
[4502]395 << "C1P" << "L1P" << "D1P" << "S1P"
396 << "C2C" << "L2C" << "D2C" << "S2C"
397 << "C2P" << "L2P" << "D2P" << "S2P";
[6120]398
399 _header._obsTypes['E'] << "C1" << "L1" << "D1" << "S1"
[4502]400 << "C5" << "L5" << "D5" << "S5"
401 << "C6" << "L6" << "D6" << "S6"
402 << "C7" << "L7" << "D7" << "S7"
403 << "C8" << "L8" << "D8" << "S8";
[6120]404
405 _header._obsTypes['J'] << "C1" << "L1" << "D1" << "S1"
[4502]406 << "C2" << "L2" << "D2" << "S2"
407 << "C5" << "L5" << "D5" << "S5"
408 << "C6" << "D6" << "L6" << "S6";
[6120]409
410 _header._obsTypes['S'] << "C1" << "L1" << "D1" << "S1"
[4502]411 << "C5" << "L5" << "D5" << "S5";
[6120]412
413 _header._obsTypes['C'] << "C1" << "L1" << "D1" << "S1"
[4502]414 << "C6" << "L6" << "D6" << "S6"
415 << "C7" << "L7" << "D7" << "S7";
[6120]416 }
[4502]417 }
418
[4503]419 // Write the Header
420 // ----------------
421 QByteArray headerLines;
422 QTextStream outHlp(&headerLines);
423
[4495]424 QMap<QString, QString> txtMap;
[4532]425 txtMap["COMMENT"] = _addComments.join("\\n");
[4495]426
427 _header.write(&outHlp, &txtMap);
[4503]428
[4481]429 outHlp.flush();
[4406]430
[5530]431 if (!_headerWritten) {
432 _out << headerLines.data();
433 }
434
[77]435 _headerWritten = true;
436}
437
[73]438// Stores Observation into Internal Array
439////////////////////////////////////////////////////////////////////////////
[6137]440void bncRinex::deepCopy(t_satObs obs) {
[2711]441 _obs.push_back(obs);
[73]442}
443
444// Write One Epoch into the RINEX File
445////////////////////////////////////////////////////////////////////////////
[3525]446void bncRinex::dumpEpoch(const QByteArray& format, long maxTime) {
[73]447
[160]448 // Select observations older than maxTime
449 // --------------------------------------
[6137]450 QList<t_satObs> dumpList;
451 QMutableListIterator<t_satObs> mIt(_obs);
[160]452 while (mIt.hasNext()) {
[6137]453 t_satObs obs = mIt.next();
454 if (obs._time.gpsw() * 7*24*3600 + obs._time.gpssec() < maxTime - 0.05) {
[622]455 dumpList.push_back(obs);
[160]456 mIt.remove();
457 }
458 }
459
[75]460 // Easy Return
461 // -----------
[160]462 if (dumpList.isEmpty()) {
[75]463 return;
464 }
465
466 // Time of Epoch
467 // -------------
[6137]468 const t_satObs& fObs = dumpList.first();
469 QDateTime datTim = dateAndTimeFromGPSweek(fObs._time.gpsw(), fObs._time.gpssec());
470 QDateTime datTimNom = dateAndTimeFromGPSweek(fObs._time.gpsw(),
471 floor(fObs._time.gpssec()+0.5));
[75]472
[130]473 // Close the file
474 // --------------
[267]475 if (_nextCloseEpoch.isValid() && datTimNom >= _nextCloseEpoch) {
[130]476 closeFile();
477 _headerWritten = false;
478 }
479
[78]480 // Write RINEX Header
481 // ------------------
482 if (!_headerWritten) {
[6137]483 _header._startTime.set(fObs._time.gpsw(), fObs._time.gpssec());
[4489]484 writeHeader(format, datTimNom);
[78]485 }
486
[5328]487 // Check whether observation types available
488 // -----------------------------------------
[6137]489 QMutableListIterator<t_satObs> mItDump(dumpList);
[5328]490 while (mItDump.hasNext()) {
[6137]491 t_satObs& obs = mItDump.next();
492 if (!_header._obsTypes.contains(obs._prn.system()) && !_header._obsTypes.contains(obs._prn.system())) {
[5328]493 mItDump.remove();
494 }
495 }
496 if (dumpList.isEmpty()) {
497 return;
498 }
499
[6137]500 double sec = double(datTim.time().second()) + fmod(fObs._time.gpssec(),1.0);
[75]501
[1044]502 // Epoch header line: RINEX Version 3
503 // ----------------------------------
[4483]504 if (_header._version >= 3.0) {
[540]505 _out << datTim.toString("> yyyy MM dd hh mm ").toAscii().data()
506 << setw(10) << setprecision(7) << sec
507 << " " << 0 << setw(3) << dumpList.size() << endl;
[74]508 }
[1044]509 // Epoch header line: RINEX Version 2
510 // ----------------------------------
[540]511 else {
512 _out << datTim.toString(" yy MM dd hh mm ").toAscii().data()
513 << setw(10) << setprecision(7) << sec
514 << " " << 0 << setw(3) << dumpList.size();
[1044]515
[6137]516 QListIterator<t_satObs> it(dumpList); int iSat = 0;
[540]517 while (it.hasNext()) {
518 iSat++;
[6137]519 const t_satObs& obs = it.next();
520 _out << obs._prn;
[540]521 if (iSat == 12 && it.hasNext()) {
522 _out << endl << " ";
523 iSat = 0;
524 }
525 }
[77]526 _out << endl;
[1044]527 }
528
[6137]529 QListIterator<t_satObs> it(dumpList);
[1044]530 while (it.hasNext()) {
[6137]531 const t_satObs& obs = it.next();
[1044]532
533 // Cycle slips detection
534 // ---------------------
[6137]535 QString prn(obs._prn.toString().c_str());
536 char lli1 = ' ';
537 char lli2 = ' ';
538 char lli5 = ' ';
539 char* lli = 0;
[1044]540
[6137]541 for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
542 const t_frqObs* frqObs = obs._obs[iFrq];
543 QMap<QString, int>* slip_cnt = 0;
544 if (frqObs->_rnxType2ch[0] == '1') {
545 slip_cnt = &_slip_cnt_L1;
546 lli = &lli1;
[1044]547 }
[6137]548 else if (frqObs->_rnxType2ch[0] == '2') {
549 slip_cnt = &_slip_cnt_L2;
550 lli = &lli2;
[1044]551 }
[6137]552 else if (frqObs->_rnxType2ch[0] == '5') {
553 slip_cnt = &_slip_cnt_L5;
554 lli = &lli5;
[2688]555 }
[6137]556 else {
557 continue;
558 }
559 if (frqObs->_slip) {
560 if ( slip_cnt->find(prn) != slip_cnt->end() &&
561 slip_cnt->find(prn).value() != frqObs->_slipCounter ) {
562 *lli = '1';
563 }
564 }
565 (*slip_cnt)[prn] = frqObs->_slipCounter;
[2688]566 }
567
[4486]568 // Write the data
569 // --------------
570 _out << rinexSatLine(obs, lli1, lli2, lli5) << endl;
[75]571 }
572
[77]573 _out.flush();
[73]574}
575
[130]576// Close the Old RINEX File
577////////////////////////////////////////////////////////////////////////////
578void bncRinex::closeFile() {
[4483]579 if (_header._version == 3) {
[843]580 _out << "> 4 1" << endl;
[698]581 _out << "END OF FILE" << endl;
582 }
[130]583 _out.close();
[132]584 if (!_rnxScriptName.isEmpty()) {
[1523]585 qApp->thread()->wait(100);
[435]586#ifdef WIN32
587 QProcess::startDetached(_rnxScriptName, QStringList() << _fName) ;
588#else
[475]589 QProcess::startDetached("nohup", QStringList() << _rnxScriptName << _fName) ;
[435]590#endif
[436]591
[132]592 }
[130]593}
[2695]594
[4488]595// One Line in RINEX v2 or v3
[2695]596////////////////////////////////////////////////////////////////////////////
[6137]597string bncRinex::rinexSatLine(const t_satObs& obs, char lli1, char lli2, char lli5) {
[2695]598 ostringstream str;
[6147]599 str.setf(ios::showpoint | ios::fixed);
[2695]600
[6147]601 if (_header._version >= 3.0) {
602 str << obs._prn;
603 }
604
605 const QString obsKinds = "LCDS";
606
607 char sys = obs._prn.system();
608 const QVector<QString>& types = _header._obsTypes[sys];
609 for (int ii = 0; ii < types.size(); ii++) {
610 if (_header._version < 3.0 && ii > 0 && ii % 5 == 0) {
611 str << endl;
612 }
613 double obsValue = 0.0;
614 char lli = ' ';
615 QString rnxType = types[ii];
616 for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
617 const t_frqObs* frqObs = obs._obs[iFrq];
618 for (int ik = 0; ik < obsKinds.length(); ik++) {
619 QChar ch = obsKinds[ik];
620 QString obsType = (ch + QString(frqObs->_rnxType2ch.c_str())).left(rnxType.length());
621 if (rnxType == obsType) {
622 if (ch == 'L' && frqObs->_phaseValid) {
623 obsValue = frqObs->_phase;
624 if (obsType[1] == '1') {
625 lli = lli1;
626 }
627 else if (obsType[1] == '2') {
628 lli = lli2;
629 }
630 else if (obsType[1] == '5') {
631 lli = lli5;
632 }
633 }
634 else if (ch == 'C' && frqObs->_codeValid) {
635 obsValue = frqObs->_code;
636 }
637 else if (ch == 'D' && frqObs->_dopplerValid) {
638 obsValue = frqObs->_doppler;
639 }
640 else if (ch == 'S' && frqObs->_snrValid) {
641 obsValue = frqObs->_snr;
642 }
643 }
644 }
645 }
646 if (obsValue != 0.0) {
647 str << setw(14) << setprecision(3) << obsValue << lli << ' ';
648 }
649 else {
650 str << " ";
651 }
652 }
653
654 cout << str.str() << endl;
655
[2695]656 return str.str();
657}
[3324]658
[3344]659//
660////////////////////////////////////////////////////////////////////////////
661string bncRinex::obsToStr(double val, int width, int precision) {
[3326]662 if (val != 0.0) {
663 ostringstream str;
664 str.setf(ios::showpoint | ios::fixed);
[3344]665 str << setw(width) << setprecision(precision) << val;
[3326]666 return str.str();
667 }
668 else {
669 return "0.0";
670 }
671}
672
[3324]673// One Line in ASCII (Internal) Format
674////////////////////////////////////////////////////////////////////////////
[6137]675string bncRinex::asciiSatLine(const t_satObs& obs) {
[3324]676
677 ostringstream str;
[6137]678//// str.setf(ios::showpoint | ios::fixed);
679////
680//// str << obs._prn << ' ';
681////
682//// float rnxVers = 3.0;
683////
684//// for (int ie = 0; ie < GNSSENTRY_NUMBER; ie++) {
685//// QString rnxStr = obs.rnxStr(ie);
686//// if (rnxStr.length() >= 2) {
687//// double data = obs.measdata(rnxStr, rnxVers);
688//// if (data != 0.0) {
689//// int width = (rnxStr[0] == 'S') ? 8 : 14;
690//// int prec = 3;
691//// str << ' ' << rnxStr.toAscii().data()
692//// << ' ' << obsToStr(data, width, prec);
693//// if (rnxStr[0] == 'L') {
694//// int slipCnt = 0;
695//// if (rnxStr[1] == '1') {
696//// slipCnt = obs.slip_cnt_L1;
697//// }
698//// else if (rnxStr[1] == '2') {
699//// slipCnt = obs.slip_cnt_L2;
700//// }
701//// else if (rnxStr[1] == '5') {
702//// slipCnt = obs.slip_cnt_L5;
703//// }
704//// str << ' ' << setw(3) << slipCnt;
705//// }
706//// }
707//// }
708//// }
[3324]709
710 return str.str();
711}
Note: See TracBrowser for help on using the repository browser.