10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/PDPData.h"
22 explicit PDPSim(
int index) { m_index = index; }
24 std::unique_ptr<CallbackStore> RegisterInitializedCallback(
25 NotifyCallback callback,
bool initialNotify) {
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelPDPInitializedCallback);
28 store->SetUid(HALSIM_RegisterPDPInitializedCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
32 bool GetInitialized() {
return HALSIM_GetPDPInitialized(m_index); }
33 void SetInitialized(
bool initialized) {
34 HALSIM_SetPDPInitialized(m_index, initialized);
37 std::unique_ptr<CallbackStore> RegisterTemperatureCallback(
38 NotifyCallback callback,
bool initialNotify) {
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelPDPTemperatureCallback);
41 store->SetUid(HALSIM_RegisterPDPTemperatureCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
45 double GetTemperature() {
return HALSIM_GetPDPTemperature(m_index); }
46 void SetTemperature(
double temperature) {
47 HALSIM_SetPDPTemperature(m_index, temperature);
50 std::unique_ptr<CallbackStore> RegisterVoltageCallback(
51 NotifyCallback callback,
bool initialNotify) {
52 auto store = std::make_unique<CallbackStore>(
53 m_index, -1, callback, &HALSIM_CancelPDPVoltageCallback);
54 store->SetUid(HALSIM_RegisterPDPVoltageCallback(
55 m_index, &CallbackStoreThunk, store.get(), initialNotify));
58 double GetVoltage() {
return HALSIM_GetPDPVoltage(m_index); }
59 void SetVoltage(
double voltage) { HALSIM_SetPDPVoltage(m_index, voltage); }
61 std::unique_ptr<CallbackStore> RegisterCurrentCallback(
62 int channel, NotifyCallback callback,
bool initialNotify) {
63 auto store = std::make_unique<CallbackStore>(
64 m_index, channel, -1, callback, &HALSIM_CancelPDPCurrentCallback);
65 store->SetUid(HALSIM_RegisterPDPCurrentCallback(
66 m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
69 double GetCurrent(
int channel) {
70 return HALSIM_GetPDPCurrent(m_index, channel);
72 void SetCurrent(
int channel,
double current) {
73 HALSIM_SetPDPCurrent(m_index, channel, current);
76 void ResetData() { HALSIM_ResetPDPData(m_index); }
83 #endif // __FRC_ROBORIO__
Definition: SPIAccelerometerSim.h:18