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));
33 bool GetInitialized()
const {
return HALSIM_GetPDPInitialized(m_index); }
35 void SetInitialized(
bool initialized) {
36 HALSIM_SetPDPInitialized(m_index, initialized);
39 std::unique_ptr<CallbackStore> RegisterTemperatureCallback(
40 NotifyCallback callback,
bool initialNotify) {
41 auto store = std::make_unique<CallbackStore>(
42 m_index, -1, callback, &HALSIM_CancelPDPTemperatureCallback);
43 store->SetUid(HALSIM_RegisterPDPTemperatureCallback(
44 m_index, &CallbackStoreThunk, store.get(), initialNotify));
48 double GetTemperature()
const {
return HALSIM_GetPDPTemperature(m_index); }
50 void SetTemperature(
double temperature) {
51 HALSIM_SetPDPTemperature(m_index, temperature);
54 std::unique_ptr<CallbackStore> RegisterVoltageCallback(
55 NotifyCallback callback,
bool initialNotify) {
56 auto store = std::make_unique<CallbackStore>(
57 m_index, -1, callback, &HALSIM_CancelPDPVoltageCallback);
58 store->SetUid(HALSIM_RegisterPDPVoltageCallback(
59 m_index, &CallbackStoreThunk, store.get(), initialNotify));
63 double GetVoltage()
const {
return HALSIM_GetPDPVoltage(m_index); }
65 void SetVoltage(
double voltage) { HALSIM_SetPDPVoltage(m_index, voltage); }
67 std::unique_ptr<CallbackStore> RegisterCurrentCallback(
68 int channel, NotifyCallback callback,
bool initialNotify) {
69 auto store = std::make_unique<CallbackStore>(
70 m_index, channel, -1, callback, &HALSIM_CancelPDPCurrentCallback);
71 store->SetUid(HALSIM_RegisterPDPCurrentCallback(
72 m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
76 double GetCurrent(
int channel)
const {
77 return HALSIM_GetPDPCurrent(m_index, channel);
80 void SetCurrent(
int channel,
double current) {
81 HALSIM_SetPDPCurrent(m_index, channel, current);
84 void ResetData() { HALSIM_ResetPDPData(m_index); }
91 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18