本文整理汇总了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()'