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); }
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); }