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

Don't display LQR tolerance units in theoretical mode #527

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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