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


C++ NMEAInfo::HasTimeRetreatedSince方法代码示例

本文整理汇总了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;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:25,代码来源:GlideComputerAirData.cpp

示例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);
}
开发者ID:alon,项目名称:xcsoar,代码行数:26,代码来源:FlyingComputer.cpp


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