- Timestamp:
- Sep 2, 2008, 1:29:07 AM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnseph.cpp
r1083 r1089 29 29 30 30 _socket = 0; 31 32 QSettings settings; 33 34 QIODevice::OpenMode oMode; 35 if (Qt::CheckState(settings.value("fileAppend").toInt()) == Qt::Checked) { 36 oMode = QIODevice::WriteOnly | QIODevice::Unbuffered | QIODevice::Append; 37 } 38 else { 39 oMode = QIODevice::WriteOnly | QIODevice::Unbuffered; 40 } 41 42 // Echo ephemeris into a file 43 // --------------------------- 44 QString echoFileName = settings.value("ephEcho").toString(); 45 if (echoFileName.isEmpty()) { 46 _echoFile = 0; 47 _echoStream = 0; 48 } 49 else { 50 _echoFile = new QFile(echoFileName); 51 if (_echoFile->open(oMode)) { 52 _echoStream = new QTextStream(_echoFile); 53 } 54 else { 55 _echoStream = 0; 56 } 57 } 31 58 } 32 59 … … 35 62 t_bnseph::~t_bnseph() { 36 63 delete _socket; 64 delete _echoStream; 65 delete _echoFile; 37 66 } 38 67 … … 87 116 t_eph* eph = 0; 88 117 QByteArray line = waitForLine(_socket); 118 119 if (_echoStream) { 120 *_echoStream << line; 121 _echoStream->flush(); 122 } 123 89 124 nBytes += line.length(); 90 125 … … 109 144 for (int ii = 2; ii <= numlines; ii++) { 110 145 QByteArray line = waitForLine(_socket); 146 147 if (_echoStream) { 148 *_echoStream << line; 149 _echoStream->flush(); 150 } 151 111 152 nBytes += line.length(); 112 153 lines << line; -
trunk/BNS/bnseph.h
r1058 r1089 116 116 void readEph(); 117 117 QTcpSocket* _socket; 118 QFile* _echoFile; 119 QTextStream* _echoStream; 118 120 }; 119 121 #endif -
trunk/BNS/bnswindow.cpp
r1085 r1089 160 160 _ephPortLineEdit->setWhatsThis(tr("BNS reads Broadcast Ephemeris in RINEX Version 3 Navigation file format from an IP address. Specify the IP port e.g. of a BNC installation providing this information.")); 161 161 _ephPortLineEdit->setMaximumWidth(9*ww); 162 _ephEchoLineEdit = new QLineEdit(settings.value("ephEcho").toString()); 163 _ephEchoLineEdit->setWhatsThis(tr("Specify the full path to a file where incoming Broadcast Ephemeris are saved. Beware that the size of this file can rapidly increase. Default is an empty option field meaning that incoming Broadcast Ephemeris are not saved.")); 162 164 163 165 _clkPortLineEdit = new QLineEdit(settings.value("clkPort").toString()); … … 294 296 layout_eph->addWidget(new QLabel("Port"), 1, 0); 295 297 layout_eph->addWidget(_ephPortLineEdit, 1, 1); 296 layout_eph->addWidget(new QLabel("Read broadcast ephemeris."), 2, 0, 1, 2, Qt::AlignLeft); 297 layout_eph->addWidget(new QLabel(""), 3, 0); 298 layout_eph->addWidget(new QLabel("Save (full path)"), 2, 0); 299 layout_eph->addWidget(_ephEchoLineEdit, 2, 1); 300 layout_eph->addWidget(new QLabel("Read broadcast ephemeris."), 3, 0, 1, 2, Qt::AlignLeft); 301 layout_eph->addWidget(new QLabel(""), 4, 0); 298 302 299 303 tab_eph->setLayout(layout_eph); … … 535 539 settings.setValue("ephHost", _ephHostLineEdit->text()); 536 540 settings.setValue("ephPort", _ephPortLineEdit->text()); 541 settings.setValue("ephEcho", _ephEchoLineEdit->text()); 537 542 settings.setValue("clkPort", _clkPortLineEdit->text()); 538 543 settings.setValue("outHost", _outHostLineEdit->text()); -
trunk/BNS/bnswindow.h
r1083 r1089 75 75 QLineEdit* _ephHostLineEdit; 76 76 QLineEdit* _ephPortLineEdit; 77 QLineEdit* _ephEchoLineEdit; 77 78 QLineEdit* _clkPortLineEdit; 78 79 QLineEdit* _logFileLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.