Developer sidebar fix

Auto-tune off would still display auto-tune values.
Correct chosen values were being used but not displayed.
This commit is contained in:
whoisdomi
2026-05-01 15:00:42 -05:00
parent b77341c804
commit 943a060db2
+4 -3
View File
@@ -78,7 +78,8 @@ void DeveloperSidebar::updateState(const UIState &s, const StarPilotUIState &fs)
const cereal::LiveDelayData::Reader &liveDelay = fpsm["liveDelay"].getLiveDelay();
const cereal::LiveParametersData::Reader &liveParameters = fpsm["liveParameters"].getLiveParameters();
const cereal::LiveTorqueParametersData::Reader &liveTorqueParameters = fpsm["liveTorqueParameters"].getLiveTorqueParameters();
const bool usingLiveTorqueTune = liveTorqueParameters.getUseParams() || starpilot_scene.starpilot_toggles.value("force_auto_tune").toBool();
const bool forceAutoTuneOff = starpilot_scene.starpilot_toggles.value("force_auto_tune_off").toBool();
const bool usingLiveTorqueTune = !forceAutoTuneOff && (liveTorqueParameters.getUseParams() || starpilot_scene.starpilot_toggles.value("force_auto_tune").toBool());
const bool is_metric = s.scene.is_metric;
const bool use_si = starpilot_scene.starpilot_toggles.value("use_si_metrics").toBool();
@@ -125,12 +126,12 @@ void DeveloperSidebar::updateState(const UIState &s, const StarPilotUIState &fs)
float displayedFriction = usingLiveTorqueTune ? liveTorqueParameters.getFrictionCoefficientFiltered() : params.getFloat("SteerFrictionStock");
if (displayedFriction == 0.0f) {
displayedFriction = liveTorqueParameters.getFrictionCoefficientFiltered();
displayedFriction = forceAutoTuneOff ? params.getFloat("SteerFriction") : liveTorqueParameters.getFrictionCoefficientFiltered();
}
float displayedLatAccel = usingLiveTorqueTune ? liveTorqueParameters.getLatAccelFactorFiltered() : params.getFloat("SteerLatAccelStock");
if (displayedLatAccel == 0.0f) {
displayedLatAccel = liveTorqueParameters.getLatAccelFactorFiltered();
displayedLatAccel = forceAutoTuneOff ? params.getFloat("SteerLatAccel") : liveTorqueParameters.getLatAccelFactorFiltered();
}
accelerationStatus = ItemStatus(QPair<QString, QString>(tr("ACCEL"), QString::number(acceleration, 'f', 2) + accelerationUnit), metricColor);