- Timestamp:
- Nov 6, 2013, 2:57:57 PM (11 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccaster.cpp
r5527 r5528 60 60 // Constructor 61 61 //////////////////////////////////////////////////////////////////////////// 62 bncCaster::bncCaster( const QString& outFileName, int port) {62 bncCaster::bncCaster() { 63 63 64 64 bncSettings settings; … … 67 67 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 68 68 69 if ( !outFileName.isEmpty() ) { 70 QString lName = outFileName; 71 expandEnvVar(lName); 72 _outFile = new QFile(lName); 73 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) { 74 _outFile->open(QIODevice::WriteOnly | QIODevice::Append); 75 } 76 else { 77 _outFile->open(QIODevice::WriteOnly); 78 } 79 _out = new QTextStream(_outFile); 80 _out->setRealNumberNotation(QTextStream::FixedNotation); 81 } 82 else { 83 _outFile = 0; 84 _out = 0; 85 } 86 87 _port = port; 69 _outFile = 0; 70 _out = 0; 71 reopenOutFile(); 72 73 _port = settings.value("outPort").toInt(); 88 74 89 75 if (_port != 0) { … … 178 164 179 165 QMutexLocker locker(&_mutex); 166 167 reopenOutFile(); 180 168 181 169 unsigned index = 0; … … 561 549 } 562 550 } 551 552 // 553 //////////////////////////////////////////////////////////////////////////// 554 void bncCaster::reopenOutFile() { 555 556 bncSettings settings; 557 558 QString outFileName = settings.value("outFile").toString(); 559 if ( !outFileName.isEmpty() ) { 560 expandEnvVar(outFileName); 561 if (!_outFile || _outFile->fileName() != outFileName) { 562 delete _out; 563 delete _outFile; 564 _outFile = new QFile(outFileName); 565 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) { 566 _outFile->open(QIODevice::WriteOnly | QIODevice::Append); 567 } 568 else { 569 _outFile->open(QIODevice::WriteOnly); 570 } 571 _out = new QTextStream(_outFile); 572 _out->setRealNumberNotation(QTextStream::FixedNotation); 573 } 574 } 575 else { 576 delete _out; _out = 0; 577 delete _outFile; _outFile = 0; 578 } 579 } 580 -
trunk/BNC/src/bnccaster.h
r5524 r5528 41 41 42 42 public: 43 bncCaster( const QString& outFileName, int port);43 bncCaster(); 44 44 ~bncCaster(); 45 45 void addGetThread(bncGetThread* getThread, bool noNewThread = false); … … 66 66 void dumpEpochs(long minTime, long maxTime); 67 67 static int myWrite(QTcpSocket* sock, const char* buf, int bufLen); 68 void reopenOutFile(); 68 69 69 70 QFile* _outFile; -
trunk/BNC/src/bncmain.cpp
r5264 r5528 193 193 bncEphUploadCaster* casterEph = new bncEphUploadCaster(); (void) casterEph; 194 194 195 bncCaster* caster = new bncCaster(settings.value("outFile").toString(), 196 settings.value("outPort").toInt()); 195 bncCaster* caster = new bncCaster(); 197 196 198 197 BNC_CORE->setCaster(caster); -
trunk/BNC/src/bncwindow.cpp
r5376 r5528 2055 2055 enableStartStop(); 2056 2056 2057 _caster = new bncCaster(_outFileLineEdit->text(), 2058 _outPortLineEdit->text().toInt()); 2057 _caster = new bncCaster(); 2059 2058 2060 2059 BNC_CORE->setPort(_outEphPortLineEdit->text().toInt());
Note:
See TracChangeset
for help on using the changeset viewer.