CTRE_Phoenix 5.20.2
WPI_VictorSPX.h
1
11#pragma once
12
13#include "ctre/phoenix/motorcontrol/can/VictorSPX.h"
14#include "ctre/phoenix/motorcontrol/can/WPI_BaseMotorController.h"
15#include "ctre/phoenix/platform/Platform.h"
16#include "ctre/phoenix/WPI_CallbackHelper.h"
17
18//Turn off dominance warning
19#if _MSC_VER
20 #pragma warning(push)
21 #pragma warning(disable : 4250)
22#endif
23
24using namespace ctre::phoenix;
25
26namespace ctre {
27namespace phoenix {
28namespace motorcontrol {
29namespace can {
30
34class WPI_VictorSPX: public virtual VictorSPX,
35 public virtual WPI_BaseMotorController
36{
37public:
42 WPI_VictorSPX(int deviceNumber);
43 virtual ~WPI_VictorSPX();
44
45 WPI_VictorSPX() = delete;
46 WPI_VictorSPX(WPI_VictorSPX const&) = delete;
47 WPI_VictorSPX& operator=(WPI_VictorSPX const&) = delete;
48
49 /* ----- virtual re-directs ------- */
50 virtual void Set(double value);
51 virtual void Set(ControlMode mode, double value);
52 virtual void Set(ControlMode mode, double demand0, DemandType demand1Type, double demand1);
53 virtual void Set(VictorSPXControlMode mode, double value);
54 virtual void Set(VictorSPXControlMode mode, double demand0, DemandType demand1Type, double demand1);
55 virtual void SetVoltage(units::volt_t output);
56 virtual void SetInverted(InvertType invertType);
57 virtual void SetInverted(bool bInvert);
58 virtual ctre::phoenix::ErrorCode ConfigSelectedFeedbackSensor(RemoteFeedbackDevice feedbackDevice, int pidIdx = 0, int timeoutMs = 0);
59
60protected:
61
62private:
63
64 hal::SimDevice m_simMotor;
65 hal::SimDouble m_simPercOut;
66 hal::SimDouble m_simMotorOutputLeadVoltage;
67 hal::SimDouble m_simVbat;
68
69 static void OnValueChanged(const char* name, void* param, HAL_SimValueHandle handle,
70 HAL_Bool readonly, const struct HAL_Value* value);
71 static void OnPeriodic(void* param);
72
73};
74
75} // namespace can
76} // namespace motorcontrol
77} // namespace phoenix
78} // namespace ctre
79
80#if _MSC_VER
81 #pragma warning(pop)
82#endif
Definition: WPI_BaseMotorController.h:56
virtual void Set(ControlMode mode, double demand0, DemandType demand1Type, double demand1)
virtual void Set(ControlMode mode, double value)
virtual ctre::phoenix::ErrorCode ConfigSelectedFeedbackSensor(RemoteFeedbackDevice feedbackDevice, int pidIdx=0, int timeoutMs=0)
virtual void SetInverted(InvertType invertType)
virtual void SetVoltage(units::volt_t output)
ControlMode
Definition: ControlMode.h:10
DemandType
Definition: DemandType.h:9
InvertType
Definition: InvertType.h:13
RemoteFeedbackDevice
Definition: FeedbackDevice.h:169
VictorSPXControlMode
Definition: ControlMode.h:143
Definition: ErrorCode.h:6
ErrorCode
Definition: ErrorCode.h:12
Definition: ErrorCode.h:5