Changeset 10503 in ntrip for trunk/BNC/src/bnczerodecoder.cpp
- Timestamp:
- Jun 7, 2024, 11:41:06 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnczerodecoder.cpp
r8203 r10503 35 35 * Created: 24-Apr-2007 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 47 47 48 48 // Constructor 49 //////////////////////////////////////////////////////////////////////// 50 bncZeroDecoder::bncZeroDecoder(const QString& fileName) { 49 //////////////////////////////////////////////////////////////////////// 50 bncZeroDecoder::bncZeroDecoder(const QString& fileName, bool writeFile) { 51 _writeFile = writeFile; 51 52 52 bncSettings settings; 53 QString path = settings.value("rnxPath").toString(); 54 expandEnvVar(path); 53 if (_writeFile) { 54 bncSettings settings; 55 QString path = settings.value("rnxPath").toString(); 56 expandEnvVar(path); 55 57 56 if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) { 57 path += QDir::separator(); 58 if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) { 59 path += QDir::separator(); 60 } 61 62 _fileName = path + fileName; 58 63 } 59 60 _fileName = path + fileName;61 64 62 65 _out = 0; … … 64 67 65 68 // Destructor 66 //////////////////////////////////////////////////////////////////////// 69 //////////////////////////////////////////////////////////////////////// 67 70 bncZeroDecoder::~bncZeroDecoder() { 68 71 delete _out; … … 70 73 71 74 // Reopen Output File 72 //////////////////////////////////////////////////////////////////////// 75 //////////////////////////////////////////////////////////////////////// 73 76 void bncZeroDecoder::reopen() { 74 77 QDate currDate = currentDateAndTimeGPS().date(); 75 78 if (!_out || _fileDate != currDate) { 76 79 delete _out; 77 QByteArray fileName = 80 QByteArray fileName = 78 81 (_fileName + "_" + currDate.toString("yyMMdd")).toLatin1(); 79 82 bncSettings settings; … … 89 92 90 93 // Decode Method 91 //////////////////////////////////////////////////////////////////////// 94 //////////////////////////////////////////////////////////////////////// 92 95 t_irc bncZeroDecoder::Decode(char* buffer, int bufLen, vector<string>& errmsg) { 93 96 errmsg.clear(); 94 reopen(); 95 _out->write(buffer, bufLen); 96 _out->flush(); 97 if (_writeFile) { 98 reopen(); 99 _out->write(buffer, bufLen); 100 _out->flush(); 101 } 97 102 return success; 98 103 }
Note:
See TracChangeset
for help on using the changeset viewer.