lagd calib: hide on release (#35523)

* hide on release

* pull out
pull/35341/merge
Shane Smiskol 3 days ago committed by GitHub
parent 03d2e7b2b0
commit e345f25ce4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 37
      selfdrive/ui/qt/offroad/settings.cc

@ -317,21 +317,25 @@ void DevicePanel::updateCalibDescription() {
} }
} }
int lag_perc = 0; const bool is_release = params.getBool("IsReleaseBranch");
std::string lag_bytes = params.get("LiveDelay"); if (!is_release) {
if (!lag_bytes.empty()) { int lag_perc = 0;
try { std::string lag_bytes = params.get("LiveDelay");
AlignedBuffer aligned_buf; if (!lag_bytes.empty()) {
capnp::FlatArrayMessageReader cmsg(aligned_buf.align(lag_bytes.data(), lag_bytes.size())); try {
lag_perc = cmsg.getRoot<cereal::Event>().getLiveDelay().getCalPerc(); AlignedBuffer aligned_buf;
} catch (kj::Exception) { capnp::FlatArrayMessageReader cmsg(aligned_buf.align(lag_bytes.data(), lag_bytes.size()));
qInfo() << "invalid LiveDelay"; lag_perc = cmsg.getRoot<cereal::Event>().getLiveDelay().getCalPerc();
} catch (kj::Exception) {
qInfo() << "invalid LiveDelay";
}
}
desc += "\n\n";
if (lag_perc < 100) {
desc += tr("Steering lag calibration is %1% complete.").arg(lag_perc);
} else {
desc += tr("Steering lag calibration is complete.");
} }
}
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.");
} }
std::string torque_bytes = params.get("LiveTorqueParameters"); std::string torque_bytes = params.get("LiveTorqueParameters");
@ -343,10 +347,11 @@ void DevicePanel::updateCalibDescription() {
// 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(); int torque_perc = torque.getCalPerc();
desc += is_release ? "\n\n" : " ";
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) { } catch (kj::Exception) {

Loading…
Cancel
Save