source: ntrip/trunk/BNC/bncrinex.cpp@ 698

Last change on this file since 698 was 698, checked in by weber, 16 years ago

* empty log message *

File size: 22.1 KB
Line 
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
46#include <QtCore>
47#include <QUrl>
48#include <QString>
49
50#include "bncrinex.h"
51#include "bncapp.h"
52#include "bncutils.h"
53#include "bncconst.h"
54#include "bnctabledlg.h"
55#include "bncgetthread.h"
56#include "RTCM3/rtcm3torinex.h"
57
58using namespace std;
59
60// Constructor
61////////////////////////////////////////////////////////////////////////////
62bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint,
63 const QByteArray& format, const QByteArray& latitude,
64 const QByteArray& longitude, const QByteArray& nmea) {
65 _statID = statID;
66 _mountPoint = mountPoint;
67 _format = format.left(6);
68 _latitude = latitude;
69 _longitude = longitude;
70 _nmea = nmea;
71 _headerWritten = false;
72 _reconnectFlag = false;
73 _reloadTable = false;
74 _reloadDone = false;
75
76 QSettings settings;
77 _rnxScriptName = settings.value("rnxScript").toString();
78 expandEnvVar(_rnxScriptName);
79
80 _pgmName = ((bncApp*)qApp)->bncVersion().leftJustified(20, ' ', true);
81#ifdef WIN32
82 _userName = QString("${USERNAME}");
83#else
84 _userName = QString("${USER}");
85#endif
86 expandEnvVar(_userName);
87 _userName = _userName.leftJustified(20, ' ', true);
88
89 if ( Qt::CheckState(settings.value("rnxV3").toInt()) == Qt::Checked) {
90 _rinexVers = 3;
91 }
92 else {
93 _rinexVers = 2;
94 }
95}
96
97// Destructor
98////////////////////////////////////////////////////////////////////////////
99bncRinex::~bncRinex() {
100 QListIterator<p_obs> it(_obs);
101 while (it.hasNext()) {
102 delete it.next();
103 }
104 QSettings settings;
105 if ((_rinexVers == 3) && ( Qt::CheckState(settings.value("rnxAppend").toInt()) != Qt::Checked) ) {
106 _out << "END OF FILE" << endl;
107 }
108 _out.close();
109}
110
111// Download Skeleton Header File
112////////////////////////////////////////////////////////////////////////////
113t_irc bncRinex::downloadSkeleton() {
114
115 t_irc irc = failure;
116
117 QStringList table;
118 bncTableDlg::getFullTable(_mountPoint.host(), _mountPoint.port(),
119 table, _reloadTable);
120 QString net;
121 QStringListIterator it(table);
122 while (it.hasNext()) {
123 QString line = it.next();
124 if (line.indexOf("STR") == 0) {
125 QStringList tags = line.split(";");
126 if (tags.at(1) == _mountPoint.path().mid(1).toAscii()) {
127 net = tags.at(7);
128 break;
129 }
130 }
131 }
132 QString sklDir;
133 it.toFront();
134 while (it.hasNext()) {
135 QString line = it.next();
136 if (line.indexOf("NET") == 0) {
137 QStringList tags = line.split(";");
138 if (tags.at(1) == net) {
139 sklDir = tags.at(6).trimmed();
140 break;
141 }
142 }
143 }
144 if (!sklDir.isEmpty() && sklDir != "none") {
145 QUrl url(sklDir + "/" + _mountPoint.path().mid(1,4).toLower() + ".skl");
146 if (url.port() == -1) {
147 url.setPort(80);
148 }
149
150 const int timeOut = 10*1000;
151 QString msg;
152 QByteArray _latitude;
153 QByteArray _longitude;
154 QByteArray _nmea;
155 QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);
156
157 if (socket) {
158 _headerLines.clear();
159 bool firstLineRead = false;
160 while (true) {
161 if (socket->canReadLine()) {
162 QString line = socket->readLine();
163 line.chop(1);
164 if (line.indexOf("MARKER NAME") != -1) {
165 irc = success;
166 }
167 if (line.indexOf("RINEX VERSION") != -1) {
168 if (_rinexVers == 3) {
169 _headerLines.append(" 3.00 OBSERVATION DATA"
170 " M (MIXED)"
171 " RINEX VERSION / TYPE");
172 }
173 else {
174 _headerLines.append(" 2.11 OBSERVATION DATA"
175 " M (MIXED)"
176 " RINEX VERSION / TYPE");
177 }
178 _headerLines.append("PGM / RUN BY / DATE");
179 firstLineRead = true;
180 }
181 else if (firstLineRead) {
182 if (line.indexOf("END OF HEADER") != -1) {
183 _headerLines.append("# / TYPES OF OBSERV");
184 if (_rinexVers == 2) {
185 _headerLines.append(
186 QString(" 1 1").leftJustified(60, ' ', true) +
187 "WAVELENGTH FACT L1/2");
188 }
189 _headerLines.append("TIME OF FIRST OBS");
190 _headerLines.append( line );
191 break;
192 }
193 else {
194 _headerLines.append( line );
195 }
196 }
197 }
198 else {
199 socket->waitForReadyRead(timeOut);
200 if (socket->bytesAvailable() > 0) {
201 continue;
202 }
203 else {
204 break;
205 }
206 }
207 }
208 delete socket;
209 }
210 }
211 return irc;
212}
213
214// Read Skeleton Header File
215////////////////////////////////////////////////////////////////////////////
216void bncRinex::readSkeleton() {
217
218 // Read the local file
219 // -------------------
220 QFile skl(_sklName);
221 if ( skl.exists() && skl.open(QIODevice::ReadOnly) ) {
222 _headerLines.clear();
223 QTextStream in(&skl);
224 while ( !in.atEnd() ) {
225 _headerLines.append( in.readLine() );
226 if (_headerLines.last().indexOf("END OF HEADER") != -1) {
227 break;
228 }
229 }
230 }
231
232 // Read downloaded file
233 // --------------------
234 else {
235 QDate currDate = QDateTime::currentDateTime().toUTC().date();
236 if ( !_skeletonDate.isValid() || _skeletonDate != currDate ) {
237 if ( downloadSkeleton() == success) {
238 _skeletonDate = currDate;
239 _reloadDone = false;
240 }
241 else {
242 if(!_reloadDone) {
243 _reloadTable = true;
244 if ( downloadSkeleton() == success) {
245 _skeletonDate = currDate;
246 }
247 _reloadTable = false;
248 _reloadDone = true;
249 }
250 }
251 }
252 }
253}
254
255// Next File Epoch (static)
256////////////////////////////////////////////////////////////////////////////
257QString bncRinex::nextEpochStr(const QDateTime& datTim,
258 const QString& intStr, QDateTime* nextEpoch) {
259
260 QString epoStr;
261
262 QTime nextTime;
263 QDate nextDate;
264
265 int indHlp = intStr.indexOf("min");
266
267 if ( indHlp != -1) {
268 int step = intStr.left(indHlp-1).toInt();
269 char ch = 'A' + datTim.time().hour();
270 epoStr = ch;
271 if (datTim.time().minute() >= 60-step) {
272 epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
273 if (datTim.time().hour() < 23) {
274 nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
275 nextDate = datTim.date();
276 }
277 else {
278 nextTime.setHMS(0, 0, 0);
279 nextDate = datTim.date().addDays(1);
280 }
281 }
282 else {
283 for (int limit = step; limit <= 60-step; limit += step) {
284 if (datTim.time().minute() < limit) {
285 epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
286 nextTime.setHMS(datTim.time().hour(), limit, 0);
287 nextDate = datTim.date();
288 break;
289 }
290 }
291 }
292 }
293 else if (intStr == "1 hour") {
294 char ch = 'A' + datTim.time().hour();
295 epoStr = ch;
296 if (datTim.time().hour() < 23) {
297 nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
298 nextDate = datTim.date();
299 }
300 else {
301 nextTime.setHMS(0, 0, 0);
302 nextDate = datTim.date().addDays(1);
303 }
304 }
305 else {
306 epoStr = "0";
307 nextTime.setHMS(0, 0, 0);
308 nextDate = datTim.date().addDays(1);
309 }
310
311 if (nextEpoch) {
312 *nextEpoch = QDateTime(nextDate, nextTime);
313 }
314
315 return epoStr;
316}
317
318// File Name according to RINEX Standards
319////////////////////////////////////////////////////////////////////////////
320void bncRinex::resolveFileName(const QDateTime& datTim) {
321
322 QSettings settings;
323 QString path = settings.value("rnxPath").toString();
324 expandEnvVar(path);
325
326 if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
327 path += QDir::separator();
328 }
329
330 QString hlpStr = nextEpochStr(datTim, settings.value("rnxIntr").toString(),
331 &_nextCloseEpoch);
332
333 QString ID4 = _statID.left(4);
334
335 // Check name conflict
336 // -------------------
337 QString distStr;
338 int num = 0;
339 QListIterator<QString> it(settings.value("mountPoints").toStringList());
340 while (it.hasNext()) {
341 QString mp = it.next();
342 if (mp.indexOf(ID4) != -1) {
343 ++num;
344 }
345 }
346 if (num > 1) {
347 distStr = "_" + _statID.mid(4);
348 }
349
350 QString sklExt = settings.value("rnxSkel").toString();
351 if (!sklExt.isEmpty()) {
352 _sklName = path + ID4 + distStr + "." + sklExt;
353 }
354
355 path += ID4 +
356 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
357 hlpStr + distStr + datTim.toString(".yyO");
358
359 _fName = path.toAscii();
360}
361
362// Write RINEX Header
363////////////////////////////////////////////////////////////////////////////
364void bncRinex::writeHeader(const QDateTime& datTim,
365 const QDateTime& datTimNom) {
366
367 QSettings settings;
368
369 // Open the Output File
370 // --------------------
371 resolveFileName(datTimNom);
372
373 // Append to existing file and return
374 // ----------------------------------
375 if ( QFile::exists(_fName) ) {
376 if (_reconnectFlag ||
377 Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
378 _out.open(_fName.data(), ios::app);
379 _out.setf(ios::showpoint | ios::fixed);
380 _headerWritten = true;
381 _reconnectFlag = false;
382 return;
383 }
384 }
385
386 _out.open(_fName.data());
387 _out.setf(ios::showpoint | ios::fixed);
388
389 // Copy Skeleton Header
390 // --------------------
391 readSkeleton();
392 if (_headerLines.size() > 0) {
393 QStringListIterator it(_headerLines);
394 while (it.hasNext()) {
395 QString line = it.next();
396 if (line.indexOf("PGM / RUN BY / DATE") != -1) {
397 if (_rinexVers == 3) {
398 QString hlp = QDateTime::currentDateTime().toUTC().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
399 _out << _pgmName.toAscii().data() << _userName.toAscii().data()
400 << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
401 }
402 else {
403 QString hlp = QDateTime::currentDateTime().toUTC().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
404 _out << _pgmName.toAscii().data() << _userName.toAscii().data()
405 << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
406 }
407 }
408 else if (line.indexOf("# / TYPES OF OBSERV") != -1) {
409 if (_rinexVers == 3) {
410// Changed declaration of data types, consistent with Rinex3 Perlt
411 _out << "G 10 C1C C1P L1C S1C C2X C2P L2X S2X L2P S2P SYS / # / OBS TYPES" << endl;
412 _out << "R 10 C1C C1P L1C S1C C2C C2P L2C S2C L2P S2P SYS / # / OBS TYPES" << endl;
413 _out << "S 3 C1C L1C S1C SYS / # / OBS TYPES" << endl;
414 }
415 else {
416 _out << " 8 C1 C2 P1 P2 L1 L2 S1 S2"
417 " # / TYPES OF OBSERV" << endl;
418 }
419 }
420 else if (line.indexOf("TIME OF FIRST OBS") != -1) {
421 _out << datTim.toString(" yyyy MM dd"
422 " hh mm ss.zzz0000").toAscii().data();
423 _out << " GPS TIME OF FIRST OBS" << endl;
424 QString hlp = (_format + QString(" %1").arg(_mountPoint.host() +
425 _mountPoint.path())).leftJustified(60, ' ', true);
426 _out << hlp.toAscii().data() << "COMMENT" << endl;
427 }
428// Added header line for Rinex3 regarding mandatory MARKER TYPE field Perlt
429 else if (line.indexOf("MARKER NAME") != -1) {
430 if (_rinexVers == 3) {
431 _out << line.toAscii().data() << endl;
432 _out << setw(71) << "GEODETIC MARKER TYPE" << endl;
433 }
434 else {
435 _out << line.toAscii().data() << endl;
436 }
437// End
438 }
439 else {
440 _out << line.toAscii().data() << endl;
441 }
442 }
443 }
444
445 // Write Dummy Header
446 // ------------------
447 else {
448 double approxPos[3]; approxPos[0] = approxPos[1] = approxPos[2] = 0.0;
449 double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0;
450
451 if (_rinexVers == 3) {
452 _out << " 3.00 OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE" << endl;
453 QString hlp = QDateTime::currentDateTime().toUTC().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
454 _out << _pgmName.toAscii().data() << _userName.toAscii().data()
455 << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
456 }
457 else {
458 _out << " 2.11 OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE" << endl;
459 QString hlp = QDateTime::currentDateTime().toUTC().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
460 _out << _pgmName.toAscii().data() << _userName.toAscii().data()
461 << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
462 }
463 _out.setf(ios::left);
464 _out << setw(60) << _statID.data() << "MARKER NAME" << endl;
465// Added header line for Rinex3 regarding mandatory MARKER TYPE field Perlt
466 if (_rinexVers == 3) {
467 _out << setw(60) << "unknown" << "MARKER TYPE " << endl;
468 }
469// End
470 _out << setw(60) << "unknown unknown" << "OBSERVER / AGENCY" << endl;
471 _out << setw(20) << "unknown"
472 << setw(20) << "unknown"
473 << setw(20) << "unknown" << "REC # / TYPE / VERS" << endl;
474 _out << setw(20) << "unknown"
475 << setw(20) << "unknown"
476 << setw(20) << " " << "ANT # / TYPE" << endl;
477 _out.unsetf(ios::left);
478 _out << setw(14) << setprecision(4) << approxPos[0]
479 << setw(14) << setprecision(4) << approxPos[1]
480 << setw(14) << setprecision(4) << approxPos[2]
481 << " " << "APPROX POSITION XYZ" << endl;
482 _out << setw(14) << setprecision(4) << antennaNEU[0]
483 << setw(14) << setprecision(4) << antennaNEU[1]
484 << setw(14) << setprecision(4) << antennaNEU[2]
485 << " " << "ANTENNA: DELTA H/E/N" << endl;
486 if (_rinexVers == 3) {
487// Changed declaration of data types, consistent with Rinex3 Perlt
488 _out << "G 10 C1C C1P L1C S1C C2X C2P L2X S2X L2P S2P SYS / # / OBS TYPES" << endl;
489 _out << "R 10 C1C C1P L1C S1C C2C C2P L2C S2C L2P S2P SYS / # / OBS TYPES" << endl;
490 _out << "S 3 C1C L1C S1C SYS / # / OBS TYPES" << endl;
491
492 }
493 else {
494 _out << " 1 1 WAVELENGTH FACT L1/2" << endl;
495 _out << " 8 C1 C2 P1 P2 L1 L2 S1 S2 # / TYPES OF OBSERV" << endl;
496 }
497 _out << datTim.toString(" yyyy MM dd"
498 " hh mm ss.zzz0000").toAscii().data();
499 _out << " GPS TIME OF FIRST OBS" << endl;
500 QString hlp = (_format + QString(" %1").arg(_mountPoint.host() +
501 _mountPoint.path())).leftJustified(60, ' ', true);
502 _out << hlp.toAscii().data() << "COMMENT" << endl;
503
504 if (_nmea == "yes") {
505 hlp = ("NMEA LAT=" + _latitude + " " + "LONG=" + _longitude).leftJustified(60, ' ',true);
506 _out << hlp.toAscii().data() << "COMMENT" << endl; }
507
508 _out << " END OF HEADER" << endl;
509 }
510
511 _headerWritten = true;
512}
513
514// Stores Observation into Internal Array
515////////////////////////////////////////////////////////////////////////////
516void bncRinex::deepCopy(const p_obs obs) {
517 p_obs newObs = new t_obs();
518 memcpy(&newObs->_o, &obs->_o, sizeof(t_obsInternal));
519 _obs.push_back(newObs);
520}
521
522// Write One Epoch into the RINEX File
523////////////////////////////////////////////////////////////////////////////
524void bncRinex::dumpEpoch(long maxTime) {
525
526 // Select observations older than maxTime
527 // --------------------------------------
528 QList<p_obs> dumpList;
529 QMutableListIterator<p_obs> mIt(_obs);
530 while (mIt.hasNext()) {
531 p_obs obs = mIt.next();
532 if (obs->_o.GPSWeek * 7*24*3600 + obs->_o.GPSWeeks < maxTime - 0.05) {
533 dumpList.push_back(obs);
534 mIt.remove();
535 }
536 }
537
538 // Easy Return
539 // -----------
540 if (dumpList.isEmpty()) {
541 return;
542 }
543
544 // Time of Epoch
545 // -------------
546 p_obs fObs = *dumpList.begin();
547 QDateTime datTim = dateAndTimeFromGPSweek(fObs->_o.GPSWeek, fObs->_o.GPSWeeks);
548 QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->_o.GPSWeek,
549 floor(fObs->_o.GPSWeeks+0.5));
550
551 // Close the file
552 // --------------
553 if (_nextCloseEpoch.isValid() && datTimNom >= _nextCloseEpoch) {
554 closeFile();
555 _headerWritten = false;
556 }
557
558 // Write RINEX Header
559 // ------------------
560 if (!_headerWritten) {
561 writeHeader(datTim, datTimNom);
562 }
563
564 double sec = double(datTim.time().second()) + fmod(fObs->_o.GPSWeeks,1.0);
565
566 // RINEX Version 3
567 // ---------------
568 if (_rinexVers == 3) {
569 char sbasflag = 'S';
570 _out << datTim.toString("> yyyy MM dd hh mm ").toAscii().data()
571 << setw(10) << setprecision(7) << sec
572 << " " << 0 << setw(3) << dumpList.size() << endl;
573
574 QListIterator<p_obs> it(dumpList);
575 while (it.hasNext()) {
576 p_obs obs = it.next();
577// Changed data output, C1P, C2C|X, L2C|X, S2C|X added. Changed Output for SBAS Perlt
578 if (sbasflag != obs->_o.satSys) {
579 _out << obs->_o.satSys
580 << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
581 << setw(14) << setprecision(3) << obs->_o.C1 << " "
582 << setw(14) << setprecision(3) << obs->_o.P1 << " "
583 << setw(14) << setprecision(3) << obs->_o.L1 << " "
584 << setw(1) << obs->_o.SNR1
585 << setw(14) << setprecision(3) << obs->_o.S1 << " "
586 << setw(14) << setprecision(3) << obs->_o.C2 << " "
587 << setw(14) << setprecision(3) << obs->_o.P2 << " " ;
588 if ((obs->_o.C2 != 0.0) && (obs->_o.P2 == 0.0)) {
589 _out << setw(14) << setprecision(3) << obs->_o.L2 << " "
590 << setw(1) << obs->_o.SNR2
591 << setw(14) << setprecision(3) << obs->_o.S2 << " "
592 << " ";
593 }
594 else {
595 _out << " "
596 << setw(14) << setprecision(3) << obs->_o.L2 << " "
597 << setw(1) << obs->_o.SNR2
598 << setw(14) << setprecision(3) << obs->_o.S2;
599 }
600 _out << endl;
601 }
602 else {
603 _out << obs->_o.satSys
604 << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
605 << setw(14) << setprecision(3) << obs->_o.C1 << " "
606 << setw(14) << setprecision(3) << obs->_o.P1 << " "
607 << setw(14) << setprecision(3) << obs->_o.L1 << " "
608 << setw(1) << obs->_o.SNR1
609 << setw(14) << setprecision(3) << obs->_o.S1 << endl;
610 }
611 delete obs;
612 }
613 }
614
615 // RINEX Version 2
616 // ---------------
617 else {
618 _out << datTim.toString(" yy MM dd hh mm ").toAscii().data()
619 << setw(10) << setprecision(7) << sec
620 << " " << 0 << setw(3) << dumpList.size();
621
622 QListIterator<p_obs> it(dumpList); int iSat = 0;
623 while (it.hasNext()) {
624 iSat++;
625 p_obs obs = it.next();
626 _out << obs->_o.satSys << setw(2) << obs->_o.satNum;
627 if (iSat == 12 && it.hasNext()) {
628 _out << endl << " ";
629 iSat = 0;
630 }
631 }
632 _out << endl;
633
634 it.toFront();
635 while (it.hasNext()) {
636 p_obs obs = it.next();
637
638 char lli = ' ';
639 char snr = ' ';
640 _out << setw(14) << setprecision(3) << obs->_o.C1 << lli << snr;
641 _out << setw(14) << setprecision(3) << obs->_o.C2 << lli << snr;
642 _out << setw(14) << setprecision(3) << obs->_o.P1 << lli << snr;
643 _out << setw(14) << setprecision(3) << obs->_o.P2 << lli << snr;
644 _out << setw(14) << setprecision(3) << obs->_o.L1 << lli
645 << setw(1) << obs->_o.SNR1 << endl;
646 _out << setw(14) << setprecision(3) << obs->_o.L2 << lli
647 << setw(1) << obs->_o.SNR2;
648 _out << setw(14) << setprecision(3) << obs->_o.S1 ;
649 _out << setw(16) << setprecision(3) << obs->_o.S2 ;
650 _out << endl;
651
652 delete obs;
653 }
654 }
655
656 _out.flush();
657}
658
659// Close the Old RINEX File
660////////////////////////////////////////////////////////////////////////////
661void bncRinex::closeFile() {
662 QMutexLocker locker(&_mutex);
663 if (_rinexVers == 3) {
664 _out << "END OF FILE" << endl;
665 }
666 _out.close();
667 if (!_rnxScriptName.isEmpty()) {
668 msleep(1);
669#ifdef WIN32
670 QProcess::startDetached(_rnxScriptName, QStringList() << _fName) ;
671#else
672 QProcess::startDetached("nohup", QStringList() << _rnxScriptName << _fName) ;
673#endif
674
675 }
676}
Note: See TracBrowser for help on using the repository browser.