mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
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: f1568b960a3da819c41c62dcaeafb4eb6dd109eb
This commit is contained in:
@@ -33,10 +33,12 @@ DriverViewScene::DriverViewScene(QWidget* parent) : sm({"driverStateV2"}), QWidg
|
|||||||
void DriverViewScene::showEvent(QShowEvent* event) {
|
void DriverViewScene::showEvent(QShowEvent* event) {
|
||||||
frame_updated = false;
|
frame_updated = false;
|
||||||
params.putBool("IsDriverViewEnabled", true);
|
params.putBool("IsDriverViewEnabled", true);
|
||||||
|
device()->resetInteractiveTimeout(60);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DriverViewScene::hideEvent(QHideEvent* event) {
|
void DriverViewScene::hideEvent(QHideEvent* event) {
|
||||||
params.putBool("IsDriverViewEnabled", false);
|
params.putBool("IsDriverViewEnabled", false);
|
||||||
|
device()->resetInteractiveTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DriverViewScene::frameUpdated() {
|
void DriverViewScene::frameUpdated() {
|
||||||
|
|||||||
+5
-2
@@ -293,8 +293,11 @@ void Device::setAwake(bool on) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::resetInteractiveTimeout() {
|
void Device::resetInteractiveTimeout(int timeout) {
|
||||||
interactive_timeout = (ignition_on ? 10 : 30) * UI_FREQ;
|
if (timeout == -1) {
|
||||||
|
timeout = (ignition_on ? 10 : 30);
|
||||||
|
}
|
||||||
|
interactive_timeout = timeout * UI_FREQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::updateBrightness(const UIState &s) {
|
void Device::updateBrightness(const UIState &s) {
|
||||||
|
|||||||
+1
-1
@@ -212,7 +212,7 @@ signals:
|
|||||||
void interactiveTimeout();
|
void interactiveTimeout();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void resetInteractiveTimeout();
|
void resetInteractiveTimeout(int timeout = -1);
|
||||||
void update(const UIState &s);
|
void update(const UIState &s);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user