当前位置: 首页>>代码示例>>C++>>正文


C++ DayTime::asString方法代码示例

本文整理汇总了C++中DayTime::asString方法的典型用法代码示例。如果您正苦于以下问题:C++ DayTime::asString方法的具体用法?C++ DayTime::asString怎么用?C++ DayTime::asString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DayTime的用法示例。


在下文中一共展示了DayTime::asString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: findDCB

      /** Find a DCB value
       *
       * @param sat     SatID of satellite of interest
       * @param t       Time to search for DCB
       *
       * @return        DCB value found (nanoseconds).
       *
       * @throw InvalidRequest object thrown when no DCB value is found
       */
   double IonexStore::findDCB( const SatID sat,
                               const DayTime& time ) const
      throw(InvalidRequest)
   {

         // current time check. This is passed even if there are gaps
      if ( time < getInitialTime() )
      {
         InvalidRequest e("Inadequate data before requested time");
         GPSTK_THROW(e);
      }

      if ( time > getFinalTime() )
      {
         InvalidRequest e("Inadequate data after requested time");
         GPSTK_THROW(e);
      }

      double dt(0.0);
      IonexDCBMap::const_iterator itm = inxDCBMap.begin();

         // looping through the map
      while ( itm != inxDCBMap.end() )
      {

            // let's get the relative reference
         dt = time - itm->first;

            // this means we don't have maps for this day and there is a gap
         if( dt < 0.0 )
         {

            InvalidRequest e( "Inadequate data after requested time: " +
                              time.asString() );
            GPSTK_THROW(e);

         }  // works fine for consecutive files, otherwise last epoch is thrown
         else
         {

            if( dt < 86400.0 )
            {

               IonexHeader::SatDCBMap satdcb( itm->second );
               IonexHeader::SatDCBMap::const_iterator iprn( satdcb.find(sat) );

                  // if satellite is not found, throw
               if ( iprn == satdcb.end() )
               {

                  InvalidRequest e( "There is no DCB value for satellite " +
                                    asString(sat) );
                  GPSTK_THROW(e);

               }
               else     // ... otherwise, fetch the value
               {

                  return iprn->second.bias;

               }  // End of 'if ( iprn == satdcb.end() ) ... else ...'

            }
            else  // If everything is fine, then move forward in the map
            {

               itm++;

            }  // End of 'if( dt < 86400.0 ) ... else ...'

         }  // End of 'if( dt < 0.0 ) ... else ...'

      }  // End of 'while ( itm != inxDCBMap.end() )'


         // You should never get here, but just in case
      return 0.0;

   }  // End of method 'IonexStore::findDCB()'
开发者ID:loongfee,项目名称:ossim-svn,代码行数:88,代码来源:IonexStore.cpp


注:本文中的DayTime::asString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。