ui: reset live parameters and delay when reset calibration pressed (#35211)

* Reset params and lag too

* Old param too
pull/35218/head
Kacper Rączy 2 weeks ago committed by GitHub
parent 98c4a4582b
commit 1a3e342303
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      selfdrive/ui/qt/offroad/settings.cc

@ -194,6 +194,9 @@ DevicePanel::DevicePanel(SettingsWindow *parent) : ListWidget(parent) {
if (ConfirmationDialog::confirm(tr("Are you sure you want to reset calibration?"), tr("Reset"), this)) { if (ConfirmationDialog::confirm(tr("Are you sure you want to reset calibration?"), tr("Reset"), this)) {
params.remove("CalibrationParams"); params.remove("CalibrationParams");
params.remove("LiveTorqueParameters"); params.remove("LiveTorqueParameters");
params.remove("LiveParameters");
params.remove("LiveParametersV2");
params.remove("LiveDelay");
} }
}); });
addItem(resetCalibBtn); addItem(resetCalibBtn);
@ -326,7 +329,7 @@ void SettingsWindow::setCurrentPanel(int index, const QString &param) {
if (param.endsWith("Panel")) { if (param.endsWith("Panel")) {
QString panelName = param; QString panelName = param;
panelName.chop(5); // Remove "Panel" suffix panelName.chop(5); // Remove "Panel" suffix
// Find the panel by name // Find the panel by name
for (int i = 0; i < nav_btns->buttons().size(); i++) { for (int i = 0; i < nav_btns->buttons().size(); i++) {
if (nav_btns->buttons()[i]->text() == tr(panelName.toStdString().c_str())) { if (nav_btns->buttons()[i]->text() == tr(panelName.toStdString().c_str())) {
@ -338,7 +341,7 @@ void SettingsWindow::setCurrentPanel(int index, const QString &param) {
emit expandToggleDescription(param); emit expandToggleDescription(param);
} }
} }
panel_widget->setCurrentIndex(index); panel_widget->setCurrentIndex(index);
nav_btns->buttons()[index]->setChecked(true); nav_btns->buttons()[index]->setChecked(true);
} }

Loading…
Cancel
Save