本文整理汇总了C++中NMEAInfo::HasTimeRetreatedSince方法的典型用法代码示例。如果您正苦于以下问题:C++ NMEAInfo::HasTimeRetreatedSince方法的具体用法?C++ NMEAInfo::HasTimeRetreatedSince怎么用?C++ NMEAInfo::HasTimeRetreatedSince使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NMEAInfo
的用法示例。
在下文中一共展示了NMEAInfo::HasTimeRetreatedSince方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetFlight
bool
GlideComputerAirData::FlightTimes(const NMEAInfo &basic,
const NMEAInfo &last_basic,
DerivedInfo &calculated,
const ComputerSettings &settings)
{
if (basic.gps.replay != last_basic.gps.replay)
// reset flight before/after replay logger
ResetFlight(calculated, settings, basic.gps.replay);
if (basic.time_available && basic.HasTimeRetreatedSince(last_basic)) {
// 20060519:sgi added (basic.Time != 0) due to always return here
// if no GPS time available
if (basic.location_available)
// Reset statistics.. (probably due to being in IGC replay mode)
ResetFlight(calculated, settings, false);
return false;
}
FlightState(basic, last_basic, calculated, calculated.flight,
settings.polar.glide_polar_task);
return true;
}
示例2: Reset
void
FlyingComputer::Compute(fixed takeoff_speed,
const NMEAInfo &basic, const NMEAInfo &last_basic,
const DerivedInfo &calculated,
FlyingState &flying)
{
if (basic.HasTimeRetreatedSince(last_basic)) {
Reset();
flying.Reset();
}
// GPS not lost
if (!basic.location_available)
return;
// Speed too high for being on the ground
const fixed speed = basic.airspeed_available
? std::max(basic.true_airspeed, basic.ground_speed)
: basic.ground_speed;
if (speed > takeoff_speed ||
(calculated.altitude_agl_valid && calculated.altitude_agl > fixed(300)))
Moving(flying, basic.time, basic.location);
else
Stationary(flying, basic.time, basic.location);
}