Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNS/bns.cpp ¶
r781 r784 116 116 } 117 117 118 // 119 //////////////////////////////////////////////////////////////////////////// 120 void t_bns::slotNewEph(gpsEph* ep) { 121 122 QMutexLocker locker(&_mutex); 123 124 t_ephPair* pair; 125 if ( !_ephList.contains(ep->prn) ) { 126 pair = new t_ephPair(); 127 _ephList.insert(ep->prn, pair); 128 } 129 else { 130 pair = _ephList[ep->prn]; 131 } 132 133 if (pair->eph == 0) { 134 pair->eph = ep; 135 } 136 else { 137 if (ep->GPSweek > pair->eph->GPSweek || 138 (ep->GPSweek == pair->eph->GPSweek && ep->TOC > pair->eph->TOC)) { 139 delete pair->oldEph; 140 pair->oldEph = pair->eph; 141 pair->eph = ep; 142 } 143 else { 144 delete ep; 145 } 146 } 147 } 148 118 149 // Start 119 150 //////////////////////////////////////////////////////////////////////////// … … 141 172 while (true) { 142 173 if (_clkSocket) { 143 174 if (_clkSocket->state() != QAbstractSocket::ConnectedState) { 175 delete _clkSocket; 176 _clkSocket = 0; 177 continue; 178 } 179 if (!_clkSocket->canReadLine()) { 180 _clkSocket->waitForReadyRead(); 181 } 182 else { 183 readEpoch(); 184 } 144 185 } 145 186 else { … … 151 192 // 152 193 //////////////////////////////////////////////////////////////////////////// 153 void t_bns::slotNewEph(gpsEph* ep) { 154 155 QMutexLocker locker(&_mutex); 156 157 t_ephPair* pair; 158 if ( !_ephList.contains(ep->prn) ) { 159 pair = new t_ephPair(); 160 _ephList.insert(ep->prn, pair); 161 } 162 else { 163 pair = _ephList[ep->prn]; 164 } 165 166 if (pair->eph == 0) { 167 pair->eph = ep; 168 cout << "A: new eph: " << ep->prn.toAscii().data() << " " 169 << ep->GPSweek << " " << ep->TOC << endl; 170 } 171 else { 172 if (ep->GPSweek > pair->eph->GPSweek || 173 (ep->GPSweek == pair->eph->GPSweek && ep->TOC > pair->eph->TOC)) { 174 cout << "B: new eph: " << ep->prn.toAscii().data() << " " 175 << ep->GPSweek << " " << ep->TOC << endl; 176 delete pair->oldEph; 177 pair->oldEph = pair->eph; 178 pair->eph = ep; 179 } 180 else { 181 delete ep; 182 } 183 } 184 } 194 void t_bns::readEpoch() { 195 196 QByteArray line = _clkSocket->readLine(); 197 if (line.indexOf('*') == -1) { 198 return; 199 } 200 201 QTextStream in(line); 202 203 QString hlp; 204 int mjd, numSat; 205 double sec; 206 207 in >> hlp >> mjd >> sec >> numSat; 208 209 for (int ii = 1; ii <= numSat; ii++) { 210 if (!_clkSocket->canReadLine()) { 211 _clkSocket->waitForReadyRead(); 212 } 213 line = _clkSocket->readLine(); 214 QTextStream in(line); 215 216 QString prn; 217 ColumnVector xx(4); 218 219 in >> prn >> xx(1) >> xx(2) >> xx(3) >> xx(4); 220 221 processSatellite(mjd, sec, prn, xx); 222 } 223 } 224 225 // 226 //////////////////////////////////////////////////////////////////////////// 227 void t_bns::processSatellite(int mjd, double sec, const QString& prn, 228 const ColumnVector& xx) { 229 230 } -
TabularUnified trunk/BNS/bns.h ¶
r778 r784 1 1 #ifndef BNS_H 2 2 #define BNS_H 3 4 #include <newmat.h> 3 5 4 6 #include <QtNetwork> … … 43 45 void deleteBnsEph(); 44 46 void openCaster(); 47 void readEpoch(); 48 void processSatellite(int mjd, double sec, const QString& prn, 49 const ColumnVector& xx); 50 45 51 QTcpServer* _clkServer; 46 52 QTcpSocket* _clkSocket; -
TabularUnified trunk/BNS/bns.pro ¶
r773 r784 9 9 unix:QMAKE_CFLAGS_RELEASE -= -O2 10 10 unix:QMAKE_CXXFLAGS_RELEASE -= -O2 11 12 # Location of the NewMat Library 13 # ------------------------------ 14 unix:NEWMAT_ROOT = $$(NEWMAT_ROOT) 15 win32:NEWMAT_ROOT = ../../Source/newmat 11 16 12 17 # Get rid of mingwm10.dll … … 21 26 release:MOC_DIR=.moc/release 22 27 28 # Include Path and additional Libraries 29 # ------------------------------------- 30 INCLUDEPATH = . $$NEWMAT_ROOT/include 31 LIBS = -L$$NEWMAT_ROOT/lib -lnewmat 32 23 33 HEADERS = bns.h bnswindow.h bnshlpdlg.h bnshtml.h \ 24 34 bnseph.h bnsutils.h
Note:
See TracChangeset
for help on using the changeset viewer.