diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py index 6b78ef74f..89e62d89d 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", enable_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", enable_logging), diff --git a/selfdrive/ui/qt/offroad/settings.h b/selfdrive/ui/qt/offroad/settings.h index 00b8ef9ad..1f034923a 100644 --- a/selfdrive/ui/qt/offroad/settings.h +++ b/selfdrive/ui/qt/offroad/settings.h @@ -110,9 +110,11 @@ private: // FrogPilot variables void automaticUpdate(); + void updateState(); ButtonControl *updateTime; + bool isParked; int schedule; int time; }; diff --git a/selfdrive/ui/qt/offroad/software_settings.cc b/selfdrive/ui/qt/offroad/software_settings.cc index cb511031e..18d947673 100644 --- a/selfdrive/ui/qt/offroad/software_settings.cc +++ b/selfdrive/ui/qt/offroad/software_settings.cc @@ -148,11 +148,22 @@ SoftwarePanel::SoftwarePanel(QWidget* parent) : ListWidget(parent) { updateLabels(); }); - QObject::connect(uiState(), &UIState::uiUpdate, this, &SoftwarePanel::automaticUpdate); + QObject::connect(uiState(), &UIState::uiUpdate, this, &SoftwarePanel::updateState); updateLabels(); } +void SoftwarePanel::updateState() { + static bool previousIsParked = isParked; + isParked = (*uiState()->sm)["carState"].getCarState().getGearShifter() == cereal::CarState::GearShifter::PARK; + + if (isParked != previousIsParked) { + updateLabels(); + } + + automaticUpdate(); +} + void SoftwarePanel::showEvent(QShowEvent *event) { // nice for testing on PC installBtn->setEnabled(true); @@ -172,8 +183,8 @@ void SoftwarePanel::updateLabels() { } // updater only runs offroad - onroadLbl->setVisible(is_onroad); - downloadBtn->setVisible(!is_onroad); + onroadLbl->setVisible(is_onroad && !isParked); + downloadBtn->setVisible(!is_onroad || isParked); // download update QString updater_state = QString::fromStdString(params.get("UpdaterState")); @@ -205,7 +216,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 || isParked) && params.getBool("UpdateAvailable")); installBtn->setValue(QString::fromStdString(params.get("UpdaterNewDescription"))); installBtn->setDescription(QString::fromStdString(params.get("UpdaterNewReleaseNotes")));