Skip to content

Commit

Permalink
update all params in ui_update_params
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Nov 16, 2021
1 parent 85c03f1 commit 2292ec5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions selfdrive/ui/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ static void update_state(UIState *s) {
}

void ui_update_params(UIState *s) {
s->scene.is_metric = Params().getBool("IsMetric");
Params params;
s->scene.is_metric = params.getBool("IsMetric");
s->scene.end_to_end = params.getBool("EndToEndToggle");
s->has_prime = params.getBool("HasPrime");
s->wide_camera = Hardware::TICI() ? params.getBool("EnableWideCamera") : false;
}

static void update_status(UIState *s) {
Expand All @@ -209,8 +213,6 @@ static void update_status(UIState *s) {
if (s->scene.started) {
s->status = STATUS_DISENGAGED;
s->scene.started_frame = s->sm->frame;
s->scene.end_to_end = Params().getBool("EndToEndToggle");
s->wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false;
}
// Invisible until we receive a calibration message.
s->scene.world_objects_visible = false;
Expand All @@ -225,9 +227,7 @@ QUIState::QUIState(QObject *parent) : QObject(parent) {
"pandaStates", "carParams", "driverMonitoringState", "sensorEvents", "carState", "liveLocationKalman",
});

Params params;
ui_state.wide_camera = Hardware::TICI() ? params.getBool("EnableWideCamera") : false;
ui_state.has_prime = params.getBool("HasPrime");
ui_update_params(&ui_state);

// update timer
timer = new QTimer(this);
Expand Down

0 comments on commit 2292ec5

Please sign in to comment.