Changeset 1197 in ntrip for trunk/BNS/bns.cpp
- Timestamp:
- Nov 15, 2008, 10:33:54 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r1123 r1197 289 289 void t_bns::readEpoch() { 290 290 291 QByteArray line = _clkSocket->readLine(); 292 293 if (_echoStream) { 294 *_echoStream << line; 295 _echoStream->flush(); 296 } 297 298 emit(newClkBytes(line.length())); 299 300 if (line.indexOf('*') == -1) { 291 // Read the first line (if not already read) 292 // ----------------------------------------- 293 if (_clkLine.indexOf('*') == -1) { 294 _clkLine = _clkSocket->readLine(); 295 if (_echoStream) { 296 *_echoStream << _clkLine; 297 _echoStream->flush(); 298 } 299 emit(newClkBytes(_clkLine.length())); 300 } 301 302 if (_clkLine.indexOf('*') == -1) { 301 303 return; 302 304 } 303 305 304 QTextStream in( line);306 QTextStream in(_clkLine); 305 307 306 308 QString hlp; 307 int GPSweek, numSat; 309 int year, month, day, hour, min; 310 double sec; 311 in >> hlp >> year >> month >> day >> hour >> min >> sec; 312 313 int GPSweek; 308 314 double GPSweeks; 309 315 310 in >> hlp >> GPSweek >> GPSweeks >> numSat; 311 312 if (numSat > 0) { 316 GPSweekFromYMDhms(year, month, day, hour, min, sec, GPSweek, GPSweeks); 317 318 QStringList prns; 319 320 // Loop over all satellites 321 // ------------------------ 322 QStringList lines; 323 for (;;) { 324 if (!_clkSocket->canReadLine()) { 325 return; 326 } 327 _clkLine = _clkSocket->readLine(); 328 if (_echoStream) { 329 *_echoStream << _clkLine; 330 _echoStream->flush(); 331 } 332 if (_clkLine[0] == '*') { 333 return; 334 } 335 if (_clkLine[0] == 'P') { 336 _clkLine.remove(0,1); 337 lines.push_back(_clkLine); 338 } 339 } 340 341 if (lines.size() > 0) { 313 342 314 343 QStringList prns; … … 328 357 co.SatRefDatum = DATUM_ITRF; 329 358 330 for (int ii = 1; ii <= numSat; ii++) {331 359 for (int ii = 0; ii < lines.size(); ii++) { 360 332 361 QString prn; 333 362 ColumnVector xx(5); … … 335 364 336 365 if (oldEph == 0 && ic == 0) { 337 line = _clkSocket->readLine(); 338 339 if (_echoStream) { 340 *_echoStream << line; 341 _echoStream->flush(); 342 } 343 344 QTextStream in(line); 366 QTextStream in(lines[ii].toAscii()); 345 367 in >> prn; 346 368 prns << prn; 347 369 if ( _ephList.contains(prn) ) { 348 in >> xx(1) >> xx(2) >> xx(3) >> xx(4) >> xx(5); xx(4) *= 1e-6;349 350 //// beg test (zero clock correction for Gerhard Wuebbena)351 //// xx(4) -= xx(5) / 299792458.0;352 //// end test370 in >> xx(1) >> xx(2) >> xx(3) >> xx(4); 371 xx(1) *= 1e3; 372 xx(2) *= 1e3; 373 xx(3) *= 1e3; 374 xx(4) *= 1e-6; 353 375 354 376 t_ephPair* pair = _ephList[prn]; … … 358 380 } 359 381 else { 360 prn = prns[ii -1];382 prn = prns[ii]; 361 383 if ( _ephList.contains(prn) ) { 362 384 t_ephPair* pair = _ephList[prn];
Note:
See TracChangeset
for help on using the changeset viewer.