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

Commit

Permalink
Use "encoder port" instead of "built-in" for spark max built-in encod…
Browse files Browse the repository at this point in the history
…er (#480)
  • Loading branch information
calcmogul authored Feb 6, 2023
1 parent 7eac698 commit 6b67f10
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions sysid-application/src/main/native/cpp/view/Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,21 +478,21 @@ void Generator::Display() {
m_settings.encoderType == sysid::encoder::kCANcoderPro)) {
// Samples Per Average Setting
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 4);
if (m_settings.encoderType == sysid::encoder::kBuiltInSetting) {
if (mainMotorController == sysid::motorcontroller::kSPARKMAXBrushless) {
if (ImGui::Combo("Samples Per Average", &m_numSamplesIdx,
kREVBuiltInNumSamples,
IM_ARRAYSIZE(kREVBuiltInNumSamples))) {
m_settings.numSamples =
std::stoi(kREVBuiltInNumSamples[m_numSamplesIdx]);
}
} else if (mainMotorController == sysid::motorcontroller::kTalonFX) {
if (ImGui::Combo("Samples Per Average", &m_numSamplesIdx,
kCTREBuiltInNumSamples,
IM_ARRAYSIZE(kCTREBuiltInNumSamples))) {
m_settings.numSamples =
std::stoi(kCTREBuiltInNumSamples[m_numSamplesIdx]);
}
if (mainMotorController == sysid::motorcontroller::kSPARKMAXBrushless &&
m_settings.encoderType == sysid::encoder::kSMaxEncoderPort) {
if (ImGui::Combo("Samples Per Average", &m_numSamplesIdx,
kREVBuiltInNumSamples,
IM_ARRAYSIZE(kREVBuiltInNumSamples))) {
m_settings.numSamples =
std::stoi(kREVBuiltInNumSamples[m_numSamplesIdx]);
}
} else if (mainMotorController == sysid::motorcontroller::kTalonFX &&
m_settings.encoderType == sysid::encoder::kBuiltInSetting) {
if (ImGui::Combo("Samples Per Average", &m_numSamplesIdx,
kCTREBuiltInNumSamples,
IM_ARRAYSIZE(kCTREBuiltInNumSamples))) {
m_settings.numSamples =
std::stoi(kCTREBuiltInNumSamples[m_numSamplesIdx]);
}
} else {
ImGui::InputInt("Samples Per Average", &m_settings.numSamples, 0, 0);
Expand Down

0 comments on commit 6b67f10

Please sign in to comment.