10 more lines for "all complete"

pull/35519/head
Shane Smiskol 5 days ago
parent d7f03ab189
commit de1ad0b738
  1. 27
      selfdrive/ui/qt/offroad/settings.cc

@ -329,12 +329,8 @@ void DevicePanel::updateCalibDescription() {
qInfo() << "invalid LiveDelay"; 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"); std::string torque_bytes = params.get("LiveTorqueParameters");
if (!torque_bytes.empty()) { if (!torque_bytes.empty()) {
try { try {
@ -343,16 +339,29 @@ void DevicePanel::updateCalibDescription() {
auto torque = cmsg.getRoot<cereal::Event>().getLiveTorqueParameters(); auto torque = cmsg.getRoot<cereal::Event>().getLiveTorqueParameters();
// don't add for non-torque cars // don't add for non-torque cars
if (torque.getUseParams()) { if (torque.getUseParams()) {
int torque_perc = torque.getCalPerc(); 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) { if (torque_perc < 100) {
desc += tr(" Steering torque response calibration is %1% complete.").arg(torque_perc); desc += tr(" Steering torque response calibration is %1% complete.").arg(torque_perc);
} else { } else {
desc += tr(" Steering torque response calibration is complete."); desc += tr(" Steering torque response calibration is complete.");
} }
} }
} catch (kj::Exception) {
qInfo() << "invalid LiveTorqueParameters";
}
} }
desc += tr("\n\nopenpilot is continuously calibrating, resetting is rarely required. " desc += tr("\n\nopenpilot is continuously calibrating, resetting is rarely required. "

Loading…
Cancel
Save