Пример #1
0
void
InfoBoxContentAltitudeQFE::Update(InfoBoxData &data)
{
  const NMEAInfo &basic = CommonInterface::Basic();

  if (!basic.gps_altitude_available) {
    data.SetInvalid();
    return;
  }

  fixed Value = basic.gps_altitude;

  const Waypoint *home_waypoint = way_points.GetHome();
  if (home_waypoint)
    Value -= home_waypoint->altitude;

  data.SetValueFromAltitude(Value);
  data.SetCommentFromAlternateAltitude(Value);
}
Пример #2
0
void
UpdateInfoBoxAltitudeQFE(InfoBoxData &data)
{
  const NMEAInfo &basic = CommonInterface::Basic();

  if (!basic.gps_altitude_available) {
    data.SetInvalid();
    return;
  }

  auto Value = basic.gps_altitude;

  const auto home_waypoint = way_points.GetHome();
  if (home_waypoint)
    Value -= home_waypoint->elevation;

  data.SetValueFromAltitude(Value);
  data.SetCommentFromAlternateAltitude(Value);
}