mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
UI: remove burn in prevention (#23173)
old-commit-hash: 755ec71c051b20238185039a0d85272a7c9a66d6
This commit is contained in:
@@ -106,7 +106,6 @@ static void update_sockets(UIState *s) {
|
||||
static void update_state(UIState *s) {
|
||||
SubMaster &sm = *(s->sm);
|
||||
UIScene &scene = s->scene;
|
||||
s->running_time = 1e-9 * (nanos_since_boot() - sm["deviceState"].getDeviceState().getStartedMonoTime());
|
||||
|
||||
if (sm.updated("modelV2")) {
|
||||
update_model(s, sm["modelV2"].getModelV2());
|
||||
@@ -290,16 +289,6 @@ void Device::updateBrightness(const UIState &s) {
|
||||
|
||||
// Scale back to 10% to 100%
|
||||
clipped_brightness = std::clamp(100.0f * clipped_brightness, 10.0f, 100.0f);
|
||||
|
||||
// Limit brightness if running for too long
|
||||
if (Hardware::TICI()) {
|
||||
const float MAX_BRIGHTNESS_HOURS = 4;
|
||||
const float HOURLY_BRIGHTNESS_DECREASE = 5;
|
||||
float ui_running_hours = s.running_time / (60*60);
|
||||
float anti_burnin_max_percent = std::clamp(100.0f - HOURLY_BRIGHTNESS_DECREASE * (ui_running_hours - MAX_BRIGHTNESS_HOURS),
|
||||
30.0f, 100.0f);
|
||||
clipped_brightness = std::min(clipped_brightness, anti_burnin_max_percent);
|
||||
}
|
||||
}
|
||||
|
||||
int brightness = brightness_filter.update(clipped_brightness);
|
||||
|
||||
@@ -114,8 +114,6 @@ typedef struct UIState {
|
||||
|
||||
QTransform car_space_transform;
|
||||
bool wide_camera;
|
||||
|
||||
float running_time;
|
||||
} UIState;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user