Changeset 781 in ntrip
- Timestamp:
- Apr 8, 2008, 10:32:46 AM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r780 r781 166 166 if (pair->eph == 0) { 167 167 pair->eph = ep; 168 cout << "A: new eph: " << ep->prn.toAscii().data() << " " 169 << ep->GPSweek << " " << ep->TOC << endl; 168 170 } 169 171 else { 170 172 if (ep->GPSweek > pair->eph->GPSweek || 171 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; 172 176 delete pair->oldEph; 173 177 pair->oldEph = pair->eph; -
trunk/BNS/bnseph.cpp
r778 r781 72 72 gpsEph* ep = new gpsEph; 73 73 74 QByteArray line = _socket->readLine(); 75 QTextStream in1(line); 74 const int NUMLINES = 8; 76 75 77 int year, month, day, hour, minute, second;76 for (int ii = 1; ii <= NUMLINES; ii++) { 78 77 79 in1 >> ep->prn >> year >> month >> day >> hour >> minute >> second 80 >> ep->clock_bias >> ep->clock_drift >> ep->clock_driftrate; 78 if (!_socket->canReadLine()) { 79 _socket->waitForReadyRead(); 80 } 81 81 82 if (year < 100) year += 2000; 82 QByteArray line = _socket->readLine(); 83 QTextStream in(line); 83 84 84 QDateTime dateTime(QDate(year,month,day), QTime(hour, minute, second),85 Qt::UTC);86 double toc;87 GPSweekFromDateAndTime(dateTime, ep->GPSweek, toc);88 ep->TOC = int(floor(toc+0.5));89 90 line = _socket->readLine();91 QTextStream in2(line);92 in2 >> ep->IODE >> ep->Crs >> ep->Delta_n >> ep->M0;93 94 line = _socket->readLine();95 QTextStream in3(line);96 in3 >> ep->Cuc >> ep->e >> ep->Cus >> ep->sqrt_A;97 98 line = _socket->readLine();99 QTextStream in4(line);100 in4 >> ep->TOE >> ep->Cic >> ep->OMEGA0 >> ep->Cis;101 102 line = _socket->readLine();103 QTextStream in5(line);104 in5 >> ep->i0 >> ep->Crc >> ep->omega >> ep->OMEGADOT;105 106 line = _socket->readLine();107 QTextStream in6(line);108 109 double dd;110 int GPSweek;111 int ii;112 in6 >> ep->IDOT >> dd >> GPSweek >>ii;113 114 line = _socket->readLine();115 QTextStream in7(line);116 117 double hlp;118 double health;119 in7 >> hlp >> health >> ep->TGD >> ep->IODC;120 121 line = _socket->readLine();122 QTextStream in8(line);123 in8 >> ep->TOW;85 if (ii == 1) { 86 int year, month, day, hour, minute, second; 87 in >> ep->prn >> year >> month >> day >> hour >> minute >> second 88 >> ep->clock_bias >> ep->clock_drift >> ep->clock_driftrate; 89 90 if (year < 100) year += 2000; 91 92 QDateTime dateTime(QDate(year,month,day), QTime(hour, minute, second), 93 Qt::UTC); 94 double toc; 95 GPSweekFromDateAndTime(dateTime, ep->GPSweek, toc); 96 ep->TOC = int(floor(toc+0.5)); 97 } 98 else if (ii == 2) { 99 in >> ep->IODE >> ep->Crs >> ep->Delta_n >> ep->M0; 100 } 101 else if (ii == 3) { 102 in >> ep->Cuc >> ep->e >> ep->Cus >> ep->sqrt_A; 103 } 104 else if (ii == 4) { 105 in >> ep->TOE >> ep->Cic >> ep->OMEGA0 >> ep->Cis; 106 } 107 else if (ii == 5) { 108 in >> ep->i0 >> ep->Crc >> ep->omega >> ep->OMEGADOT; 109 } 110 else if (ii == 6) { 111 double dd; 112 int GPSweek; 113 int ii; 114 in >> ep->IDOT >> dd >> GPSweek >> ii; 115 } 116 else if (ii == 7) { 117 double hlp; 118 double health; 119 in >> hlp >> health >> ep->TGD >> ep->IODC; 120 } 121 else if (ii == 8) { 122 in >> ep->TOW; 123 } 124 } 124 125 125 126 emit(newEph(ep));
Note:
See TracChangeset
for help on using the changeset viewer.