void UpdateInfoBoxAltitudeNav(InfoBoxData &data) { const MoreData &basic = CommonInterface::Basic(); if (!basic.NavAltitudeAvailable()) { data.SetInvalid(); if (basic.pressure_altitude_available) data.SetComment(_("no QNH")); return; } const ComputerSettings &settings_computer = CommonInterface::GetComputerSettings(); if (basic.baro_altitude_available && settings_computer.features.nav_baro_altitude_enabled) data.SetTitle(InfoBoxFactory::GetCaption(InfoBoxFactory::e_H_Baro)); else data.SetTitle(InfoBoxFactory::GetCaption(InfoBoxFactory::e_HeightGPS)); data.SetValueFromAltitude(basic.nav_altitude); data.SetCommentFromAlternateAltitude(basic.nav_altitude); }
void UpdateInfoBoxThermalLastGain(InfoBoxData &data) { const OneClimbInfo &thermal = CommonInterface::Calculated().last_thermal; if (!thermal.IsDefined()) { data.SetInvalid(); return; } data.SetValueFromAltitude(thermal.gain); }
void InfoBoxContentThermalGain::Update(InfoBoxData &data) { const OneClimbInfo &thermal = CommonInterface::Calculated().current_thermal; if (!thermal.IsDefined()) { data.SetInvalid(); return; } data.SetValueFromAltitude(thermal.gain); }
void UpdateInfoBoxFinalAltitudeRequire(InfoBoxData &data) { const TaskStats &task_stats = CommonInterface::Calculated().task_stats; if (!task_stats.task_valid || !task_stats.total.solution_remaining.IsOk()) { data.SetInvalid(); return; } data.SetValueFromAltitude(task_stats.total.solution_remaining.GetRequiredAltitude()); }
void UpdateInfoBoxTerrainHeight(InfoBoxData &data) { const TerrainInfo &calculated = CommonInterface::Calculated(); if (!calculated.terrain_valid){ data.SetInvalid(); return; } data.SetValueFromAltitude(calculated.terrain_altitude); data.SetCommentFromAlternateAltitude(calculated.terrain_altitude); }
void InfoBoxContentAltitudeGPS::Update(InfoBoxData &data) { const NMEAInfo &basic = CommonInterface::Basic(); if (!basic.gps_altitude_available) { data.SetInvalid(); return; } data.SetValueFromAltitude(basic.gps_altitude); data.SetCommentFromAlternateAltitude(basic.gps_altitude); }
void UpdateInfoBoxNextAltitudeRequire(InfoBoxData &data) { // pilots want this to be assuming terminal flight to this wp const TaskStats &task_stats = CommonInterface::Calculated().task_stats; const GlideResult &next_solution = task_stats.current_leg.solution_remaining; if (!task_stats.task_valid || !next_solution.IsAchievable()) { data.SetInvalid(); return; } data.SetValueFromAltitude(next_solution.GetRequiredAltitude()); }
void InfoBoxContentNextAltitudeRequire::Update(InfoBoxData &data) { // pilots want this to be assuming terminal flight to this wp const TaskStats &task_stats = XCSoarInterface::Calculated().task_stats; const GlideResult &next_solution = XCSoarInterface::Calculated().common_stats.next_solution; if (!task_stats.task_valid || !next_solution.IsAchievable()) { data.SetInvalid(); return; } data.SetValueFromAltitude(next_solution.GetRequiredAltitude()); }
void UpdateInfoBoxNextAltitudeArrival(InfoBoxData &data) { // pilots want this to be assuming terminal flight to this wp const MoreData &basic = CommonInterface::Basic(); const TaskStats &task_stats = CommonInterface::Calculated().task_stats; const GlideResult next_solution = task_stats.current_leg.solution_remaining; if (!basic.NavAltitudeAvailable() || !task_stats.task_valid || !next_solution.IsAchievable()) { data.SetInvalid(); return; } data.SetValueFromAltitude(next_solution.GetArrivalAltitude(basic.nav_altitude)); }
void InfoBoxContentAltitudeBaro::Update(InfoBoxData &data) { const NMEAInfo &basic = CommonInterface::Basic(); if (!basic.baro_altitude_available) { data.SetInvalid(); if (basic.pressure_altitude_available) data.SetComment(_("no QNH")); return; } data.SetValueFromAltitude(basic.baro_altitude); data.SetCommentFromAlternateAltitude(basic.baro_altitude); }
void InfoBoxContentAltitudeAGL::Update(InfoBoxData &data) { const DerivedInfo &calculated = CommonInterface::Calculated(); if (!calculated.altitude_agl_valid) { data.SetInvalid(); return; } data.SetValueFromAltitude(calculated.altitude_agl); data.SetCommentFromAlternateAltitude(calculated.altitude_agl); // Set Color (red/black) data.SetValueColor(calculated.altitude_agl < XCSoarInterface::GetComputerSettings().task.route_planner.safety_height_terrain ? 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); }
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); }