void CNavUTC::loadData(const PackedNavBits& message33) throw(InvalidParameter) { // First, verify the correct message type is being passed in. long msgType = message33.asUnsignedLong(14,6,1); if(msgType!=33) { char errStr[80]; sprintf(errStr,"Expected CNAV MsgType 33. Found MsgType %ld",msgType); std::string tstr(errStr); InvalidParameter exc(tstr); GPSTK_THROW(exc); } obsID = message33.getobsID(); satID = message33.getsatSys(); ctXmit = message33.getTransmitTime(); A0 = message33.asSignedDouble(127,16,-35); A1 = message33.asSignedDouble(143,13,-51); A2 = message33.asSignedDouble(156, 7,-68); deltaTls = message33.asLong(163, 8, 1); Tot = message33.asUnsignedLong(171,16,16); WNot = message33.asUnsignedLong(187,13, 1); WNlsf = message33.asUnsignedLong(200,13, 1); DN = message33.asUnsignedLong(213, 4, 1); deltaTlsf = message33.asLong(217, 8, 1); ctEpoch = GPSWeekSecond(WNot, Tot, TimeSystem::GPS); dataLoadedFlag = true; } // end of loadData()
void CNavGGTO::loadData(const PackedNavBits& message35) throw(InvalidParameter) { // First, verify the correct message type is being passed in. long msgType = message35.asUnsignedLong(14,6,1); if(msgType!=35) { char errStr[80]; sprintf(errStr,"Expected CNAV MsgType 35. Found MsgType %ld",msgType); std::string tstr(errStr); InvalidParameter exc(tstr); GPSTK_THROW(exc); } obsID = message35.getobsID(); satID = message35.getsatSys(); ctXmit = message35.getTransmitTime(); TGGTO = message35.asLong(127,16,16); WNGGTO = message35.asLong(143,13, 1); GNSS_ID = message35.asLong(156, 3, 1); A0GGTO = message35.asSignedDouble(158,16,-35); A1GGTO = message35.asSignedDouble(175,13,-51); A2GGTO = message35.asSignedDouble(188, 7,-68); if (GNSS_ID>0) ctEpoch = GPSWeekSecond(WNGGTO, TGGTO, TimeSystem::GPS); dataLoadedFlag = true; } // end of loadData()
void CNavEOP::loadData(const PackedNavBits& message32) throw(InvalidParameter) { // First, verify the correct message type is being passed in. long msgType = message32.asUnsignedLong(14,6,1); if(msgType!=32) { char errStr[80]; sprintf(errStr,"Expected CNAV MsgType 32. Found MsgType %ld",msgType); std::string tstr(errStr); InvalidParameter exc(tstr); GPSTK_THROW(exc); } obsID = message32.getobsID(); satID = message32.getsatSys(); ctXmit = message32.getTransmitTime(); Teop = message32.asUnsignedLong(127,16, 16); PM_X = message32.asSignedDouble(143,21,-20); PM_X_dot = message32.asSignedDouble(164,15,-21); PM_Y = message32.asSignedDouble(179,21,-20); PM_Y_dot = message32.asSignedDouble(200,15,-21); deltaUT1 = message32.asSignedDouble(215,31,-24); deltaUT1_dot = message32.asSignedDouble(246,19,-25); // The message does not contain a week counter. // We'll assume the Teop is to be within 1/2 week // of the transmit time. long xmitSOW = (static_cast<GPSWeekSecond>(ctXmit)).sow; short xmitWeek = (static_cast<GPSWeekSecond>(ctXmit)).week; double timeDiff = Teop - xmitSOW; short epochWeek = xmitWeek; if (timeDiff < -HALFWEEK) epochWeek++; else if (timeDiff > HALFWEEK) epochWeek--; ctEpoch = GPSWeekSecond(epochWeek, Teop, TimeSystem::GPS); dataLoadedFlag = true; } // end of loadData()
void OrbSysGpsC_30::loadData(const PackedNavBits& msg) throw(InvalidParameter) { setUID(msg); if (UID!=30) { char errStr[80]; std::string msgString("Expected GPS CNAV MT 30. Found unique ID "); msgString += StringUtils::asString(UID); InvalidParameter exc(msgString); GPSTK_THROW(exc); } obsID = msg.getobsID(); satID = msg.getsatSys(); beginValid = msg.getTransmitTime(); // Message Type 30 data unsigned long testAvail = 4096; // Pattern in message of 0x1000 // if data quantity not available unsigned long avail = msg.asUnsignedLong(127,13,1); avail_Tgd = false; if (avail!=testAvail) { avail_Tgd = true; Tgd = msg.asSignedDouble(127, 13, -35); } avail = msg.asUnsignedLong(140,13,1); avail_L1CA = false; if (avail!=testAvail) { avail_L1CA = true; ISC_L1CA = msg.asSignedDouble(140, 13, -35); } avail = msg.asUnsignedLong(153,13,1); avail_L2C = false; if (avail!=testAvail) { avail_L2C = true; ISC_L2C = msg.asSignedDouble(153, 13, -35); } avail = msg.asUnsignedLong(166,13,1); avail_L5I5 = false; if (avail!=testAvail) { avail_L5I5 = true; ISC_L5I5 = msg.asSignedDouble(166, 13, -35); } avail = msg.asUnsignedLong(179,13,1); avail_L5Q5 = false; if (avail!=testAvail) { avail_L5Q5 = true; ISC_L5Q5 = msg.asSignedDouble(179, 13, -35); } alpha[0] = msg.asSignedDouble(192, 8, -30); alpha[1] = msg.asSignedDouble(200, 8, -27); alpha[2] = msg.asSignedDouble(208, 8, -24); alpha[3] = msg.asSignedDouble(216, 8, -24); beta[0] = msg.asSignedDouble(224, 8, 11); beta[1] = msg.asSignedDouble(232, 8, 14); beta[2] = msg.asSignedDouble(240, 8, 16); beta[3] = msg.asSignedDouble(248, 8, 16); // Need to convert from sec/semi-circle to sec/rad double conversion = 1.0 / PI; alpha[1] *= conversion; beta[1] *= conversion; alpha[2] *= conversion * conversion; beta[2] *= conversion * conversion; alpha[3] *= conversion * conversion * conversion; beta[3] *= conversion * conversion * conversion; dataLoadedFlag = true; } // end of loadData()
void CNavISC::loadData(const PackedNavBits& message30) throw( InvalidParameter ) { // First, verify the correct message type is being passed in. long msgType = message30.asUnsignedLong(14,6,1); if(msgType!=30) { char errStr[80]; sprintf(errStr,"Expected CNAV MsgType 30. Found MsgType %ld",msgType); std::string tstr(errStr); InvalidParameter exc(tstr); GPSTK_THROW(exc); } obsID = message30.getobsID(); satID = message30.getsatSys(); ctXmit = message30.getTransmitTime(); ctEpoch = ctXmit; // For ISC, no explicit epoch time. // Message Type 30 data unsigned long testAvail = 4096; // Pattern in message of 0x1000 // if data quantity not available unsigned long avail = message30.asUnsignedLong(127,13,1); avail_Tgd = false; if (avail!=testAvail) { avail_Tgd = true; Tgd = message30.asSignedDouble(127, 13, -35); } avail = message30.asUnsignedLong(140,13,1); avail_L1CA = false; if (avail!=testAvail) { avail_L1CA = true; ISC_L1CA = message30.asSignedDouble(140, 13, -35); } avail = message30.asUnsignedLong(153,13,1); avail_L2C = false; if (avail!=testAvail) { avail_L2C = true; ISC_L2C = message30.asSignedDouble(153, 13, -35); } avail = message30.asUnsignedLong(166,13,1); avail_L5I5 = false; if (avail!=testAvail) { avail_L5I5 = true; ISC_L5I5 = message30.asSignedDouble(166, 13, -35); } avail = message30.asUnsignedLong(179,13,1); avail_L5Q5 = false; if (avail!=testAvail) { avail_L5Q5 = true; ISC_L5Q5 = message30.asSignedDouble(179, 13, -35); } alpha[0] = message30.asSignedDouble(192, 8, -30); alpha[1] = message30.asSignedDouble(200, 8, -27); alpha[2] = message30.asSignedDouble(208, 8, -24); alpha[3] = message30.asSignedDouble(216, 8, -24); beta[0] = message30.asSignedDouble(224, 8, 11); beta[1] = message30.asSignedDouble(232, 8, 14); beta[2] = message30.asSignedDouble(240, 8, 16); beta[3] = message30.asSignedDouble(248, 8, 16); // Need to convert from sec/semi-circle to sec/rad double conversion = 1.0 / PI; alpha[1] *= conversion; beta[1] *= conversion; alpha[2] *= conversion * conversion; beta[2] *= conversion * conversion; alpha[3] *= conversion * conversion * conversion; beta[3] *= conversion * conversion * conversion; dataLoadedFlag = true; } // end of loadData()