13 #include "CallbackStore.h"
14 #include "mockdata/RoboRioData.h"
20 explicit RoboRioSim(
int index) { m_index = index; }
22 std::unique_ptr<CallbackStore> RegisterFPGAButtonCallback(
23 NotifyCallback callback,
bool initialNotify) {
24 auto store = std::make_unique<CallbackStore>(
25 m_index, -1, callback, &HALSIM_CancelRoboRioFPGAButtonCallback);
26 store->SetUid(HALSIM_RegisterRoboRioFPGAButtonCallback(
27 m_index, &CallbackStoreThunk, store.get(), initialNotify));
31 bool GetFPGAButton()
const {
return HALSIM_GetRoboRioFPGAButton(m_index); }
33 void SetFPGAButton(
bool fPGAButton) {
34 HALSIM_SetRoboRioFPGAButton(m_index, fPGAButton);
37 std::unique_ptr<CallbackStore> RegisterVInVoltageCallback(
38 NotifyCallback callback,
bool initialNotify) {
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelRoboRioVInVoltageCallback);
41 store->SetUid(HALSIM_RegisterRoboRioVInVoltageCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
46 double GetVInVoltage()
const {
return HALSIM_GetRoboRioVInVoltage(m_index); }
48 void SetVInVoltage(
double vInVoltage) {
49 HALSIM_SetRoboRioVInVoltage(m_index, vInVoltage);
52 std::unique_ptr<CallbackStore> RegisterVInCurrentCallback(
53 NotifyCallback callback,
bool initialNotify) {
54 auto store = std::make_unique<CallbackStore>(
55 m_index, -1, callback, &HALSIM_CancelRoboRioVInCurrentCallback);
56 store->SetUid(HALSIM_RegisterRoboRioVInCurrentCallback(
57 m_index, &CallbackStoreThunk, store.get(), initialNotify));
61 double GetVInCurrent()
const {
return HALSIM_GetRoboRioVInCurrent(m_index); }
63 void SetVInCurrent(
double vInCurrent) {
64 HALSIM_SetRoboRioVInCurrent(m_index, vInCurrent);
67 std::unique_ptr<CallbackStore> RegisterUserVoltage6VCallback(
68 NotifyCallback callback,
bool initialNotify) {
69 auto store = std::make_unique<CallbackStore>(
70 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage6VCallback);
71 store->SetUid(HALSIM_RegisterRoboRioUserVoltage6VCallback(
72 m_index, &CallbackStoreThunk, store.get(), initialNotify));
76 double GetUserVoltage6V()
const {
77 return HALSIM_GetRoboRioUserVoltage6V(m_index);
80 void SetUserVoltage6V(
double userVoltage6V) {
81 HALSIM_SetRoboRioUserVoltage6V(m_index, userVoltage6V);
84 std::unique_ptr<CallbackStore> RegisterUserCurrent6VCallback(
85 NotifyCallback callback,
bool initialNotify) {
86 auto store = std::make_unique<CallbackStore>(
87 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent6VCallback);
88 store->SetUid(HALSIM_RegisterRoboRioUserCurrent6VCallback(
89 m_index, &CallbackStoreThunk, store.get(), initialNotify));
93 double GetUserCurrent6V()
const {
94 return HALSIM_GetRoboRioUserCurrent6V(m_index);
97 void SetUserCurrent6V(
double userCurrent6V) {
98 HALSIM_SetRoboRioUserCurrent6V(m_index, userCurrent6V);
101 std::unique_ptr<CallbackStore> RegisterUserActive6VCallback(
102 NotifyCallback callback,
bool initialNotify) {
103 auto store = std::make_unique<CallbackStore>(
104 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive6VCallback);
105 store->SetUid(HALSIM_RegisterRoboRioUserActive6VCallback(
106 m_index, &CallbackStoreThunk, store.get(), initialNotify));
110 bool GetUserActive6V()
const {
111 return HALSIM_GetRoboRioUserActive6V(m_index);
114 void SetUserActive6V(
bool userActive6V) {
115 HALSIM_SetRoboRioUserActive6V(m_index, userActive6V);
118 std::unique_ptr<CallbackStore> RegisterUserVoltage5VCallback(
119 NotifyCallback callback,
bool initialNotify) {
120 auto store = std::make_unique<CallbackStore>(
121 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage5VCallback);
122 store->SetUid(HALSIM_RegisterRoboRioUserVoltage5VCallback(
123 m_index, &CallbackStoreThunk, store.get(), initialNotify));
127 double GetUserVoltage5V()
const {
128 return HALSIM_GetRoboRioUserVoltage5V(m_index);
131 void SetUserVoltage5V(
double userVoltage5V) {
132 HALSIM_SetRoboRioUserVoltage5V(m_index, userVoltage5V);
135 std::unique_ptr<CallbackStore> RegisterUserCurrent5VCallback(
136 NotifyCallback callback,
bool initialNotify) {
137 auto store = std::make_unique<CallbackStore>(
138 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent5VCallback);
139 store->SetUid(HALSIM_RegisterRoboRioUserCurrent5VCallback(
140 m_index, &CallbackStoreThunk, store.get(), initialNotify));
144 double GetUserCurrent5V()
const {
145 return HALSIM_GetRoboRioUserCurrent5V(m_index);
148 void SetUserCurrent5V(
double userCurrent5V) {
149 HALSIM_SetRoboRioUserCurrent5V(m_index, userCurrent5V);
152 std::unique_ptr<CallbackStore> RegisterUserActive5VCallback(
153 NotifyCallback callback,
bool initialNotify) {
154 auto store = std::make_unique<CallbackStore>(
155 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive5VCallback);
156 store->SetUid(HALSIM_RegisterRoboRioUserActive5VCallback(
157 m_index, &CallbackStoreThunk, store.get(), initialNotify));
161 bool GetUserActive5V()
const {
162 return HALSIM_GetRoboRioUserActive5V(m_index);
165 void SetUserActive5V(
bool userActive5V) {
166 HALSIM_SetRoboRioUserActive5V(m_index, userActive5V);
169 std::unique_ptr<CallbackStore> RegisterUserVoltage3V3Callback(
170 NotifyCallback callback,
bool initialNotify) {
171 auto store = std::make_unique<CallbackStore>(
172 m_index, -1, callback, &HALSIM_CancelRoboRioUserVoltage3V3Callback);
173 store->SetUid(HALSIM_RegisterRoboRioUserVoltage3V3Callback(
174 m_index, &CallbackStoreThunk, store.get(), initialNotify));
178 double GetUserVoltage3V3()
const {
179 return HALSIM_GetRoboRioUserVoltage3V3(m_index);
182 void SetUserVoltage3V3(
double userVoltage3V3) {
183 HALSIM_SetRoboRioUserVoltage3V3(m_index, userVoltage3V3);
186 std::unique_ptr<CallbackStore> RegisterUserCurrent3V3Callback(
187 NotifyCallback callback,
bool initialNotify) {
188 auto store = std::make_unique<CallbackStore>(
189 m_index, -1, callback, &HALSIM_CancelRoboRioUserCurrent3V3Callback);
190 store->SetUid(HALSIM_RegisterRoboRioUserCurrent3V3Callback(
191 m_index, &CallbackStoreThunk, store.get(), initialNotify));
195 double GetUserCurrent3V3()
const {
196 return HALSIM_GetRoboRioUserCurrent3V3(m_index);
199 void SetUserCurrent3V3(
double userCurrent3V3) {
200 HALSIM_SetRoboRioUserCurrent3V3(m_index, userCurrent3V3);
203 std::unique_ptr<CallbackStore> RegisterUserActive3V3Callback(
204 NotifyCallback callback,
bool initialNotify) {
205 auto store = std::make_unique<CallbackStore>(
206 m_index, -1, callback, &HALSIM_CancelRoboRioUserActive3V3Callback);
207 store->SetUid(HALSIM_RegisterRoboRioUserActive3V3Callback(
208 m_index, &CallbackStoreThunk, store.get(), initialNotify));
212 bool GetUserActive3V3()
const {
213 return HALSIM_GetRoboRioUserActive3V3(m_index);
216 void SetUserActive3V3(
bool userActive3V3) {
217 HALSIM_SetRoboRioUserActive3V3(m_index, userActive3V3);
220 std::unique_ptr<CallbackStore> RegisterUserFaults6VCallback(
221 NotifyCallback callback,
bool initialNotify) {
222 auto store = std::make_unique<CallbackStore>(
223 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults6VCallback);
224 store->SetUid(HALSIM_RegisterRoboRioUserFaults6VCallback(
225 m_index, &CallbackStoreThunk, store.get(), initialNotify));
229 int GetUserFaults6V()
const {
return HALSIM_GetRoboRioUserFaults6V(m_index); }
231 void SetUserFaults6V(
int userFaults6V) {
232 HALSIM_SetRoboRioUserFaults6V(m_index, userFaults6V);
235 std::unique_ptr<CallbackStore> RegisterUserFaults5VCallback(
236 NotifyCallback callback,
bool initialNotify) {
237 auto store = std::make_unique<CallbackStore>(
238 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults5VCallback);
239 store->SetUid(HALSIM_RegisterRoboRioUserFaults5VCallback(
240 m_index, &CallbackStoreThunk, store.get(), initialNotify));
244 int GetUserFaults5V()
const {
return HALSIM_GetRoboRioUserFaults5V(m_index); }
246 void SetUserFaults5V(
int userFaults5V) {
247 HALSIM_SetRoboRioUserFaults5V(m_index, userFaults5V);
250 std::unique_ptr<CallbackStore> RegisterUserFaults3V3Callback(
251 NotifyCallback callback,
bool initialNotify) {
252 auto store = std::make_unique<CallbackStore>(
253 m_index, -1, callback, &HALSIM_CancelRoboRioUserFaults3V3Callback);
254 store->SetUid(HALSIM_RegisterRoboRioUserFaults3V3Callback(
255 m_index, &CallbackStoreThunk, store.get(), initialNotify));
259 int GetUserFaults3V3()
const {
260 return HALSIM_GetRoboRioUserFaults3V3(m_index);
263 void SetUserFaults3V3(
int userFaults3V3) {
264 HALSIM_SetRoboRioUserFaults3V3(m_index, userFaults3V3);
267 void ResetData() { HALSIM_ResetRoboRioData(m_index); }