/** * Set this object using the information provided in \a info. * @param info the IdToValue object to which this object shall be set. * @return true if this object was successfully set using the * data in \a info, false if not. */ bool GPSWeek::setFromInfo( const IdToValue& info ) throw() { using namespace gpstk::StringUtils; for( IdToValue::const_iterator i = info.begin(); i != info.end(); i++ ) { // based on the character, we know what to do... switch ( i->first ) { case 'E': setEpoch( asInt( i->second ) ); break; case 'F': week = asInt( i->second ); break; case 'G': setWeek10( asInt( i->second ) ); break; default: // do nothing break; }; } // end of for loop return true; }
/// Set this object using the information provided in \a info. /// @param info the IdToValue object to which this object shall be set. /// @return true if this object was successfully set using the /// data in \a info, false if not. bool setFromInfo( const IdToValue& info ) { for( IdToValue::const_iterator i = info.begin(); i != info.end(); i++ ) { // based on the character, we know what to do... switch ( i->first ) { case 'E': setEpoch( gpstk::StringUtils::asInt( i->second ) ); break; case 'F': week = gpstk::StringUtils::asInt( i->second ); break; case 'G': setModWeek( gpstk::StringUtils::asInt( i->second ) ); break; case 'w': sow = static_cast<double>(gpstk::StringUtils::asInt(i->second))*SEC_PER_DAY; break; case 'g': sow = gpstk::StringUtils::asDouble( i->second ); break; case 'P': timeSystem.fromString(i->second); break; default: // do nothing break; }; } // end of for loop return true; }
/// Set this object using the information provided in \a info. /// @param info the IdToValue object to which this object shall be set. /// @return true if this object was successfully set using the /// data in \a info, false if not. bool setFromInfo( const IdToValue& info ) { using namespace gpstk::StringUtils; for( IdToValue::const_iterator i = info.begin(); i != info.end(); i++ ) { // based on the character, we know what to do... switch ( i->first ) { case 'R': setEpoch( asInt( i->second ) ); break; case 'D': week = asInt( i->second ); break; case 'e': setModWeek( asInt( i->second ) ); break; case 'P': timeSystem.fromString(i->second); break; default: // do nothing break; }; } // end of for loop return true; }
bool UnixTime::setFromInfo( const IdToValue& info ) throw() { using namespace gpstk::StringUtils; for( IdToValue::const_iterator i = info.begin(); i != info.end(); i++ ) { switch( i->first ) { case 'U': tv.tv_sec = asInt( i->second ); break; case 'u': tv.tv_usec = asInt( i->second ); break; default: // do nothing break; }; } return true; }
bool JulianDate::setFromInfo( const IdToValue& info ) throw() { using namespace gpstk::StringUtils; IdToValue::const_iterator itr = info.find('J'); if( itr != info.end() ) { jd = gpstk::StringUtils::asLongDouble( itr->second ); } return true; }
bool ANSITime::setFromInfo( const IdToValue& info ) throw() { using namespace gpstk::StringUtils; IdToValue::const_iterator i = info.find('K'); if( i != info.end() ) { time = asInt( i->second ); } return true; }
bool JulianDate::setFromInfo( const IdToValue& info ) { using namespace gpstk::StringUtils; for( IdToValue::const_iterator i = info.begin(); i != info.end(); i++ ) { switch( i->first ) { case 'J': jd = asLongDouble( i->second ); break; case 'P': timeSystem.fromString(i->second); break; default: // do nothing break; }; } return true; }