Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Don't display LQR tolerance units in theoretical mode (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Sep 29, 2023
1 parent 97ff9bc commit 62e7b3d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions sysid-application/src/main/native/cpp/view/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,23 +815,29 @@ void Analyzer::DisplayFeedbackGains() {
// Come back to the starting y pos.
ImGui::SetCursorPosY(beginY);

std::string_view abbreviation = GetAbbreviation(m_manager->GetUnit());

if (m_selectedLoopType == 0) {
std::string unit;
if (m_state != AnalyzerState::kWaitingForJSON) {
unit = fmt::format(" ({})", GetAbbreviation(m_manager->GetUnit()));
}

ImGui::SetCursorPosX(ImGui::GetFontSize() * 9);
if (DisplayGain(
fmt::format("Max Position Error ({})", abbreviation).c_str(),
&m_settings.lqr.qp, false)) {
if (DisplayGain(fmt::format("Max Position Error{}", unit).c_str(),
&m_settings.lqr.qp, false)) {
if (m_settings.lqr.qp > 0) {
UpdateFeedbackGains();
}
}
}

std::string unit;
if (m_state != AnalyzerState::kWaitingForJSON) {
unit = fmt::format(" ({}/s)", GetAbbreviation(m_manager->GetUnit()));
}

ImGui::SetCursorPosX(ImGui::GetFontSize() * 9);
if (DisplayGain(
fmt::format("Max Velocity Error ({}/s)", abbreviation).c_str(),
&m_settings.lqr.qv, false)) {
if (DisplayGain(fmt::format("Max Velocity Error{}", unit).c_str(),
&m_settings.lqr.qv, false)) {
if (m_settings.lqr.qv > 0) {
UpdateFeedbackGains();
}
Expand Down

0 comments on commit 62e7b3d

Please sign in to comment.