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));
33 bool GetSolenoidInitialized(
int channel) {
34 return HALSIM_GetPCMSolenoidInitialized(m_index, channel);
36 void SetSolenoidInitialized(
int channel,
bool solenoidInitialized) {
37 HALSIM_SetPCMSolenoidInitialized(m_index, channel, solenoidInitialized);
40 std::unique_ptr<CallbackStore> RegisterSolenoidOutputCallback(
41 int channel, NotifyCallback callback,
bool initialNotify) {
42 auto store = std::make_unique<CallbackStore>(
43 m_index, channel, -1, callback,
44 &HALSIM_CancelPCMSolenoidOutputCallback);
45 store->SetUid(HALSIM_RegisterPCMSolenoidOutputCallback(
46 m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
49 bool GetSolenoidOutput(
int channel) {
50 return HALSIM_GetPCMSolenoidOutput(m_index, channel);
52 void SetSolenoidOutput(
int channel,
bool solenoidOutput) {
53 HALSIM_SetPCMSolenoidOutput(m_index, channel, solenoidOutput);
56 std::unique_ptr<CallbackStore> RegisterCompressorInitializedCallback(
57 NotifyCallback callback,
bool initialNotify) {
58 auto store = std::make_unique<CallbackStore>(
59 m_index, -1, callback, &HALSIM_CancelPCMCompressorInitializedCallback);
60 store->SetUid(HALSIM_RegisterPCMCompressorInitializedCallback(
61 m_index, &CallbackStoreThunk, store.get(), initialNotify));
64 bool GetCompressorInitialized() {
65 return HALSIM_GetPCMCompressorInitialized(m_index);
67 void SetCompressorInitialized(
bool compressorInitialized) {
68 HALSIM_SetPCMCompressorInitialized(m_index, compressorInitialized);
71 std::unique_ptr<CallbackStore> RegisterCompressorOnCallback(
72 NotifyCallback callback,
bool initialNotify) {
73 auto store = std::make_unique<CallbackStore>(
74 m_index, -1, callback, &HALSIM_CancelPCMCompressorOnCallback);
75 store->SetUid(HALSIM_RegisterPCMCompressorOnCallback(
76 m_index, &CallbackStoreThunk, store.get(), initialNotify));
79 bool GetCompressorOn() {
return HALSIM_GetPCMCompressorOn(m_index); }
80 void SetCompressorOn(
bool compressorOn) {
81 HALSIM_SetPCMCompressorOn(m_index, compressorOn);
84 std::unique_ptr<CallbackStore> RegisterClosedLoopEnabledCallback(
85 NotifyCallback callback,
bool initialNotify) {
86 auto store = std::make_unique<CallbackStore>(
87 m_index, -1, callback, &HALSIM_CancelPCMClosedLoopEnabledCallback);
88 store->SetUid(HALSIM_RegisterPCMClosedLoopEnabledCallback(
89 m_index, &CallbackStoreThunk, store.get(), initialNotify));
92 bool GetClosedLoopEnabled() {
93 return HALSIM_GetPCMClosedLoopEnabled(m_index);
95 void SetClosedLoopEnabled(
bool closedLoopEnabled) {
96 HALSIM_SetPCMClosedLoopEnabled(m_index, closedLoopEnabled);
99 std::unique_ptr<CallbackStore> RegisterPressureSwitchCallback(
100 NotifyCallback callback,
bool initialNotify) {
101 auto store = std::make_unique<CallbackStore>(
102 m_index, -1, callback, &HALSIM_CancelPCMPressureSwitchCallback);
103 store->SetUid(HALSIM_RegisterPCMPressureSwitchCallback(
104 m_index, &CallbackStoreThunk, store.get(), initialNotify));
107 bool GetPressureSwitch() {
return HALSIM_GetPCMPressureSwitch(m_index); }
108 void SetPressureSwitch(
bool pressureSwitch) {
109 HALSIM_SetPCMPressureSwitch(m_index, pressureSwitch);
112 std::unique_ptr<CallbackStore> RegisterCompressorCurrentCallback(
113 NotifyCallback callback,
bool initialNotify) {
114 auto store = std::make_unique<CallbackStore>(
115 m_index, -1, callback, &HALSIM_CancelPCMCompressorCurrentCallback);
116 store->SetUid(HALSIM_RegisterPCMCompressorCurrentCallback(
117 m_index, &CallbackStoreThunk, store.get(), initialNotify));
120 double GetCompressorCurrent() {
121 return HALSIM_GetPCMCompressorCurrent(m_index);
123 void SetCompressorCurrent(
double compressorCurrent) {
124 HALSIM_SetPCMCompressorCurrent(m_index, compressorCurrent);
127 void ResetData() { HALSIM_ResetPCMData(m_index); }
134 #endif // __FRC_ROBORIO__
Definition: SPIAccelerometerSim.h:18