Changeset 7681 in ntrip
- Timestamp:
- Jan 12, 2016, 12:46:13 PM (9 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccaster.cpp
r7386 r7681 35 35 * Created: 24-Dec-2005 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 60 60 bncSettings settings; 61 61 62 connect(this, SIGNAL(newMessage(QByteArray,bool)), 62 connect(this, SIGNAL(newMessage(QByteArray,bool)), 63 63 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 64 64 … … 159 159 // ------------------ 160 160 obs._staID = staID.data(); 161 161 162 162 // Output into the socket 163 163 // ---------------------- 164 164 if (_uSockets) { 165 165 166 166 ostringstream oStr; 167 167 oStr.setf(ios::showpoint | ios::fixed); 168 oStr << obs._staID << " " 168 oStr << obs._staID << " " 169 169 << setw(4) << obs._time.gpsw() << " " 170 170 << setw(14) << setprecision(7) << obs._time.gpssec() << " " 171 171 << bncRinex::asciiSatLine(obs) << endl; 172 172 173 173 string hlpStr = oStr.str(); 174 174 175 175 QMutableListIterator<QTcpSocket*> is(*_uSockets); 176 176 while (is.hasNext()) { … … 189 189 } 190 190 } 191 191 192 192 // First time: set the _lastDumpTime 193 193 // --------------------------------- … … 195 195 _lastDumpTime = obs._time - 1.0; 196 196 } 197 197 198 198 // An old observation - throw it away 199 199 // ---------------------------------- … … 201 201 if (index == 1) { 202 202 bncSettings settings; 203 if ( !settings.value("outFile").toString().isEmpty() || 204 !settings.value("outPort").toString().isEmpty() ) { 203 if ( !settings.value("outFile").toString().isEmpty() || 204 !settings.value("outPort").toString().isEmpty() ) { 205 205 emit( newMessage(QString("%1: Old epoch %2 thrown away") 206 206 .arg(staID.data()).arg(string(obs._time).c_str()) … … 210 210 continue; 211 211 } 212 212 213 213 // Save the observation 214 214 // -------------------- 215 _epochs[obs._time]. push_back(obs);215 _epochs[obs._time].append(obs); 216 216 217 217 // Dump Epochs … … 254 254 this, SLOT(slotNewRawData(QByteArray, QByteArray))); 255 255 256 connect(getThread, SIGNAL(getThreadFinished(QByteArray)), 256 connect(getThread, SIGNAL(getThreadFinished(QByteArray)), 257 257 this, SLOT(slotGetThreadFinished(QByteArray))); 258 258 … … 302 302 int sec = int(nint(epoTime.gpssec())); 303 303 if ( (_out || _sockets) && (_samplingRate == 0 || sec % _samplingRate == 0) ) { 304 304 305 305 QListIterator<t_satObs> it(allObs); 306 306 bool firstObs = true; 307 307 while (it.hasNext()) { 308 308 const t_satObs& obs = it.next(); 309 309 310 310 ostringstream oStr; 311 311 oStr.setf(ios::showpoint | ios::fixed); 312 if (firstObs) { 312 if (firstObs) { 313 313 firstObs = false; 314 oStr << "> " << obs._time.gpsw() << ' ' 314 oStr << "> " << obs._time.gpsw() << ' ' 315 315 << setprecision(7) << obs._time.gpssec() << endl; 316 316 } 317 317 oStr << obs._staID << ' ' << bncRinex::asciiSatLine(obs) << endl; 318 if (!it.hasNext()) { 318 if (!it.hasNext()) { 319 319 oStr << endl; 320 320 } 321 321 string hlpStr = oStr.str(); 322 322 323 323 // Output into the File 324 324 // -------------------- … … 327 327 _out->flush(); 328 328 } 329 329 330 330 // Output into the socket 331 331 // ---------------------- … … 335 335 QTcpSocket* sock = is.next(); 336 336 if (sock->state() == QAbstractSocket::ConnectedState) { 337 int numBytes = hlpStr.length(); 337 int numBytes = hlpStr.length(); 338 338 if (myWrite(sock, hlpStr.c_str(), numBytes) != numBytes) { 339 339 delete sock; … … 408 408 QByteArray nmea = hlp[5].toAscii(); 409 409 QByteArray ntripVersion = hlp[6].toAscii(); 410 411 bncGetThread* getThread = new bncGetThread(url, format, latitude, 410 411 bncGetThread* getThread = new bncGetThread(url, format, latitude, 412 412 longitude, nmea, ntripVersion); 413 413 addGetThread(getThread); … … 486 486 } 487 487 488 // 488 // 489 489 //////////////////////////////////////////////////////////////////////////// 490 490 int bncCaster::myWrite(QTcpSocket* sock, const char* buf, int bufLen) { … … 498 498 } 499 499 500 // 500 // 501 501 //////////////////////////////////////////////////////////////////////////// 502 502 void bncCaster::reopenOutFile() { … … 510 510 delete _out; 511 511 delete _outFile; 512 _outFile = new QFile(outFileName); 512 _outFile = new QFile(outFileName); 513 513 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) { 514 514 _outFile->open(QIODevice::WriteOnly | QIODevice::Append); … … 536 536 if (sock->state() == QAbstractSocket::ConnectedState) { 537 537 sock->write(data); 538 } 538 } 539 539 else if (sock->state() != QAbstractSocket::ConnectingState) { 540 540 delete sock; 541 541 is.remove(); 542 } 543 } 544 } 542 } 543 } 544 } 545 545 } 546 546 -
trunk/BNC/src/bncwindow.cpp
r7676 r7681 1414 1414 //////////////////////////////////////////////////////////////////////////// 1415 1415 bncWindow::~bncWindow() { 1416 delete _caster; BNC_CORE->setCaster(0); 1417 delete _casterEph; 1416 if (_caster) { 1417 delete _caster; BNC_CORE->setCaster(0); 1418 } 1419 if (_casterEph) { 1420 delete _casterEph; 1421 } 1418 1422 delete _bncFigureLate; 1419 1423 delete _bncFigurePPP;
Note:
See TracChangeset
for help on using the changeset viewer.