Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r863 r872 312 312 in >> hlp >> GPSweek >> GPSweeks >> numSat; 313 313 314 if (numSat > 0) { 315 316 struct ClockOrbit co; 317 memset(&co, 0, sizeof(co)); 318 co.GPSEpochTime = (int)GPSweeks; 319 co.ClockDataSupplied = 1; 320 co.OrbitDataSupplied = 1; 321 co.SatRefPoint = POINT_CENTER; 322 co.SatRefDatum = DATUM_ITRF; 323 324 for (int ii = 1; ii <= numSat; ii++) { 325 line = _clkSocket->readLine(); 314 for (int oldEph = 0; oldEph <= 1; oldEph++) { 315 if (numSat > 0) { 326 316 327 QTextStream in(line); 317 struct ClockOrbit co; 318 memset(&co, 0, sizeof(co)); 319 co.GPSEpochTime = (int)GPSweeks; 320 co.ClockDataSupplied = 1; 321 co.OrbitDataSupplied = 1; 322 co.SatRefPoint = POINT_CENTER; 323 co.SatRefDatum = DATUM_ITRF; 328 324 329 QString prn; 330 ColumnVector xx(4); 325 for (int ii = 1; ii <= numSat; ii++) { 326 line = _clkSocket->readLine(); 327 328 QTextStream in(line); 329 330 QString prn; 331 ColumnVector xx(4); 332 333 in >> prn >> xx(1) >> xx(2) >> xx(3) >> xx(4); 334 xx(4) *= 1e-6; 335 336 gpsEph* ep = 0; 337 if ( _ephList.contains(prn) ) { 338 t_ephPair* pair = _ephList[prn]; 339 if (oldEph == 1) { 340 ep = pair->oldEph; 341 } 342 else { 343 ep = pair->eph; 344 } 345 } 346 347 if (ep != 0) { 348 struct ClockOrbit::SatData* sd = 0; 349 if (prn[0] == 'G') { 350 sd = co.Sat + co.NumberOfGPSSat; 351 ++co.NumberOfGPSSat; 352 } 353 else if (prn[0] == 'R') { 354 sd = co.Sat + CLOCKORBIT_NUMGPS + co.NumberOfGLONASSSat; 355 ++co.NumberOfGLONASSSat; 356 } 357 processSatellite(ep, GPSweek, GPSweeks, prn, xx, sd); 358 } 359 } 331 360 332 in >> prn >> xx(1) >> xx(2) >> xx(3) >> xx(4); 333 xx(4) *= 1e-6; 334 335 struct ClockOrbit::SatData* sd = 0; 336 if (prn[0] == 'G') { 337 sd = co.Sat + co.NumberOfGPSSat; 338 ++co.NumberOfGPSSat; 361 if ( _outSocket && 362 (co.NumberOfGPSSat > 0 || co.NumberOfGLONASSSat > 0) ) { 363 char obuffer[CLOCKORBIT_BUFFERSIZE]; 364 int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer)); 365 if (len > 0) { 366 _outSocket->write(obuffer, len); 367 _outSocket->flush(); 368 } 339 369 } 340 else if (prn[0] == 'R') {341 sd = co.Sat + CLOCKORBIT_NUMGPS + co.NumberOfGLONASSSat;342 ++co.NumberOfGLONASSSat;343 }344 345 processSatellite(GPSweek, GPSweeks, prn, xx, sd);346 }347 348 if (_outSocket) {349 char obuffer[CLOCKORBIT_BUFFERSIZE];350 int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));351 if (len > 0) {352 _outSocket->write(obuffer, len);353 _outSocket->flush();354 }355 370 } 356 371 } … … 359 374 // 360 375 //////////////////////////////////////////////////////////////////////////// 361 void t_bns::processSatellite( int GPSweek, double GPSweeks, const QString& prn,362 const ColumnVector& xx,376 void t_bns::processSatellite(gpsEph* ep, int GPSweek, double GPSweeks, 377 const QString& prn, const ColumnVector& xx, 363 378 struct ClockOrbit::SatData* sd) { 364 365 // No broadcast ephemeris available366 // --------------------------------367 if ( !_ephList.contains(prn) ) {368 return;369 }370 371 t_ephPair* pair = _ephList[prn];372 gpsEph* ep = pair->eph;373 379 374 380 ColumnVector xB(4); -
trunk/BNS/bns.h
r863 r872 54 54 void openCaster(); 55 55 void readEpoch(); 56 void processSatellite(int GPSweek, double GPSweeks, const QString& prn, 57 const ColumnVector& xx, struct ClockOrbit::SatData* sd); 56 void processSatellite(gpsEph* ep, int GPSweek, double GPSweeks, 57 const QString& prn, const ColumnVector& xx, 58 struct ClockOrbit::SatData* sd); 58 59 59 60 QTcpServer* _clkServer;
Note:
See TracChangeset
for help on using the changeset viewer.