From 1c6fe85a7b990e3e16dcab32c716efd2b7f971ba Mon Sep 17 00:00:00 2001 From: Sam Carlberg Date: Thu, 3 Dec 2015 10:45:26 -0500 Subject: [PATCH] Fixes CAN devices in C++ library not showing in the livewindow Change-Id: I47a9d6370b4b2573272881258d4bb46aa149bed0 --- wpilibc/Athena/include/CANSpeedController.h | 13 ------------- wpilibc/Athena/src/CANJaguar.cpp | 2 +- wpilibc/Athena/src/CANTalon.cpp | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/wpilibc/Athena/include/CANSpeedController.h b/wpilibc/Athena/include/CANSpeedController.h index 5ef8cfa250..1abe03ba3d 100644 --- a/wpilibc/Athena/include/CANSpeedController.h +++ b/wpilibc/Athena/include/CANSpeedController.h @@ -24,19 +24,6 @@ class CANSpeedController : public SpeedController { kMotionProfile = 6, // Not supported in Jaguar. }; - // Helper function for the ControlMode enum - std::string GetModeName(ControlMode mode) { - switch(mode) { - case kPercentVbus: return "PercentVbus"; - case kCurrent: return "Current"; - case kSpeed: return "Speed"; - case kPosition: return "Position"; - case kVoltage: return "Voltage"; - case kFollower: return "Follower"; - default: return "[unknown control mode]"; - } - } - // Helper function for the ControlMode enum virtual bool IsModePID(ControlMode mode) const = 0; diff --git a/wpilibc/Athena/src/CANJaguar.cpp b/wpilibc/Athena/src/CANJaguar.cpp index 2b4cd029eb..be9844589b 100644 --- a/wpilibc/Athena/src/CANJaguar.cpp +++ b/wpilibc/Athena/src/CANJaguar.cpp @@ -1981,7 +1981,7 @@ void CANJaguar::UpdateTable() { if (m_table != nullptr) { m_table->PutString("~TYPE~", "CANSpeedController"); m_table->PutString("Type", "CANJaguar"); - m_table->PutString("Mode", GetModeName(m_controlMode)); + m_table->PutNumber("Mode", m_controlMode); if (IsModePID(m_controlMode)) { m_table->PutNumber("p", GetP()); m_table->PutNumber("i", GetI()); diff --git a/wpilibc/Athena/src/CANTalon.cpp b/wpilibc/Athena/src/CANTalon.cpp index 765c7c4289..22d9e308b8 100644 --- a/wpilibc/Athena/src/CANTalon.cpp +++ b/wpilibc/Athena/src/CANTalon.cpp @@ -1852,7 +1852,7 @@ void CANTalon::UpdateTable() { if (m_table != nullptr) { m_table->PutString("~TYPE~", "CANSpeedController"); m_table->PutString("Type", "CANTalon"); - m_table->PutString("Mode", GetModeName(m_controlMode)); + m_table->PutNumber("Mode", m_controlMode); m_table->PutNumber("p", GetP()); m_table->PutNumber("i", GetI()); m_table->PutNumber("d", GetD());