From de1ad0b7386f4c5d9967ea733edbe5bf1df5039c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 10 Jun 2025 01:34:31 -0700 Subject: [PATCH] 10 more lines for "all complete" --- selfdrive/ui/qt/offroad/settings.cc | 31 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 4ae1efaff3..4392890489 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -329,12 +329,8 @@ void DevicePanel::updateCalibDescription() { qInfo() << "invalid LiveDelay"; } } - if (lag_perc < 100) { - desc += tr("\n\nSteering lag calibration is %1% complete.").arg(lag_perc); - } else { - desc += tr("\n\nSteering lag calibration is complete."); - } + int torque_perc = -1; std::string torque_bytes = params.get("LiveTorqueParameters"); if (!torque_bytes.empty()) { try { @@ -343,18 +339,31 @@ void DevicePanel::updateCalibDescription() { auto torque = cmsg.getRoot().getLiveTorqueParameters(); // don't add for non-torque cars if (torque.getUseParams()) { - int torque_perc = torque.getCalPerc(); - if (torque_perc < 100) { - desc += tr(" Steering torque response calibration is %1% complete.").arg(torque_perc); - } else { - desc += tr(" Steering torque response calibration is complete."); - } + torque_perc = torque.getCalPerc(); } } catch (kj::Exception) { qInfo() << "invalid LiveTorqueParameters"; } } + if (lag_perc == 100 && torque_perc == 100) { + desc += tr("\n\nAll steering calibration is complete."); + } else { + if (lag_perc < 100) { + desc += tr("\n\nSteering lag calibration is %1% complete.").arg(lag_perc); + } else { + desc += tr("\n\nSteering lag calibration is complete."); + } + + if (torque_perc != -1) { + if (torque_perc < 100) { + desc += tr(" Steering torque response calibration is %1% complete.").arg(torque_perc); + } else { + desc += tr(" Steering torque response calibration is complete."); + } + } + } + desc += tr("\n\nopenpilot is continuously calibrating, resetting is rarely required. " "Resetting calibration will restart openpilot if the car is powered on."); resetCalibBtn->setDescription(desc);