55 bool PNBGalINavDataFactory ::
59 if ((navIn->getNavID().navType != NavType::GalINAV) ||
60 (navIn->getNumBits() != 128))
68 unsigned long wordType = navIn->asUnsignedLong(
83 rv = processEph(wordType, navIn, navOut);
86 rv = processOffset(navIn, navOut);
93 rv = processAlm(wordType, navIn, navOut);
109 catch (std::exception& exc)
112 cerr << exc.
what() << endl;
117 cerr <<
"Unknown exception" << endl;
123 bool PNBGalINavDataFactory ::
128 navIn->getobsID(), navIn->getNavID());
129 if (!PNBNavDataFactory::processEph && !PNBNavDataFactory::processHea &&
130 !PNBNavDataFactory::processIono && !PNBNavDataFactory::processISC)
136 if (ephAcc.find(key) == ephAcc.end())
141 ephAcc[key][wordType-1] = navIn;
146 std::vector<PackedNavBitsPtr> &ephWord(ephAcc[key]);
147 ephWord[wordType-1] = navIn;
150 if (PNBNavDataFactory::processIono)
153 NavDataPtr p3 = std::make_shared<GalINavIono>();
155 ip3->
timeStamp = navIn->getTransmitTime();
165 navOut.push_back(p3);
167 if (PNBNavDataFactory::processISC)
170 NavDataPtr p4 = std::make_shared<GalINavISC>();
172 ip4->
timeStamp = navIn->getTransmitTime();
174 ip4->
isc = std::numeric_limits<double>::quiet_NaN();
177 navOut.push_back(p4);
181 if (PNBNavDataFactory::processHea && ephWord[
wt3])
184 NavDataPtr p1 = std::make_shared<GalINavHealth>();
186 hp1->
timeStamp = navIn->getTransmitTime();
197 NavDataPtr p2 = std::make_shared<GalINavHealth>();
208 navOut.push_back(p1);
209 navOut.push_back(p2);
212 if (!PNBNavDataFactory::processEph)
219 if (!ephWord[
wt1] || !ephWord[
wt2] || !ephWord[
wt3] || !ephWord[
wt4] ||
221 (ephWord[
wt1]->getNumBits() != 128) ||
222 (ephWord[
wt2]->getNumBits() != 128) ||
223 (ephWord[
wt3]->getNumBits() != 128) ||
224 (ephWord[
wt4]->getNumBits() != 128) ||
225 (ephWord[
wt5]->getNumBits() != 128))
242 unsigned long iod1, iod2, iod3, iod4;
250 if ((iod1 != iod2) || (iod1 != iod3) || (iod1 != iod4))
258 NavDataPtr p0 = std::make_shared<GalINavEph>();
307 eph->
xmit2 = ephWord[
wt2]->getTransmitTime();
308 eph->
xmit3 = ephWord[
wt3]->getTransmitTime();
309 eph->
xmit4 = ephWord[
wt4]->getTransmitTime();
310 eph->
xmit5 = ephWord[
wt5]->getTransmitTime();
338 navOut.push_back(p0);
345 bool PNBGalINavDataFactory ::
350 navIn->getobsID(), navIn->getNavID());
351 if (!PNBNavDataFactory::processAlm && !PNBNavDataFactory::processHea &&
352 !PNBNavDataFactory::processTim)
364 if (almAcc.find(key) == almAcc.end())
369 almAcc[key][wordType-7] = navIn;
374 std::vector<PackedNavBitsPtr> &almWord(almAcc[key]);
375 almWord[wordType-7] = navIn;
376 if ((wordType == 10) && PNBNavDataFactory::processTim)
378 NavDataPtr p3 = std::make_shared<GalINavTimeOffset>();
379 p3->timeStamp = navIn->getTransmitTime();
382 navIn->getobsID(), navIn->getNavID()),
383 NavMessageType::TimeOffset);
385 to->
tgt = TimeSystem::GPS;
398 navOut.push_back(p3);
401 if (!almWord[
wt7] || !almWord[
wt8] || !almWord[
wt9] || !almWord[
wt10] ||
402 (almWord[
wt7]->getNumBits() != 128) ||
403 (almWord[
wt8]->getNumBits() != 128) ||
404 (almWord[
wt9]->getNumBits() != 128) ||
405 (almWord[
wt10]->getNumBits() != 128))
420 unsigned long ioda1, ioda2, ioda3, ioda4;
425 if ((ioda1 != ioda2) || (ioda1 != ioda3) || (ioda1 != ioda4))
434 NavDataPtr p0 = std::make_shared<GalINavAlm>();
435 NavDataPtr p1 = std::make_shared<GalINavHealth>();
436 NavDataPtr p2 = std::make_shared<GalINavHealth>();
448 if (PNBNavDataFactory::processAlm)
453 navOut.push_back(p0);
455 if (PNBNavDataFactory::processHea)
457 navOut.push_back(p1);
458 navOut.push_back(p2);
462 p0 = std::make_shared<GalINavAlm>();
463 p1 = std::make_shared<GalINavHealth>();
464 p2 = std::make_shared<GalINavHealth>();
476 if (PNBNavDataFactory::processAlm)
481 navOut.push_back(p0);
483 if (PNBNavDataFactory::processHea)
485 navOut.push_back(p1);
486 navOut.push_back(p2);
490 p0 = std::make_shared<GalINavAlm>();
491 p1 = std::make_shared<GalINavHealth>();
492 p2 = std::make_shared<GalINavHealth>();
504 if (PNBNavDataFactory::processAlm)
509 navOut.push_back(p0);
511 if (PNBNavDataFactory::processHea)
513 navOut.push_back(p1);
514 navOut.push_back(p2);
523 bool PNBGalINavDataFactory ::
524 processAlmOrb(
const std::vector<PackedNavBitsPtr>& almWord,
528 int asiSVID,
int asbSVID,
529 int asidAhalf,
int asbdAhalf,
532 int asidi,
int asbdi,
535 int asiM0,
int asbM0,
538 int asiE5bhs,
int asbE5bhs,
539 int asiE1Bhs,
int asbE1Bhs)
542 alm->
timeStamp = almWord[wtA]->getTransmitTime();
543 unsigned long svid = almWord[asiSVID]->asUnsignedLong(asbSVID,
anbSVID,
547 SatID xmitSat(almWord[wtA]->getsatSys());
549 almWord[wtA]->getNavID());
555 alm->
xmit2 = almWord[wtB]->getTransmitTime();
564 alm->
Toe = alm->
Toc = gws;
569 alm->
dAhalf = almWord[asidAhalf]->asUnsignedDouble(asbdAhalf,
anbdAhalf,
573 alm->
Ahalf = ::sqrt(GalINavAlm::refA) + alm->
dAhalf;
578 alm->
i0 = GalINavAlm::refioffset + alm->
deltai;
580 alm->
OMEGAdot = almWord[asiOMEGAdot]->asDoubleSemiCircles(
591 if (PNBNavDataFactory::processHea)
593 hp1->
timeStamp = almWord[asiE5bhs]->getTransmitTime();
600 hp2->
timeStamp = almWord[asiE1Bhs]->getTransmitTime();
612 bool PNBGalINavDataFactory ::
618 if (!PNBNavDataFactory::processTim)
623 NavDataPtr p0 = std::make_shared<GalINavTimeOffset>();
624 p0->timeStamp = navIn->getTransmitTime();
627 navIn->getobsID(), navIn->getNavID()),
628 NavMessageType::TimeOffset);
630 to->
tgt = TimeSystem::UTC;
642 long refWeek = ws.
week;
649 navOut.push_back(p0);
655 void PNBGalINavDataFactory ::
656 dumpState(std::ostream& s)
659 s <<
"fullWNaMap.size() = " << fullWNaMap.size() <<
" (expect 32)" << endl
660 <<
"almAcc.size() = " << almAcc.size() <<
" (expect 32)" << endl;
661 for (
const auto& i : almAcc)
663 s <<
" almAcc[" << i.first <<
"].size() = " << i.second.size()
666 s <<
"ephAcc.size() = " << ephAcc.size() <<
" (expect 32)" << endl;
667 for (
const auto& i : ephAcc)
669 s <<
" ephAcc[" << i.first <<
"].size() = " << i.second.size()
671 for (
unsigned j = 0; j < i.second.size(); j++)
673 s <<
" ephAcc[" << i.first <<
"][" << j <<
"] = ";
677 s << i.second[j]->getNumBits() <<
" bits";
685 void PNBGalINavDataFactory ::