From 3a7a0310a239ba699c8a92c280ec26a7458ef324 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 11 May 2024 15:38:15 -0700 Subject: [PATCH] Visuals - Screen Management - Hide UI Elements - Alerts Hide non-critical alerts on the onroad screen. --- selfdrive/ui/qt/onroad.cc | 5 +++++ selfdrive/ui/ui.cc | 4 ++++ selfdrive/ui/ui.h | 1 + 3 files changed, 10 insertions(+) diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 6dae7d7..0789212 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -451,6 +451,11 @@ void OnroadAlerts::paintEvent(QPaintEvent *event) { if (alert.size == cereal::ControlsState::AlertSize::NONE) { return; } + + if (scene.hide_alerts && alert.status == cereal::ControlsState::AlertStatus::NORMAL) { + return; + } + static std::map alert_heights = { {cereal::ControlsState::AlertSize::SMALL, 271}, {cereal::ControlsState::AlertSize::MID, 420}, diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 721aa65..e002f81 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -408,6 +408,10 @@ void ui_update_frogpilot_params(UIState *s) { scene.map_style = quality_of_life_visuals ? params.getInt("MapStyle") : 0; scene.wheel_speed = quality_of_life_visuals && params.getBool("WheelSpeed"); + bool screen_management = params.getBool("ScreenManagement"); + bool hide_ui_elements = screen_management && params.getBool("HideUIElements"); + scene.hide_alerts = hide_ui_elements && params.getBool("HideAlerts"); + scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController"); scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset"); scene.show_slc_offset_ui = scene.speed_limit_controller && params.getBool("ShowSLCOffsetUI"); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 5918106..aed4737 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -209,6 +209,7 @@ typedef struct UIScene { bool fps_counter; bool full_map; bool has_auto_tune; + bool hide_alerts; bool hide_lead_marker; bool hide_speed; bool hide_speed_ui;