ui: longer screen timeout for driver view (#27457)

* longer driverview timeout

* Update ui.cc

* reset timeout

* do cleanup

* Apply suggestions from code review

* Update selfdrive/ui/ui.cc

* reset to default timeout on hidden

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: f1568b960a
beeps
Dean Lee 2 years ago committed by GitHub
parent 0645f2c409
commit 5cc9fbe23f
  1. 2
      selfdrive/ui/qt/offroad/driverview.cc
  2. 7
      selfdrive/ui/ui.cc
  3. 2
      selfdrive/ui/ui.h

@ -33,10 +33,12 @@ DriverViewScene::DriverViewScene(QWidget* parent) : sm({"driverStateV2"}), QWidg
void DriverViewScene::showEvent(QShowEvent* event) {
frame_updated = false;
params.putBool("IsDriverViewEnabled", true);
device()->resetInteractiveTimeout(60);
}
void DriverViewScene::hideEvent(QHideEvent* event) {
params.putBool("IsDriverViewEnabled", false);
device()->resetInteractiveTimeout();
}
void DriverViewScene::frameUpdated() {

@ -293,8 +293,11 @@ void Device::setAwake(bool on) {
}
}
void Device::resetInteractiveTimeout() {
interactive_timeout = (ignition_on ? 10 : 30) * UI_FREQ;
void Device::resetInteractiveTimeout(int timeout) {
if (timeout == -1) {
timeout = (ignition_on ? 10 : 30);
}
interactive_timeout = timeout * UI_FREQ;
}
void Device::updateBrightness(const UIState &s) {

@ -212,7 +212,7 @@ signals:
void interactiveTimeout();
public slots:
void resetInteractiveTimeout();
void resetInteractiveTimeout(int timeout = -1);
void update(const UIState &s);
};

Loading…
Cancel
Save