10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/RoboRioData.h"
22 explicit RoboRioSim(
int index) { m_index = index; }
24 std::unique_ptr<CallbackStore> RegisterFPGAButtonCallback(
25 NotifyCallback callback,
bool initialNotify) {
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelRoboRioFPGAButtonCallback);
28 store->SetUid(HALSIM_RegisterRoboRioFPGAButtonCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
33 bool GetFPGAButton()
const {
return HALSIM_GetRoboRioFPGAButton(m_index); }
35 void SetFPGAButton(
bool fPGAButton) {
36 HALSIM_SetRoboRioFPGAButton(m_index, fPGAButton);
39 std::unique_ptr<CallbackStore> RegisterVInVoltageCallback(
40 NotifyCallback callback,
bool initialNotify) {
41 auto store = std::make_unique<CallbackStore>(
42 m_index, -1, callback, &HALSIM_CancelRoboRioVInVoltageCallback);
43 store->SetUid(HALSIM_RegisterRoboRioVInVoltageCallback(
44 m_index, &CallbackStoreThunk, store.get(), initialNotify));
48 double GetVInVoltage()
const {
return HALSIM_GetRoboRioVInVoltage(m_index); }
50 void SetVInVoltage(
double vInVoltage) {
51 HALSIM_SetRoboRioVInVoltage(m_index, vInVoltage);
54 std::unique_ptr<CallbackStore> RegisterVInCurrentCallback(
55 NotifyCallback callback,
bool initialNotify) {
56 auto store = std::make_unique<CallbackStore>(
57 m_index, -1, callback, &HALSIM_CancelRoboRioVInCurrentCallback);
58 store->SetUid(HALSIM_RegisterRoboRioVInCurrentCallback(
59 m_index, &CallbackStoreThunk, store.get(), initialNotify));
63 double GetVInCurrent()
const {
return HALSIM_GetRoboRioVInCurrent(m_index); }
65 void SetVInCurrent(
double vInCurrent) {
66 HALSIM_SetRoboRioVInCurrent(m_index, vInCurrent);
69 std::unique_ptr<CallbackStore> RegisterUserVoltage6VCallback(
70 NotifyCallback callback,
bool initialNotify) {
71 auto store = std::make_unique<CallbackStore>(
72 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage6VCallback);
73 store->SetUid(HALSIM_RegisterRoboRioUserVoltage6VCallback(
74 m_index, &CallbackStoreThunk, store.get(), initialNotify));
78 double GetUserVoltage6V()
const {
79 return HALSIM_GetRoboRioUserVoltage6V(m_index);
82 void SetUserVoltage6V(
double userVoltage6V) {
83 HALSIM_SetRoboRioUserVoltage6V(m_index, userVoltage6V);
86 std::unique_ptr<CallbackStore> RegisterUserCurrent6VCallback(
87 NotifyCallback callback,
bool initialNotify) {
88 auto store = std::make_unique<CallbackStore>(
89 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent6VCallback);
90 store->SetUid(HALSIM_RegisterRoboRioUserCurrent6VCallback(
91 m_index, &CallbackStoreThunk, store.get(), initialNotify));
95 double GetUserCurrent6V()
const {
96 return HALSIM_GetRoboRioUserCurrent6V(m_index);
99 void SetUserCurrent6V(
double userCurrent6V) {
100 HALSIM_SetRoboRioUserCurrent6V(m_index, userCurrent6V);
103 std::unique_ptr<CallbackStore> RegisterUserActive6VCallback(
104 NotifyCallback callback,
bool initialNotify) {
105 auto store = std::make_unique<CallbackStore>(
106 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive6VCallback);
107 store->SetUid(HALSIM_RegisterRoboRioUserActive6VCallback(
108 m_index, &CallbackStoreThunk, store.get(), initialNotify));
112 bool GetUserActive6V()
const {
113 return HALSIM_GetRoboRioUserActive6V(m_index);
116 void SetUserActive6V(
bool userActive6V) {
117 HALSIM_SetRoboRioUserActive6V(m_index, userActive6V);
120 std::unique_ptr<CallbackStore> RegisterUserVoltage5VCallback(
121 NotifyCallback callback,
bool initialNotify) {
122 auto store = std::make_unique<CallbackStore>(
123 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage5VCallback);
124 store->SetUid(HALSIM_RegisterRoboRioUserVoltage5VCallback(
125 m_index, &CallbackStoreThunk, store.get(), initialNotify));
129 double GetUserVoltage5V()
const {
130 return HALSIM_GetRoboRioUserVoltage5V(m_index);
133 void SetUserVoltage5V(
double userVoltage5V) {
134 HALSIM_SetRoboRioUserVoltage5V(m_index, userVoltage5V);
137 std::unique_ptr<CallbackStore> RegisterUserCurrent5VCallback(
138 NotifyCallback callback,
bool initialNotify) {
139 auto store = std::make_unique<CallbackStore>(
140 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent5VCallback);
141 store->SetUid(HALSIM_RegisterRoboRioUserCurrent5VCallback(
142 m_index, &CallbackStoreThunk, store.get(), initialNotify));
146 double GetUserCurrent5V()
const {
147 return HALSIM_GetRoboRioUserCurrent5V(m_index);
150 void SetUserCurrent5V(
double userCurrent5V) {
151 HALSIM_SetRoboRioUserCurrent5V(m_index, userCurrent5V);
154 std::unique_ptr<CallbackStore> RegisterUserActive5VCallback(
155 NotifyCallback callback,
bool initialNotify) {
156 auto store = std::make_unique<CallbackStore>(
157 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive5VCallback);
158 store->SetUid(HALSIM_RegisterRoboRioUserActive5VCallback(
159 m_index, &CallbackStoreThunk, store.get(), initialNotify));
163 bool GetUserActive5V()
const {
164 return HALSIM_GetRoboRioUserActive5V(m_index);
167 void SetUserActive5V(
bool userActive5V) {
168 HALSIM_SetRoboRioUserActive5V(m_index, userActive5V);
171 std::unique_ptr<CallbackStore> RegisterUserVoltage3V3Callback(
172 NotifyCallback callback,
bool initialNotify) {
173 auto store = std::make_unique<CallbackStore>(
174 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage3V3Callback);
175 store->SetUid(HALSIM_RegisterRoboRioUserVoltage3V3Callback(
176 m_index, &CallbackStoreThunk, store.get(), initialNotify));
180 double GetUserVoltage3V3()
const {
181 return HALSIM_GetRoboRioUserVoltage3V3(m_index);
184 void SetUserVoltage3V3(
double userVoltage3V3) {
185 HALSIM_SetRoboRioUserVoltage3V3(m_index, userVoltage3V3);
188 std::unique_ptr<CallbackStore> RegisterUserCurrent3V3Callback(
189 NotifyCallback callback,
bool initialNotify) {
190 auto store = std::make_unique<CallbackStore>(
191 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent3V3Callback);
192 store->SetUid(HALSIM_RegisterRoboRioUserCurrent3V3Callback(
193 m_index, &CallbackStoreThunk, store.get(), initialNotify));
197 double GetUserCurrent3V3()
const {
198 return HALSIM_GetRoboRioUserCurrent3V3(m_index);
201 void SetUserCurrent3V3(
double userCurrent3V3) {
202 HALSIM_SetRoboRioUserCurrent3V3(m_index, userCurrent3V3);
205 std::unique_ptr<CallbackStore> RegisterUserActive3V3Callback(
206 NotifyCallback callback,
bool initialNotify) {
207 auto store = std::make_unique<CallbackStore>(
208 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive3V3Callback);
209 store->SetUid(HALSIM_RegisterRoboRioUserActive3V3Callback(
210 m_index, &CallbackStoreThunk, store.get(), initialNotify));
214 bool GetUserActive3V3()
const {
215 return HALSIM_GetRoboRioUserActive3V3(m_index);
218 void SetUserActive3V3(
bool userActive3V3) {
219 HALSIM_SetRoboRioUserActive3V3(m_index, userActive3V3);
222 std::unique_ptr<CallbackStore> RegisterUserFaults6VCallback(
223 NotifyCallback callback,
bool initialNotify) {
224 auto store = std::make_unique<CallbackStore>(
225 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults6VCallback);
226 store->SetUid(HALSIM_RegisterRoboRioUserFaults6VCallback(
227 m_index, &CallbackStoreThunk, store.get(), initialNotify));
231 int GetUserFaults6V()
const {
return HALSIM_GetRoboRioUserFaults6V(m_index); }
233 void SetUserFaults6V(
int userFaults6V) {
234 HALSIM_SetRoboRioUserFaults6V(m_index, userFaults6V);
237 std::unique_ptr<CallbackStore> RegisterUserFaults5VCallback(
238 NotifyCallback callback,
bool initialNotify) {
239 auto store = std::make_unique<CallbackStore>(
240 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults5VCallback);
241 store->SetUid(HALSIM_RegisterRoboRioUserFaults5VCallback(
242 m_index, &CallbackStoreThunk, store.get(), initialNotify));
246 int GetUserFaults5V()
const {
return HALSIM_GetRoboRioUserFaults5V(m_index); }
248 void SetUserFaults5V(
int userFaults5V) {
249 HALSIM_SetRoboRioUserFaults5V(m_index, userFaults5V);
252 std::unique_ptr<CallbackStore> RegisterUserFaults3V3Callback(
253 NotifyCallback callback,
bool initialNotify) {
254 auto store = std::make_unique<CallbackStore>(
255 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults3V3Callback);
256 store->SetUid(HALSIM_RegisterRoboRioUserFaults3V3Callback(
257 m_index, &CallbackStoreThunk, store.get(), initialNotify));
261 int GetUserFaults3V3()
const {
262 return HALSIM_GetRoboRioUserFaults3V3(m_index);
265 void SetUserFaults3V3(
int userFaults3V3) {
266 HALSIM_SetRoboRioUserFaults3V3(m_index, userFaults3V3);
269 void ResetData() { HALSIM_ResetRoboRioData(m_index); }
276 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: RoboRioSim.h:20