diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 91e2a76f02..741c09c266 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -41,24 +41,19 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { } void OnroadWindow::updateState(const UIState &s) { - QColor bgColor = bg_colors[s.status]; + bg = bg_colors[s.status]; Alert alert = Alert::get(*(s.sm), s.scene.started_frame); if (s.sm->updated("controlsState") || !alert.equal({})) { if (alert.type == "controlsUnresponsive") { - bgColor = bg_colors[STATUS_ALERT]; + bg = bg_colors[STATUS_ALERT]; } else if (alert.type == "controlsUnresponsivePermanent") { - bgColor = bg_colors[STATUS_DISENGAGED]; + bg = bg_colors[STATUS_DISENGAGED]; } - alerts->updateAlert(alert, bgColor); + alerts->updateAlert(alert, bg); } nvg->updateState(s); - - if (bg != bgColor) { - // repaint border - bg = bgColor; - update(); - } + nvg->update(); } void OnroadWindow::mousePressEvent(QMouseEvent* e) { diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc index 646d286ee7..e1ce7100be 100644 --- a/selfdrive/ui/qt/widgets/cameraview.cc +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -265,7 +265,6 @@ void CameraViewWidget::vipcConnected(VisionIpcClient *vipc_client) { void CameraViewWidget::vipcFrameReceived(VisionBuf *buf) { latest_frame = buf; - update(); } void CameraViewWidget::vipcThread() { diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 985b0259d2..0c416af8c1 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -118,7 +118,7 @@ static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) { } static void update_sockets(UIState *s) { - s->sm->update(0); + s->sm->update(1000 / UI_FREQ); } static void update_state(UIState *s) { @@ -230,11 +230,11 @@ void UIState::updateStatus() { } UIState::UIState(QObject *parent) : QObject(parent) { - sm = std::make_unique>({ + sm = std::make_unique, const std::initializer_list>({ "modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "roadCameraState", "pandaStates", "carParams", "driverMonitoringState", "sensorEvents", "carState", "liveLocationKalman", "wideRoadCameraState", "managerState", - }); + }, {"modelV2"}); Params params; wide_camera = Hardware::TICI() ? params.getBool("EnableWideCamera") : false; @@ -243,7 +243,7 @@ UIState::UIState(QObject *parent) : QObject(parent) { // update timer timer = new QTimer(this); QObject::connect(timer, &QTimer::timeout, this, &UIState::update); - timer->start(1000 / UI_FREQ); + timer->start(0); } void UIState::update() {