From 55f73fd4218394c4c691f4a9f9cebee9396112d4 Mon Sep 17 00:00:00 2001 From: Brian Hanson Date: Tue, 14 Apr 2026 02:51:13 -0500 Subject: [PATCH] ready screen: hide READY! text after first drive, reset on ignition cycle Co-Authored-By: Claude Opus 4.6 (1M context) --- selfdrive/ui/qt/home.cc | 1 + selfdrive/ui/qt/ready.cc | 12 ++++++++++-- selfdrive/ui/qt/ready.h | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index f60c339..808f11a 100755 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -98,6 +98,7 @@ void HomeWindow::updateState(const UIState &s) { } else if (!parked && was_parked_onroad) { LOGW("CLP UI: drive transition -> showing onroad"); slayout->setCurrentWidget(onroad); + ready->has_driven = true; } was_parked_onroad = parked; diff --git a/selfdrive/ui/qt/ready.cc b/selfdrive/ui/qt/ready.cc index a529380..313a5a4 100755 --- a/selfdrive/ui/qt/ready.cc +++ b/selfdrive/ui/qt/ready.cc @@ -70,8 +70,8 @@ void ReadyWindow::paintEvent(QPaintEvent *event) { painter.drawPixmap(x, y, scaled); } - if (error_msg.isEmpty()) { - // "READY!" 8-bit text sprite, 2x size, 15% below center + if (error_msg.isEmpty() && !has_driven) { + // "READY!" 8-bit text sprite, 15% below center — only before first drive static QPixmap ready_text("/data/openpilot/selfdrive/clearpilot/theme/clearpilot/images/ready_text.png"); if (!ready_text.isNull()) { int tx = (width() - ready_text.width()) / 2; @@ -125,5 +125,13 @@ void ReadyWindow::refresh() { if (error_msg != prev_error) changed = true; } + // Reset has_driven on ignition off→on (power cycle) + bool started = uiState()->scene.started; + if (!last_started && started) { + has_driven = false; + changed = true; + } + last_started = started; + if (changed) update(); } \ No newline at end of file diff --git a/selfdrive/ui/qt/ready.h b/selfdrive/ui/qt/ready.h index 42eb822..a428c99 100755 --- a/selfdrive/ui/qt/ready.h +++ b/selfdrive/ui/qt/ready.h @@ -18,6 +18,7 @@ class ReadyWindow : public QWidget { Q_OBJECT public: ReadyWindow(QWidget* parent = nullptr); + bool has_driven = false; private: void showEvent(QShowEvent *event) override; void hideEvent(QHideEvent *event) override; @@ -29,6 +30,7 @@ private: QString cur_temp; QString error_msg; // non-empty = show red error instead of READY! QElapsedTimer uptime; + bool last_started = false; QPixmap img_bg; QPixmap img_hot; }; \ No newline at end of file