This commit is contained in:
firestar5683
2026-04-05 15:05:38 -05:00
parent ba4cca6221
commit b6fa173103
39 changed files with 43 additions and 16 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
extern const uint8_t gitversion[19];
const uint8_t gitversion[19] = "DEV-46d6d0ac-DEBUG";
const uint8_t gitversion[19] = "DEV-ba4cca62-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-46d6d0ac-DEBUG
DEV-ba4cca62-DEBUG
@@ -169,6 +169,8 @@ class StarPilotScreenLayout(StarPilotPanel):
def _get_brightness(self, key):
v = self._params.get_int(key)
if key == "ScreenBrightnessOnroad" and v == 0:
v = 1
if v == 0:
return tr("Off")
if v == 101:
@@ -179,12 +181,20 @@ class StarPilotScreenLayout(StarPilotPanel):
def on_close(res, val):
if res == DialogResult.CONFIRM:
new_v = int(val)
if key == "ScreenBrightnessOnroad":
new_v = max(new_v, 1)
self._params.put_int(key, new_v)
HARDWARE.set_brightness(new_v)
self._rebuild_grid()
min_value = 1 if key == "ScreenBrightnessOnroad" else 0
current_value = max(self._params.get_int(key), min_value)
labels = {101: tr("Auto")}
if min_value == 0:
labels[0] = tr("Off")
gui_app.set_modal_overlay(
AetherSliderDialog(tr(key), 0, 101, 1, self._params.get_int(key), on_close, unit="%", labels={0: tr("Off"), 101: tr("Auto")}, color="#D43D8A")
AetherSliderDialog(tr(key), min_value, 101, 1, current_value, on_close, unit="%", labels=labels, color="#D43D8A")
)
def _show_timeout_selector(self, key):
BIN
View File
Binary file not shown.
+21 -8
View File
@@ -107,7 +107,20 @@ void UIState::updateStatus(StarPilotUIState *fs) {
status = ss.getEnabled() ? STATUS_ENGAGED : STATUS_DISENGAGED;
}
starpilot_scene.wake_up_screen = ss.getAlertStatus() != cereal::SelfdriveState::AlertStatus::NORMAL || (status != previous_status && status != STATUS_OVERRIDE);
const bool selfdrive_visible_alert = ss.getAlertSize() != cereal::SelfdriveState::AlertSize::NONE;
bool starpilot_visible_alert = false;
if (fs->sm->rcv_frame("starpilotSelfdriveState") > 0) {
const auto fpss = (*fs->sm)["starpilotSelfdriveState"].getStarpilotSelfdriveState();
starpilot_visible_alert = fpss.getAlertSize() != cereal::StarPilotSelfdriveState::AlertSize::NONE;
}
// Standby mode should wake for any visible onroad alert, not just elevated
// alert statuses. Calibration uses NORMAL status but still needs to wake.
starpilot_scene.wake_up_screen =
selfdrive_visible_alert ||
starpilot_visible_alert ||
ss.getAlertStatus() != cereal::SelfdriveState::AlertStatus::NORMAL ||
(status != previous_status && status != STATUS_OVERRIDE);
}
if (engaged() != engaged_prev) {
@@ -199,6 +212,8 @@ void Device::resetInteractiveTimeout(int timeout, int timeout_onroad) {
void Device::updateBrightness(const UIState &s, const StarPilotUIState &fs) {
const StarPilotUIScene &starpilot_scene = fs.starpilot_scene;
const QJsonObject &starpilot_toggles = starpilot_scene.starpilot_toggles;
const int screen_brightness_onroad = starpilot_toggles.value("screen_brightness_onroad").toInt();
const int clamped_onroad_brightness = std::clamp(screen_brightness_onroad, 1, 100);
float clipped_brightness = offroad_brightness;
if (s.scene.started && s.scene.light_sensor >= 0) {
@@ -220,8 +235,10 @@ void Device::updateBrightness(const UIState &s, const StarPilotUIState &fs) {
brightness = 0;
} else if (s.scene.started && !starpilot_scene.wake_up_screen && interactive_timeout == 0 && starpilot_toggles.value("standby_mode").toBool()) {
brightness = 0;
} else if (s.scene.started && starpilot_toggles.value("screen_brightness_onroad").toInt() != 101) {
brightness = interactive_timeout > 0 ? fmax(5, starpilot_toggles.value("screen_brightness_onroad").toInt()) : starpilot_toggles.value("screen_brightness_onroad").toInt();
} else if (s.scene.started && screen_brightness_onroad != 101) {
// Guard against stale params that may still contain the old onroad "off"
// value. Standby mode is the only supported way to blank the screen onroad.
brightness = interactive_timeout > 0 ? std::max(5, clamped_onroad_brightness) : clamped_onroad_brightness;
} else if (starpilot_toggles.value("screen_brightness").toInt() != 101) {
brightness = starpilot_toggles.value("screen_brightness").toInt();
}
@@ -252,11 +269,7 @@ void Device::updateWakefulness(const UIState &s, const StarPilotUIState &fs) {
}
if (ignition_state_changed) {
if (ignition_on && starpilot_toggles.value("screen_brightness_onroad").toInt() == 0 && !standby_mode) {
resetInteractiveTimeout(0, 0);
} else {
resetInteractiveTimeout(screen_timeout, screen_timeout_onroad);
}
resetInteractiveTimeout(screen_timeout, screen_timeout_onroad);
} else if (interactive_timeout > 0 && --interactive_timeout == 0) {
emit interactiveTimeout();
}
+1 -1
View File
@@ -911,7 +911,7 @@ class StarPilotVariables:
screen_management = self.get_value("ScreenManagement")
toggle.screen_brightness = max(self.get_value("ScreenBrightness", cast=float, condition=screen_management), 1)
toggle.screen_brightness_onroad = self.get_value("ScreenBrightnessOnroad", cast=float, condition=(screen_management and not toggle.force_onroad))
toggle.screen_brightness_onroad = self.get_value("ScreenBrightnessOnroad", cast=float, condition=(screen_management and not toggle.force_onroad), min=1)
toggle.screen_recorder = self.get_value("ScreenRecorder", condition=screen_management) or toggle.debug_mode
toggle.screen_timeout = self.get_value("ScreenTimeout", cast=float, condition=screen_management)
toggle.screen_timeout_onroad = self.get_value("ScreenTimeoutOnroad", cast=float, condition=screen_management)
@@ -268,7 +268,7 @@ function numericBounds(param) {
return { min: 1, max: 101, step: 1 }
}
if (param.key === "ScreenBrightnessOnroad") {
return { min: 0, max: 101, step: 1 }
return { min: 1, max: 101, step: 1 }
}
// Personality jerk params are stored as percentage-style integers (25..200).
@@ -2317,6 +2317,8 @@
"description": "The screen brightness while not driving.",
"data_type": "int",
"ui_type": "numeric",
"min": 1.0,
"max": 101.0,
"step": 1.0,
"parent_key": "ScreenManagement"
},
@@ -2326,6 +2328,8 @@
"description": "The screen brightness while driving.",
"data_type": "int",
"ui_type": "numeric",
"min": 1.0,
"max": 101.0,
"step": 1.0,
"parent_key": "ScreenManagement"
},
+3 -3
View File
@@ -74,9 +74,9 @@ StarPilotDevicePanel::StarPilotDevicePanel(StarPilotSettingsWindow *parent, bool
deviceToggle = screenToggle;
} else if (param == "ScreenBrightness" || param == "ScreenBrightnessOnroad") {
std::map<float, QString> brightnessLabels;
int minBrightness = (param == "ScreenBrightnessOnroad") ? 0 : 1;
for (int i = 0; i <= 101; ++i) {
brightnessLabels[i] = i == 0 ? tr("Screen Off") : i == 101 ? tr("Auto") : QString::number(i) + "%";
const int minBrightness = 1;
for (int i = minBrightness; i <= 101; ++i) {
brightnessLabels[i] = i == 101 ? tr("Auto") : QString::number(i) + "%";
}
deviceToggle = new StarPilotParamValueControl(param, title, desc, icon, minBrightness, 101, QString(), brightnessLabels, 1, true);
} else if (param == "ScreenRecorder") {