ready screen: hide READY! text after first drive, reset on ignition cycle
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user