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

Use "encoder port" instead of "built-in" for spark max built-in encoder #480

Merged
merged 1 commit into from
Feb 6, 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
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