mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 08:16:06 +08:00
Visuals - Screen Management - Screen Timeout
Customize how long it takes for your screen to turn off.
This commit is contained in:
@@ -93,7 +93,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
|
||||
case QEvent::MouseMove: {
|
||||
// ignore events when device is awakened by resetInteractiveTimeout
|
||||
ignore = !device()->isAwake();
|
||||
device()->resetInteractiveTimeout();
|
||||
device()->resetInteractiveTimeout(uiState()->scene.screen_timeout;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
+4
-1
@@ -436,6 +436,7 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) {
|
||||
scene.screen_brightness = screen_management ? params.getInt("ScreenBrightness") : 101;
|
||||
scene.screen_brightness_onroad = screen_management ? params.getInt("ScreenBrightnessOnroad") : 101;
|
||||
scene.screen_recorder = screen_management && params.getBool("ScreenRecorder");
|
||||
scene.screen_timeout = screen_management ? params.getInt("ScreenTimeout") : 30;
|
||||
|
||||
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
||||
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
||||
@@ -582,6 +583,8 @@ void Device::setAwake(bool on) {
|
||||
void Device::resetInteractiveTimeout(int timeout) {
|
||||
if (timeout == -1) {
|
||||
timeout = (ignition_on ? 10 : 30);
|
||||
} else {
|
||||
timeout = timeout;
|
||||
}
|
||||
interactive_timeout = timeout * UI_FREQ;
|
||||
}
|
||||
@@ -624,7 +627,7 @@ void Device::updateWakefulness(const UIState &s) {
|
||||
ignition_on = s.scene.ignition;
|
||||
|
||||
if (ignition_just_turned_off) {
|
||||
resetInteractiveTimeout();
|
||||
resetInteractiveTimeout(s.scene.screen_timeout);
|
||||
} else if (interactive_timeout > 0 && --interactive_timeout == 0) {
|
||||
emit interactiveTimeout();
|
||||
}
|
||||
|
||||
@@ -251,6 +251,7 @@ typedef struct UIScene {
|
||||
int obstacle_distance_stock;
|
||||
int screen_brightness;
|
||||
int screen_brightness_onroad;
|
||||
int screen_timeout;
|
||||
int started_timer;
|
||||
int steering_angle_deg;
|
||||
int stopped_equivalence;
|
||||
|
||||
Reference in New Issue
Block a user