From 748adb4c63baab7da2888abcb7b79c88546c07e3 Mon Sep 17 00:00:00 2001 From: sshane Date: Tue, 13 Jul 2021 14:58:54 -0700 Subject: [PATCH] ui: fix finish setup button (#21538) old-commit-hash: c10d46d336d91b9eb1732477d58351022485ce11 --- selfdrive/ui/qt/home.cc | 6 +++--- selfdrive/ui/ui.cc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 6299f54e7c..4800fc5c5b 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -25,15 +25,15 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) { slayout = new QStackedLayout(); main_layout->addLayout(slayout); + home = new OffroadHome(); + slayout->addWidget(home); + onroad = new OnroadWindow(this); slayout->addWidget(onroad); QObject::connect(this, &HomeWindow::update, onroad, &OnroadWindow::update); QObject::connect(this, &HomeWindow::offroadTransitionSignal, onroad, &OnroadWindow::offroadTransitionSignal); - home = new OffroadHome(); - slayout->addWidget(home); - driver_view = new DriverViewWindow(this); connect(driver_view, &DriverViewWindow::done, [=] { showDriverView(false); diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index f9b4f2eee7..62f621de4e 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -134,7 +134,7 @@ static void update_state(UIState *s) { scene.engageable = sm["controlsState"].getControlsState().getEngageable(); scene.dm_active = sm["driverMonitoringState"].getDriverMonitoringState().getIsActiveMode(); } - if (sm.updated("radarState")) { + if (sm.updated("radarState") && s->vg) { std::optional line; if (sm.rcv_frame("modelV2") > 0) { line = sm["modelV2"].getModelV2().getPosition(); @@ -158,7 +158,7 @@ static void update_state(UIState *s) { } } } - if (sm.updated("modelV2")) { + if (sm.updated("modelV2") && s->vg) { update_model(s, sm["modelV2"].getModelV2()); } if (sm.updated("pandaState")) {