ui: Speedometer: Hide from onroad screen (#1336)

* ui: Speedometer: Display True Speed

* update

* ui: Speedometer: Hide from onroad screen

* wrong

* use stock one
This commit is contained in:
Jason Wen
2025-10-08 21:54:24 -04:00
committed by GitHub
parent ae21d40a19
commit 7aac14e6fc
6 changed files with 16 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"EnableGithubRunner", {PERSISTENT | BACKUP, BOOL}},
{"GreenLightAlert", {PERSISTENT | BACKUP, BOOL, "0"}},
{"GithubRunnerSufficientVoltage", {CLEAR_ON_MANAGER_START , BOOL}},
{"HideVEgoUI", {PERSISTENT | BACKUP, BOOL, "0"}},
{"IntelligentCruiseButtonManagement", {PERSISTENT | BACKUP , BOOL}},
{"InteractivityTimeout", {PERSISTENT | BACKUP, INT, "0"}},
{"IsDevelopmentBranch", {CLEAR_ON_MANAGER_START, BOOL}},

View File

@@ -76,6 +76,13 @@ VisualsPanel::VisualsPanel(QWidget *parent) : QWidget(parent) {
"",
false,
},
{
"HideVEgoUI",
tr("Speedometer: Hide from Onroad Screen"),
tr("Always display the true vehicle current speed from wheel speed sensors."),
"",
false,
}
};
// Add regular toggles first

View File

@@ -119,6 +119,7 @@ void HudRendererSP::updateState(const UIState &s) {
// override stock current speed values
float v_ego = (v_ego_cluster_seen && !s.scene.trueVEgoUI) ? car_state.getVEgoCluster() : car_state.getVEgo();
speed = std::max<float>(0.0f, v_ego * (is_metric ? MS_TO_KPH : MS_TO_MPH));
hideVEgoUI = s.scene.hideVEgoUI;
}
void HudRendererSP::draw(QPainter &p, const QRect &surface_rect) {
@@ -133,6 +134,10 @@ void HudRendererSP::draw(QPainter &p, const QRect &surface_rect) {
}
drawCurrentSpeedSP(p, surface_rect);
if (!hideVEgoUI) {
drawCurrentSpeedSP(p, surface_rect);
}
if (!reversing) {
// Smart Cruise Control
int x_offset = -260;

View File

@@ -107,4 +107,5 @@ private:
QPixmap lead_depart_alert_large_img;
QString alert_text;
QPixmap alert_img;
bool hideVEgoUI;
};

View File

@@ -65,6 +65,7 @@ void ui_update_params_sp(UIStateSP *s) {
s->scene.speed_limit_mode = std::atoi(params.get("SpeedLimitMode").c_str());
s->scene.road_name = params.getBool("RoadNameToggle");
s->scene.trueVEgoUI = params.getBool("TrueVEgoUI");
s->scene.hideVEgoUI = params.getBool("HideVEgoUI");
// Onroad Screen Brightness
s->scene.onroadScreenOffBrightness = std::atoi(params.get("OnroadScreenOffBrightness").c_str());

View File

@@ -16,4 +16,5 @@ typedef struct UISceneSP : UIScene {
bool onroadScreenOffControl;
int onroadScreenOffTimerParam;
bool trueVEgoUI;
bool hideVEgoUI;
} UISceneSP;