- Timestamp:
- Jul 26, 2008, 10:33:00 AM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncapp.cpp
r975 r976 623 623 _corrs->insert(coTime, QString(line + " " + staID)); 624 624 625 QMutableListIterator<QTcpSocket*> is(*_socketsCorr); 626 while (is.hasNext()) { 627 QTcpSocket* sock = is.next(); 628 if (sock->state() == QAbstractSocket::ConnectedState) { 629 if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) { 630 delete sock; 631 is.remove(); 632 } 633 } 634 else if (sock->state() != QAbstractSocket::ConnectingState) { 635 delete sock; 636 is.remove(); 637 } 638 } 639 } 625 // Dump Corrections 626 // ---------------- 627 if (coTime - _waitCoTime > _lastDumpCoSec) { 628 dumpCorrs(_lastDumpCoSec + 1, coTime - _waitCoTime); 629 _lastDumpCoSec = coTime - _waitCoTime; 630 } 631 } 632 633 // Dump Complete Correction Epochs 634 //////////////////////////////////////////////////////////////////////////// 635 void bncApp::dumpCorrs(long minTime, long maxTime) { 636 637 for (long sec = minTime; sec <= maxTime; sec++) { 638 QList<QString> allCorrs = _corrs->values(sec); 639 QListIterator<QString> it(allCorrs); 640 while (it.hasNext()) { 641 QString corrLine = it.next() + "\n"; 642 643 QMutableListIterator<QTcpSocket*> is(*_socketsCorr); 644 while (is.hasNext()) { 645 QTcpSocket* sock = is.next(); 646 if (sock->state() == QAbstractSocket::ConnectedState) { 647 if (sock->write(corrLine.toAscii()) == -1) { 648 delete sock; 649 is.remove(); 650 } 651 } 652 else if (sock->state() != QAbstractSocket::ConnectingState) { 653 delete sock; 654 is.remove(); 655 } 656 } 657 } 658 _corrs->remove(sec); 659 } 660 } -
trunk/BNC/bncapp.h
r975 r976 60 60 const QString& lineV3, 61 61 const QByteArray& allLines); 62 void dumpCorrs(long minTime, long maxTime); 62 63 63 64 QFile* _logFile;
Note:
See TracChangeset
for help on using the changeset viewer.