Changeset 2519 in ntrip
- Timestamp:
- Aug 3, 2010, 12:10:19 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnc.pro
r2492 r2519 40 40 bncserialport.h bncnetquerys.h bncfigure.h \ 41 41 bncfigurelate.h bncpppclient.h bncversion.h \ 42 bancroft.h bncmodel.h bncfigureppp.h 42 bancroft.h bncmodel.h bncfigureppp.h bncrawfile.h \ 43 43 RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h \ 44 44 RTCM/RTCM2_2021.h RTCM/rtcm_utils.h \ … … 69 69 bncserialport.cpp bncnetquerys.cpp bncfigure.cpp \ 70 70 bncfigurelate.cpp bncpppclient.cpp bnctime.cpp \ 71 bancroft.cpp bncmodel.cpp bncfigureppp.cpp 71 bancroft.cpp bncmodel.cpp bncfigureppp.cpp bncrawfile.cpp \ 72 72 RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp \ 73 73 RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp \ -
trunk/BNC/bncapp.cpp
r2518 r2519 60 60 _logStream = 0; 61 61 _caster = 0; 62 _raw OutFile= 0;62 _rawFile = 0; 63 63 64 64 // Lists of Ephemeris … … 129 129 delete _currentDateAndTimeGPS; 130 130 131 delete _raw OutFile;131 delete _rawFile; 132 132 } 133 133 … … 713 713 QMutexLocker locker(&_mutex); 714 714 715 if (!_raw OutFile) {715 if (!_rawFile) { 716 716 bncSettings settings; 717 QString rawOutFileName = settings.value("rawOutFile").toString(); 718 if (!rawOutFileName.isEmpty()) { 719 _rawOutFile = new QFile(rawOutFileName); 720 _rawOutFile->open(QIODevice::WriteOnly); 721 722 QByteArray header = 723 "1 Version of BNC raw file\n" + 724 currentDateAndTimeGPS().toString(Qt::ISODate).toAscii(); 725 726 _rawOutFile->write(header); 727 } 728 } 729 730 if (_rawOutFile) { 731 QString chunkHeader = 732 QString("\n%1 %2 %3\n").arg(QString(staID)).arg(QString(format)).arg(data.size()); 733 _rawOutFile->write(chunkHeader.toAscii()); 734 _rawOutFile->write(data); 735 _rawOutFile->flush(); 736 } 737 } 717 QByteArray fileName = settings.value("rawOutFile").toByteArray(); 718 if (!fileName.isEmpty()) { 719 _rawFile = new bncRawFile(fileName, format, bncRawFile::output); 720 } 721 } 722 723 if (_rawFile) { 724 _rawFile->writeRawData(data, staID, format); 725 } 726 } -
trunk/BNC/bncapp.h
r2518 r2519 31 31 32 32 #include "bnccaster.h" 33 #include "bncrawfile.h" 33 34 #include "RTCM3/RTCM3Decoder.h" 34 35 … … 75 76 76 77 QFile* _logFile; 77 QFile* _rawOutFile;78 78 QTextStream* _logStream; 79 79 int _logFileFlag; … … 105 105 QMultiMap<long, QString>* _corrs; 106 106 QString _confFileName; 107 QDate _fileDate; 107 QDate _fileDate; 108 bncRawFile* _rawFile; 108 109 }; 109 110 #endif -
trunk/BNC/bncgetthread.cpp
r2518 r2519 75 75 // Constructor 1 76 76 //////////////////////////////////////////////////////////////////////////// 77 bncGetThread::bncGetThread(const QByteArray& rawInpFileName, 78 const QByteArray& format) { 79 80 _rawInpFile = new QFile(rawInpFileName); 81 _rawInpFile->open(QIODevice::ReadOnly); 82 _format = format; 83 _staID = rawInpFileName.mid( 84 rawInpFileName.lastIndexOf(QDir::separator())+1,5); 85 86 _rawOutput = false; 87 77 bncGetThread::bncGetThread(bncRawFile* rawFile) { 78 79 _rawFile = rawFile; 80 _format = rawFile->format(); 81 _staID = rawFile->staID(); 82 _rawOutput = false; 88 83 _ntripVersion = "N"; 89 84 … … 99 94 const QByteArray& nmea, 100 95 const QByteArray& ntripVersion, const QByteArray& extraStaID) { 101 _raw InpFile= 0;96 _rawFile = 0; 102 97 _mountPoint = mountPoint; 103 98 _staID = (extraStaID.size() == 0 ? mountPoint.path().mid(1).toAscii() : extraStaID); … … 305 300 _format.indexOf("RTCM 3") != -1 ) { 306 301 emit(newMessage(_staID + ": Get data in RTCM 3.x format", true)); 307 bool inputFromFile = false; 308 if (_rawInpFile != 0) { 309 inputFromFile = true; 310 } 311 _decoder = new RTCM3Decoder(_staID, inputFromFile); 302 _decoder = new RTCM3Decoder(_staID, bool(_rawFile != 0)); 312 303 connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray,bool)), 313 304 this, SIGNAL(newMessage(QByteArray,bool))); … … 348 339 delete _decoder; 349 340 delete _rnx; 350 delete _raw InpFile;341 delete _rawFile; 351 342 delete _serialOutFile; 352 343 delete _serialPort; … … 395 386 _query->waitForReadyRead(data); 396 387 } 397 else if (_rawInpFile) { 398 const qint64 maxBytes = 1024; 399 data = _rawInpFile->read(maxBytes); 400 401 //// beg test 402 msleep(10); 403 //// end test 388 else if (_rawFile) { 389 data = _rawFile->read(); 404 390 405 391 if (data.isEmpty()) { … … 457 443 // Check observation epoch 458 444 // ----------------------- 459 if (!_raw InpFile && !dynamic_cast<gpssDecoder*>(_decoder)) {445 if (!_rawFile && !dynamic_cast<gpssDecoder*>(_decoder)) { 460 446 int week; 461 447 double sec; … … 525 511 // Start a new query 526 512 // ----------------- 527 if (!_raw InpFile) {513 if (!_rawFile) { 528 514 529 515 sleep(_nextSleep); -
trunk/BNC/bncgetthread.h
r2492 r2519 36 36 #include "bncnetquery.h" 37 37 #include "bnctime.h" 38 #include "bncrawfile.h" 38 39 39 40 class bncRinex; … … 46 47 47 48 public: 48 bncGetThread( const QByteArray& rawInpFileName, const QByteArray& format);49 bncGetThread(bncRawFile* rawFile); 49 50 bncGetThread(const QUrl& mountPoint, 50 51 const QByteArray& format, … … 117 118 int _samplingRate; 118 119 bncRinex* _rnx; 119 QFile*_rawInpFile;120 bncRawFile* _rawFile; 120 121 QextSerialPort* _serialPort; 121 122 bool _isToBeDeleted; -
trunk/BNC/bncmain.cpp
r2012 r2519 64 64 QByteArray rawFileName; 65 65 QByteArray format; 66 QString dateString;67 QString timeString;68 66 QString confFileName; 69 67 … … 82 80 if (QByteArray(argv[ii]).indexOf("-format") != -1) { 83 81 format = QByteArray(argv[ii+1]); 84 }85 if (QByteArray(argv[ii]).indexOf("-date") != -1) {86 dateString = QString(argv[ii+1]);87 }88 if (QByteArray(argv[ii]).indexOf("-time") != -1) {89 timeString = QString(argv[ii+1]);90 82 } 91 83 } … … 158 150 // ----------------------------- 159 151 else { 160 if ( format.isEmpty() || dateString.isEmpty() || timeString.isEmpty()) {152 if ( format.isEmpty() ) { 161 153 cout << printHelp.toAscii().data() << endl; 162 154 exit(0); 163 155 } 164 156 165 app._currentDateAndTimeGPS = 166 new QDateTime(QDate::fromString(dateString, Qt::ISODate), 167 QTime::fromString(timeString, Qt::ISODate), Qt::UTC); 157 bncRawFile* rawFile = new bncRawFile(rawFileName, format, 158 bncRawFile::input); 168 159 169 bncGetThread* getThread = new bncGetThread(rawFile Name, format);160 bncGetThread* getThread = new bncGetThread(rawFile); 170 161 caster->addGetThread(getThread); 171 162 }
Note:
See TracChangeset
for help on using the changeset viewer.