10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/PCMData.h"
22 explicit PCMSim(
int index) { m_index = index; }
24 std::unique_ptr<CallbackStore> RegisterSolenoidInitializedCallback(
25 int channel, NotifyCallback callback,
bool initialNotify) {
26 auto store = std::make_unique<CallbackStore>(
27 m_index, channel, -1, callback,
28 &HALSIM_CancelPCMSolenoidInitializedCallback);
29 store->SetUid(HALSIM_RegisterPCMSolenoidInitializedCallback(
30 m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
34 bool GetSolenoidInitialized(
int channel)
const {
35 return HALSIM_GetPCMSolenoidInitialized(m_index, channel);
38 void SetSolenoidInitialized(
int channel,
bool solenoidInitialized) {
39 HALSIM_SetPCMSolenoidInitialized(m_index, channel, solenoidInitialized);
42 std::unique_ptr<CallbackStore> RegisterSolenoidOutputCallback(
43 int channel, NotifyCallback callback,
bool initialNotify) {
44 auto store = std::make_unique<CallbackStore>(
45 m_index, channel, -1, callback,
46 &HALSIM_CancelPCMSolenoidOutputCallback);
47 store->SetUid(HALSIM_RegisterPCMSolenoidOutputCallback(
48 m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
52 bool GetSolenoidOutput(
int channel)
const {
53 return HALSIM_GetPCMSolenoidOutput(m_index, channel);
56 void SetSolenoidOutput(
int channel,
bool solenoidOutput) {
57 HALSIM_SetPCMSolenoidOutput(m_index, channel, solenoidOutput);
60 std::unique_ptr<CallbackStore> RegisterCompressorInitializedCallback(
61 NotifyCallback callback,
bool initialNotify) {
62 auto store = std::make_unique<CallbackStore>(
63 m_index, -1, callback, &HALSIM_CancelPCMCompressorInitializedCallback);
64 store->SetUid(HALSIM_RegisterPCMCompressorInitializedCallback(
65 m_index, &CallbackStoreThunk, store.get(), initialNotify));
69 bool GetCompressorInitialized()
const {
70 return HALSIM_GetPCMCompressorInitialized(m_index);
73 void SetCompressorInitialized(
bool compressorInitialized) {
74 HALSIM_SetPCMCompressorInitialized(m_index, compressorInitialized);
77 std::unique_ptr<CallbackStore> RegisterCompressorOnCallback(
78 NotifyCallback callback,
bool initialNotify) {
79 auto store = std::make_unique<CallbackStore>(
80 m_index, -1, callback, &HALSIM_CancelPCMCompressorOnCallback);
81 store->SetUid(HALSIM_RegisterPCMCompressorOnCallback(
82 m_index, &CallbackStoreThunk, store.get(), initialNotify));
86 bool GetCompressorOn()
const {
return HALSIM_GetPCMCompressorOn(m_index); }
88 void SetCompressorOn(
bool compressorOn) {
89 HALSIM_SetPCMCompressorOn(m_index, compressorOn);
92 std::unique_ptr<CallbackStore> RegisterClosedLoopEnabledCallback(
93 NotifyCallback callback,
bool initialNotify) {
94 auto store = std::make_unique<CallbackStore>(
95 m_index, -1, callback, &HALSIM_CancelPCMClosedLoopEnabledCallback);
96 store->SetUid(HALSIM_RegisterPCMClosedLoopEnabledCallback(
97 m_index, &CallbackStoreThunk, store.get(), initialNotify));
101 bool GetClosedLoopEnabled()
const {
102 return HALSIM_GetPCMClosedLoopEnabled(m_index);
105 void SetClosedLoopEnabled(
bool closedLoopEnabled) {
106 HALSIM_SetPCMClosedLoopEnabled(m_index, closedLoopEnabled);
109 std::unique_ptr<CallbackStore> RegisterPressureSwitchCallback(
110 NotifyCallback callback,
bool initialNotify) {
111 auto store = std::make_unique<CallbackStore>(
112 m_index, -1, callback, &HALSIM_CancelPCMPressureSwitchCallback);
113 store->SetUid(HALSIM_RegisterPCMPressureSwitchCallback(
114 m_index, &CallbackStoreThunk, store.get(), initialNotify));
118 bool GetPressureSwitch()
const {
119 return HALSIM_GetPCMPressureSwitch(m_index);
122 void SetPressureSwitch(
bool pressureSwitch) {
123 HALSIM_SetPCMPressureSwitch(m_index, pressureSwitch);
126 std::unique_ptr<CallbackStore> RegisterCompressorCurrentCallback(
127 NotifyCallback callback,
bool initialNotify) {
128 auto store = std::make_unique<CallbackStore>(
129 m_index, -1, callback, &HALSIM_CancelPCMCompressorCurrentCallback);
130 store->SetUid(HALSIM_RegisterPCMCompressorCurrentCallback(
131 m_index, &CallbackStoreThunk, store.get(), initialNotify));
135 double GetCompressorCurrent()
const {
136 return HALSIM_GetPCMCompressorCurrent(m_index);
139 void SetCompressorCurrent(
double compressorCurrent) {
140 HALSIM_SetPCMCompressorCurrent(m_index, compressorCurrent);
143 void ResetData() { HALSIM_ResetPCMData(m_index); }
150 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18