55 using namespace StringUtils;
61 xmitTime(0), weeknum(0), accuracy(0), health(0), codeflgs(0),
62 L2Pdata(0), IODC(0), IODE(0), TauN(0), GammaN(0), MFTraw(0),
63 MFtime(0), freqNum(0), ageOfInfo(0), datasources(0), IODnav(0),
64 accCode(0), IODN(0), Toc(0), af0(0), af1(0), af2(0), Tgd(0), Tgd2(0),
65 Cuc(0), Cus(0), Crc(0), Crs(0), Cic(0), Cis(0), Toe(0), M0(0), dn(0),
66 ecc(0), Ahalf(0), OMEGA0(0), i0(0), w(0), OMEGAdot(0), idot(0),
67 px(0), py(0), pz(0), vx(0), vy(0), vz(0), ax(0), ay(0), az(0)
204 catch(std::exception& e)
206 FFStreamError fse(
string(
"std::exception reading header ") +
210 catch(FFStreamError& fse)
220 for(
int i=1; i<=3; i++)
getRecord(i, strm);
229 for(
int i=4; i<=7; i++)
235 catch(std::exception& e)
237 FFStreamError fse(
string(
"std::exception: ") + e.what());
240 catch(FFStreamError& fse)
244 catch(StringException&
se)
262 for(
int i=1; i<=3; i++)
276 for(
int i=4; i<=7; i++)
282 catch(std::exception& e)
284 FFStreamError fse(
string(
"std::exception: ") + e.what());
287 catch(FFStreamError& fse)
291 catch(StringException&
se)
302 s <<
"Rinex3NavData dump: "
303 <<
satSys << setfill(
'0') << setw(2) <<
PRNID << setfill(
' ')
305 << fixed << setprecision(3)
307 s <<
" Toc " <<
Toc << scientific << setprecision(12)
308 <<
" af0 " <<
af0 <<
" af1 " <<
af1 <<
" af2 " <<
af2
309 <<
" Tgd " <<
Tgd <<
" Tgd2 " <<
Tgd2 << endl;
311 s <<
" M0 " <<
M0 <<
" Ecc " <<
ecc <<
" sqrtA " <<
Ahalf <<
" OM "
313 s <<
" i0 " <<
i0 <<
" om " <<
w <<
" dOMdt " <<
OMEGAdot <<
" didt "
315 s <<
" Cuc " <<
Cuc <<
" Cus " <<
Cus <<
" Crc " <<
Crc <<
" Crs " <<
Crs
316 <<
" Cic " <<
Cic <<
" Cis " <<
Cis << endl;
322 <<
" IODE " <<
IODE <<
" IODC " <<
IODC
338 << setfill(
'0') << setw(2) <<
PRNID << setfill(
' ');
342 s <<
" TOE: " << setw(4) <<
weeknum
343 <<
" " << fixed << setw(10) << setprecision(3) <<
Toe.
val
344 <<
" TOC: " <<
printTime(
time,
"%4Y %02m %02d %02H %02M %06.3f %P")
345 <<
" xmitTime: " << setw(6) <<
xmitTime
346 <<
" IODE/C: " << int(
IODE) <<
"/" << int(
IODC)
354 s <<
" freq: " << setw(2) <<
freqNum
355 <<
" hlth: " << setw(2) <<
health
357 <<
" MFtime: " << setw(6) <<
MFtime
358 <<
" TauN: " << scientific << setw(19) << setprecision(12)
361 <<
" AOI: " << fixed << setprecision(2) << setw(4) <<
ageOfInfo.
val;
366 s <<
" URAm: " << setw(2) <<
freqNum
367 <<
" hlth: " << setw(2) <<
health
369 <<
" MFtime: " << setw(6) <<
MFtime
370 <<
" aGf0: " << scientific << setw(19) << setprecision(12)
373 <<
" IODN " << fixed << setprecision(2) << setw(4) <<
ageOfInfo.
val;
378 s <<
" TOE: " << setw(4) <<
weeknum
379 <<
" " << fixed << setw(10) << setprecision(3) <<
Toe.
val
380 <<
" TOC: " <<
printTime(
time,
"%4Y %02m %02d %02H %02M %06.3f %P")
381 <<
" xmitTime: " << setw(6) <<
xmitTime
388 s <<
" TOE: " << setw(4) <<
weeknum
389 <<
" " << fixed << setw(10) << setprecision(3) <<
Toe.
val
390 <<
" TOC: " <<
printTime(
time,
"%4Y %02m %02d %02H %02M %06.3f %P")
391 <<
" xmitTime: " << setw(6) <<
xmitTime
392 <<
" IODE/C: " << int(
IODE) <<
"/" << int(
IODC);
396 s <<
" (unknown system: " <<
satSys <<
")";
427 ee.
IODC = short(IODC);
433 bool healthy =
false;
434 if (health == 0) healthy =
true;
439 double timeDiff =toc - ee.
HOWtime[0];
441 if (timeDiff < -
HALFWEEK) epochWeek++;
442 else if (timeDiff >
HALFWEEK) epochWeek--;
451 accFlag, healthy, af0, af1, af2);
453 ee.
IODE = short(IODE);
454 ee.
fitint = (fitint > 4) ? 1 : 0;
458 double A = Ahalf * Ahalf;
463 long beginFitSOW = Toe - (fitHours/2)*3600.0;
464 long endFitSOW = Toe + (fitHours/2)*3600.0;
484 ee.
orbit.
loadData( satSys, obsID, PRNID, beginFit, endFit, toeCT,
485 accFlag, healthy, Cuc, Cus, Crc, Crs, Cic, Cis,
486 M0, dn, dndot, ecc, A, Ahalf, Adot, OMEGA0, i0,
556 <<
printTime(civtime,
"%4Y %02m %02d %02H %02M %02S");
561 strm << right << setw(2) <<
PRNID <<
' '
562 <<
printTime(civtime,
"%02y %2m %2d %2H %2M %4.1f");
586 if (nline < 1 || nline > 7)
588 FFStreamError fse(
string(
"Invalid line number ") +
asString(nline));
735 catch (std::exception &e)
737 FFStreamError
err(
"std::exception: " +
string(e.what()));
760 GNSSTK_THROW(FFStreamError(
"Badly formatted epoch line"));
761 for(i = 8; i <= 20; i += 3)
765 GNSSTK_THROW(FFStreamError(
"Badly formatted epoch line"));
769 satSys = line.substr(0,1);
773 yr =
asInt(line.substr( 4,4));
774 mo =
asInt(line.substr( 9,2));
776 hr =
asInt(line.substr(15,2));
783 for(i=2; i <= 17; i+=3)
787 GNSSTK_THROW(FFStreamError(
"Badly formatted epoch line"));
795 yr =
asInt(line.substr( 2,3));
799 mo =
asInt(line.substr( 5,3));
801 hr =
asInt(line.substr(11,3));
835 af0 = line.substr(22,19);
836 af1 = line.substr(41,19);
837 af2 = line.substr(60,19);
841 TauN = line.substr(22,19);
842 GammaN = line.substr(41,19);
854 af0 = line.substr(23,19);
855 af1 = line.substr(42,19);
856 af2 = line.substr(61,19);
860 TauN = line.substr(23,19);
861 GammaN = line.substr(42,19);
865 catch (std::exception &e)
867 FFStreamError
err(
"std::exception: " +
string(e.what()));
875 if (nline < 1 || nline > 7)
877 FFStreamError fse(
string(
"Invalid line number ") +
asString(nline));
891 IODE = line.substr(n,19); n+=19;
892 Crs = line.substr(n,19); n+=19;
893 dn = line.substr(n,19); n+=19;
894 M0 = line.substr(n,19);
898 IODnav = line.substr(n,19); n+=19;
899 Crs = line.substr(n,19); n+=19;
900 dn = line.substr(n,19); n+=19;
901 M0 = line.substr(n,19);
905 px = line.substr(n,19); n+=19;
906 vx = line.substr(n,19); n+=19;
907 ax = line.substr(n,19); n+=19;
917 Cuc = line.substr(n,19); n+=19;
918 ecc = line.substr(n,19); n+=19;
919 Cus = line.substr(n,19); n+=19;
920 Ahalf = line.substr(n,19);
924 py = line.substr(n,19); n+=19;
925 vy = line.substr(n,19); n+=19;
926 ay = line.substr(n,19); n+=19;
943 Toe = line.substr(n,19); n+=19;
944 Cic = line.substr(n,19); n+=19;
945 OMEGA0 = line.substr(n,19); n+=19;
946 Cis = line.substr(n,19);
950 pz = line.substr(n,19); n+=19;
951 vz = line.substr(n,19); n+=19;
952 az = line.substr(n,19); n+=19;
959 IODN = line.substr(n,19);
966 i0 = line.substr(n,19); n+=19;
967 Crc = line.substr(n,19); n+=19;
968 w = line.substr(n,19); n+=19;
976 idot = line.substr(n,19); n+=19;
983 idot = line.substr(n,19); n+=19;
994 accuracy = line.substr(n,19); n+=19;
996 Tgd = line.substr(n,19); n+=19;
997 IODC = line.substr(n,19);
1001 accuracy = line.substr(n,19); n+=19;
1003 Tgd = line.substr(n,19); n+=19;
1004 Tgd2 = line.substr(n,19);
1008 accuracy = line.substr(n,19); n+=19;
1010 Tgd = line.substr(n,19); n+=19;
1011 Tgd2 = line.substr(n,19);
1015 else if (nline == 7)
1020 IODC = line.substr(n,19); n+=19;
1024 fitint = line.substr(n,19); n+=19;
1041 catch (std::exception &e)
1043 FFStreamError
err(
"std::exception: " +
string(e.what()));