コード例 #1
0
ファイル: GPSWeek.cpp プロジェクト: ianmartin/GPSTk
    /**
     * 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;
 }
コード例 #2
0
ファイル: GPSWeekSecond.hpp プロジェクト: xiangyan66/GPSTk
    /// 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;
    }
コード例 #3
0
ファイル: BDSWeekSecond.hpp プロジェクト: Milfhunter/gpstk
      /// 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;
      }
コード例 #4
0
ファイル: UnixTime.cpp プロジェクト: loongfee/ossim-svn
 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;
 }
コード例 #5
0
ファイル: JulianDate.cpp プロジェクト: ianmartin/GPSTk
 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;
 }
コード例 #6
0
ファイル: ANSITime.cpp プロジェクト: ianmartin/GPSTk
   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;
   }
コード例 #7
0
ファイル: JulianDate.cpp プロジェクト: Milfhunter/gpstk
   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;
   }