diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py index 76aee39..ad09c7d 100644 --- a/selfdrive/manager/process_config.py +++ b/selfdrive/manager/process_config.py @@ -91,7 +91,7 @@ procs = [ PythonProcess("radard", "selfdrive.controls.radard", only_onroad), PythonProcess("thermald", "selfdrive.thermald.thermald", always_run), PythonProcess("tombstoned", "selfdrive.tombstoned", allow_logging, enabled=not PC), - PythonProcess("updated", "selfdrive.updated", only_offroad, enabled=not PC), + PythonProcess("updated", "selfdrive.updated", always_run, enabled=not PC), PythonProcess("uploader", "system.loggerd.uploader", allow_uploads), PythonProcess("statsd", "selfdrive.statsd", allow_logging), diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 2de9263..bf9de1c 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -22,7 +22,6 @@ #include "selfdrive/ui/qt/widgets/scrollview.h" #include "selfdrive/ui/qt/widgets/ssh_keys.h" #include "selfdrive/ui/qt/widgets/toggle.h" -#include "selfdrive/ui/ui.h" #include "selfdrive/ui/qt/util.h" #include "selfdrive/ui/qt/qt_window.h" diff --git a/selfdrive/ui/qt/offroad/settings.h b/selfdrive/ui/qt/offroad/settings.h index a0ccd4f..9ab4112 100644 --- a/selfdrive/ui/qt/offroad/settings.h +++ b/selfdrive/ui/qt/offroad/settings.h @@ -13,6 +13,7 @@ #include "selfdrive/ui/qt/util.h" #include "selfdrive/ui/qt/widgets/controls.h" +#include "selfdrive/ui/ui.h" // ********** settings window + top-level panels ********** class SettingsWindow : public QFrame { @@ -114,6 +115,8 @@ private: // FrogPilot variables void automaticUpdate(); + UIScene &scene; + ButtonControl *updateTime; int schedule; diff --git a/selfdrive/ui/qt/offroad/software_settings.cc b/selfdrive/ui/qt/offroad/software_settings.cc index cb51103..da4c707 100644 --- a/selfdrive/ui/qt/offroad/software_settings.cc +++ b/selfdrive/ui/qt/offroad/software_settings.cc @@ -24,8 +24,8 @@ void SoftwarePanel::checkForUpdates() { std::system("pkill -SIGUSR1 -f selfdrive.updated"); } -SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) { - onroadLbl = new QLabel(tr("Updates are only downloaded while the car is off.")); +SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent), scene(uiState()->scene) { + onroadLbl = new QLabel(tr("Updates are only downloaded while the car is off or in park.")); onroadLbl->setStyleSheet("font-size: 50px; font-weight: 400; text-align: left; padding-top: 30px; padding-bottom: 30px;"); addItem(onroadLbl); @@ -171,9 +171,11 @@ void SoftwarePanel::updateLabels() { return; } - // updater only runs offroad - onroadLbl->setVisible(is_onroad); - downloadBtn->setVisible(!is_onroad); + // updater only runs offroad or when parked + bool parked = scene.parked; + + onroadLbl->setVisible(is_onroad && !parked); + downloadBtn->setVisible(!is_onroad || parked); // download update QString updater_state = QString::fromStdString(params.get("UpdaterState")); @@ -205,7 +207,7 @@ void SoftwarePanel::updateLabels() { versionLbl->setText(QString::fromStdString(params.get("UpdaterCurrentDescription"))); versionLbl->setDescription(QString::fromStdString(params.get("UpdaterCurrentReleaseNotes"))); - installBtn->setVisible(!is_onroad && params.getBool("UpdateAvailable")); + installBtn->setVisible((!is_onroad || parked) && params.getBool("UpdateAvailable")); installBtn->setValue(QString::fromStdString(params.get("UpdaterNewDescription"))); installBtn->setDescription(QString::fromStdString(params.get("UpdaterNewReleaseNotes"))); diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 71c4c06..735f79e 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -240,6 +240,7 @@ static void update_state(UIState *s) { if (scene.rotating_wheel) { scene.steering_angle_deg = carState.getSteeringAngleDeg(); } + scene.parked = carState.getGearShifter() == cereal::CarState::GearShifter::PARK; } if (sm.updated("controlsState")) { auto controlsState = sm["controlsState"].getControlsState(); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 1868771..285bb13 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -201,6 +201,7 @@ typedef struct UIScene { bool map_open; bool model_ui; bool numerical_temp; + bool parked; bool pedals_on_ui; bool reverse_cruise; bool reverse_cruise_ui;