- Timestamp:
- Mar 22, 2011, 10:57:19 AM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bncapp.cpp ¶
r3034 r3109 751 751 752 752 bncSettings settings; 753 _waitCoTime 754 if (_waitCoTime < 1) {755 _waitCoTime = 1;753 _waitCoTime = settings.value("corrTime").toInt(); 754 if (_waitCoTime < 0) { 755 _waitCoTime = 0; 756 756 } 757 757 … … 764 764 // An old correction - throw it away 765 765 // --------------------------------- 766 if (coTime <= _lastDumpCoSec) { 766 if (_waitCoTime > 0 && coTime <= _lastDumpCoSec) { 767 767 if (!_bncComb) { 768 768 QString line = staID + ": Correction for one sat neglected because overaged by " + … … 779 779 // Dump Corrections 780 780 // ---------------- 781 if (coTime - _waitCoTime > _lastDumpCoSec) { 781 if (_waitCoTime == 0) { 782 dumpCorrs(); 783 } 784 else if (coTime - _waitCoTime > _lastDumpCoSec) { 782 785 dumpCorrs(_lastDumpCoSec + 1, coTime - _waitCoTime); 783 786 _lastDumpCoSec = coTime - _waitCoTime; … … 788 791 //////////////////////////////////////////////////////////////////////////// 789 792 void bncApp::dumpCorrs(long minTime, long maxTime) { 790 791 793 for (long sec = minTime; sec <= maxTime; sec++) { 792 794 QList<QString> allCorrs = _corrs->values(sec); 793 emit newCorrections(allCorrs); 794 if (_socketsCorr) { 795 QListIterator<QString> it(allCorrs); 796 while (it.hasNext()) { 797 QString corrLine = it.next() + "\n"; 798 799 QMutableListIterator<QTcpSocket*> is(*_socketsCorr); 800 while (is.hasNext()) { 801 QTcpSocket* sock = is.next(); 802 if (sock->state() == QAbstractSocket::ConnectedState) { 803 if (sock->write(corrLine.toAscii()) == -1) { 804 delete sock; 805 is.remove(); 806 } 807 } 808 else if (sock->state() != QAbstractSocket::ConnectingState) { 795 dumpCorrs(allCorrs); 796 _corrs->remove(sec); 797 } 798 } 799 800 // Dump all corrections 801 //////////////////////////////////////////////////////////////////////////// 802 void bncApp::dumpCorrs() { 803 } 804 805 // Dump List of Corrections 806 //////////////////////////////////////////////////////////////////////////// 807 void bncApp::dumpCorrs(const QList<QString>& allCorrs) { 808 emit newCorrections(allCorrs); 809 if (_socketsCorr) { 810 QListIterator<QString> it(allCorrs); 811 while (it.hasNext()) { 812 QString corrLine = it.next() + "\n"; 813 814 QMutableListIterator<QTcpSocket*> is(*_socketsCorr); 815 while (is.hasNext()) { 816 QTcpSocket* sock = is.next(); 817 if (sock->state() == QAbstractSocket::ConnectedState) { 818 if (sock->write(corrLine.toAscii()) == -1) { 809 819 delete sock; 810 820 is.remove(); 811 821 } 812 822 } 823 else if (sock->state() != QAbstractSocket::ConnectingState) { 824 delete sock; 825 is.remove(); 826 } 813 827 } 814 828 } 815 _corrs->remove(sec);816 829 } 817 830 } -
TabularUnified trunk/BNC/bncapp.h ¶
r3027 r3109 82 82 const QByteArray& allLines); 83 83 void dumpCorrs(long minTime, long maxTime); 84 void dumpCorrs(); 85 void dumpCorrs(const QList<QString>& allCorrs); 84 86 void messagePrivate(const QByteArray& msg); 85 87 -
TabularUnified trunk/BNC/bncwindow.cpp ¶
r3083 r3109 206 206 _corrPortLineEdit = new QLineEdit(settings.value("corrPort").toString()); 207 207 _corrTimeSpinBox = new QSpinBox(); 208 _corrTimeSpinBox->setMinimum( 1);208 _corrTimeSpinBox->setMinimum(0); 209 209 _corrTimeSpinBox->setMaximum(60); 210 210 _corrTimeSpinBox->setSingleStep(1);
Note:
See TracChangeset
for help on using the changeset viewer.