Fix spacing and const correctness in sim (#1269)

This commit is contained in:
PJ Reiniger
2018-08-16 01:17:59 -04:00
committed by Peter Johnson
parent 44099d9a21
commit 1462a5bd46
17 changed files with 294 additions and 86 deletions

View File

@@ -29,7 +29,9 @@ class AccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetActive() { return HALSIM_GetAccelerometerActive(m_index); }
bool GetActive() const { return HALSIM_GetAccelerometerActive(m_index); }
void SetActive(bool active) {
HALSIM_SetAccelerometerActive(m_index, active);
}
@@ -42,9 +44,11 @@ class AccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
HAL_AccelerometerRange GetRange() {
HAL_AccelerometerRange GetRange() const {
return HALSIM_GetAccelerometerRange(m_index);
}
void SetRange(HAL_AccelerometerRange range) {
HALSIM_SetAccelerometerRange(m_index, range);
}
@@ -57,7 +61,9 @@ class AccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetX() { return HALSIM_GetAccelerometerX(m_index); }
double GetX() const { return HALSIM_GetAccelerometerX(m_index); }
void SetX(double x) { HALSIM_SetAccelerometerX(m_index, x); }
std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
@@ -68,7 +74,9 @@ class AccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetY() { return HALSIM_GetAccelerometerY(m_index); }
double GetY() const { return HALSIM_GetAccelerometerY(m_index); }
void SetY(double y) { HALSIM_SetAccelerometerY(m_index, y); }
std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
@@ -79,7 +87,9 @@ class AccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetZ() { return HALSIM_GetAccelerometerZ(m_index); }
double GetZ() const { return HALSIM_GetAccelerometerZ(m_index); }
void SetZ(double z) { HALSIM_SetAccelerometerZ(m_index, z); }
void ResetData() { HALSIM_ResetAccelerometerData(m_index); }

View File

@@ -29,7 +29,9 @@ class AnalogGyroSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetAngle() { return HALSIM_GetAnalogGyroAngle(m_index); }
double GetAngle() const { return HALSIM_GetAnalogGyroAngle(m_index); }
void SetAngle(double angle) { HALSIM_SetAnalogGyroAngle(m_index, angle); }
std::unique_ptr<CallbackStore> RegisterRateCallback(NotifyCallback callback,
@@ -40,7 +42,9 @@ class AnalogGyroSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetRate() { return HALSIM_GetAnalogGyroRate(m_index); }
double GetRate() const { return HALSIM_GetAnalogGyroRate(m_index); }
void SetRate(double rate) { HALSIM_SetAnalogGyroRate(m_index, rate); }
std::unique_ptr<CallbackStore> RegisterInitializedCallback(
@@ -51,7 +55,11 @@ class AnalogGyroSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetAnalogGyroInitialized(m_index); }
bool GetInitialized() const {
return HALSIM_GetAnalogGyroInitialized(m_index);
}
void SetInitialized(bool initialized) {
HALSIM_SetAnalogGyroInitialized(m_index, initialized);
}

View File

@@ -29,7 +29,9 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetAnalogInInitialized(m_index); }
bool GetInitialized() const { return HALSIM_GetAnalogInInitialized(m_index); }
void SetInitialized(bool initialized) {
HALSIM_SetAnalogInInitialized(m_index, initialized);
}
@@ -42,7 +44,9 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetAverageBits() { return HALSIM_GetAnalogInAverageBits(m_index); }
int GetAverageBits() const { return HALSIM_GetAnalogInAverageBits(m_index); }
void SetAverageBits(int averageBits) {
HALSIM_SetAnalogInAverageBits(m_index, averageBits);
}
@@ -55,7 +59,11 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetOversampleBits() { return HALSIM_GetAnalogInOversampleBits(m_index); }
int GetOversampleBits() const {
return HALSIM_GetAnalogInOversampleBits(m_index);
}
void SetOversampleBits(int oversampleBits) {
HALSIM_SetAnalogInOversampleBits(m_index, oversampleBits);
}
@@ -68,7 +76,9 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetVoltage() { return HALSIM_GetAnalogInVoltage(m_index); }
double GetVoltage() const { return HALSIM_GetAnalogInVoltage(m_index); }
void SetVoltage(double voltage) {
HALSIM_SetAnalogInVoltage(m_index, voltage);
}
@@ -82,9 +92,11 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetAccumulatorInitialized() {
bool GetAccumulatorInitialized() const {
return HALSIM_GetAnalogInAccumulatorInitialized(m_index);
}
void SetAccumulatorInitialized(bool accumulatorInitialized) {
HALSIM_SetAnalogInAccumulatorInitialized(m_index, accumulatorInitialized);
}
@@ -97,9 +109,11 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int64_t GetAccumulatorValue() {
int64_t GetAccumulatorValue() const {
return HALSIM_GetAnalogInAccumulatorValue(m_index);
}
void SetAccumulatorValue(int64_t accumulatorValue) {
HALSIM_SetAnalogInAccumulatorValue(m_index, accumulatorValue);
}
@@ -112,9 +126,11 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int64_t GetAccumulatorCount() {
int64_t GetAccumulatorCount() const {
return HALSIM_GetAnalogInAccumulatorCount(m_index);
}
void SetAccumulatorCount(int64_t accumulatorCount) {
HALSIM_SetAnalogInAccumulatorCount(m_index, accumulatorCount);
}
@@ -127,9 +143,11 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetAccumulatorCenter() {
int GetAccumulatorCenter() const {
return HALSIM_GetAnalogInAccumulatorCenter(m_index);
}
void SetAccumulatorCenter(int accumulatorCenter) {
HALSIM_SetAnalogInAccumulatorCenter(m_index, accumulatorCenter);
}
@@ -143,9 +161,11 @@ class AnalogInSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetAccumulatorDeadband() {
int GetAccumulatorDeadband() const {
return HALSIM_GetAnalogInAccumulatorDeadband(m_index);
}
void SetAccumulatorDeadband(int accumulatorDeadband) {
HALSIM_SetAnalogInAccumulatorDeadband(m_index, accumulatorDeadband);
}

View File

@@ -29,7 +29,9 @@ class AnalogOutSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetVoltage() { return HALSIM_GetAnalogOutVoltage(m_index); }
double GetVoltage() const { return HALSIM_GetAnalogOutVoltage(m_index); }
void SetVoltage(double voltage) {
HALSIM_SetAnalogOutVoltage(m_index, voltage);
}
@@ -42,7 +44,11 @@ class AnalogOutSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetAnalogOutInitialized(m_index); }
bool GetInitialized() const {
return HALSIM_GetAnalogOutInitialized(m_index);
}
void SetInitialized(bool initialized) {
HALSIM_SetAnalogOutInitialized(m_index, initialized);
}

View File

@@ -29,7 +29,11 @@ class AnalogTriggerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetAnalogTriggerInitialized(m_index); }
bool GetInitialized() const {
return HALSIM_GetAnalogTriggerInitialized(m_index);
}
void SetInitialized(bool initialized) {
HALSIM_SetAnalogTriggerInitialized(m_index, initialized);
}
@@ -43,9 +47,11 @@ class AnalogTriggerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetTriggerLowerBound() {
double GetTriggerLowerBound() const {
return HALSIM_GetAnalogTriggerTriggerLowerBound(m_index);
}
void SetTriggerLowerBound(double triggerLowerBound) {
HALSIM_SetAnalogTriggerTriggerLowerBound(m_index, triggerLowerBound);
}
@@ -59,9 +65,11 @@ class AnalogTriggerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetTriggerUpperBound() {
double GetTriggerUpperBound() const {
return HALSIM_GetAnalogTriggerTriggerUpperBound(m_index);
}
void SetTriggerUpperBound(double triggerUpperBound) {
HALSIM_SetAnalogTriggerTriggerUpperBound(m_index, triggerUpperBound);
}

View File

@@ -34,6 +34,7 @@ class CallbackStore {
this->ccnif = ccf;
cancelType = NoIndex;
}
CallbackStore(int32_t i, int32_t u, NotifyCallback cb,
CancelCallbackFunc ccf) {
index = i;
@@ -42,6 +43,7 @@ class CallbackStore {
this->ccf = ccf;
cancelType = Normal;
}
CallbackStore(int32_t i, int32_t c, int32_t u, NotifyCallback cb,
CancelCallbackChannelFunc ccf) {
index = i;
@@ -51,6 +53,7 @@ class CallbackStore {
this->cccf = ccf;
cancelType = Channel;
}
~CallbackStore() {
switch (cancelType) {
case Normal:

View File

@@ -29,7 +29,9 @@ class DIOSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetDIOInitialized(m_index); }
bool GetInitialized() const { return HALSIM_GetDIOInitialized(m_index); }
void SetInitialized(bool initialized) {
HALSIM_SetDIOInitialized(m_index, initialized);
}
@@ -42,7 +44,9 @@ class DIOSim {
store.get(), initialNotify));
return store;
}
bool GetValue() { return HALSIM_GetDIOValue(m_index); }
bool GetValue() const { return HALSIM_GetDIOValue(m_index); }
void SetValue(bool value) { HALSIM_SetDIOValue(m_index, value); }
std::unique_ptr<CallbackStore> RegisterPulseLengthCallback(
@@ -53,7 +57,9 @@ class DIOSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetPulseLength() { return HALSIM_GetDIOPulseLength(m_index); }
double GetPulseLength() const { return HALSIM_GetDIOPulseLength(m_index); }
void SetPulseLength(double pulseLength) {
HALSIM_SetDIOPulseLength(m_index, pulseLength);
}
@@ -66,7 +72,9 @@ class DIOSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetIsInput() { return HALSIM_GetDIOIsInput(m_index); }
bool GetIsInput() const { return HALSIM_GetDIOIsInput(m_index); }
void SetIsInput(bool isInput) { HALSIM_SetDIOIsInput(m_index, isInput); }
std::unique_ptr<CallbackStore> RegisterFilterIndexCallback(
@@ -77,7 +85,9 @@ class DIOSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetFilterIndex() { return HALSIM_GetDIOFilterIndex(m_index); }
int GetFilterIndex() const { return HALSIM_GetDIOFilterIndex(m_index); }
void SetFilterIndex(int filterIndex) {
HALSIM_SetDIOFilterIndex(m_index, filterIndex);
}

View File

@@ -29,7 +29,11 @@ class DigitalPWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetDigitalPWMInitialized(m_index); }
bool GetInitialized() const {
return HALSIM_GetDigitalPWMInitialized(m_index);
}
void SetInitialized(bool initialized) {
HALSIM_SetDigitalPWMInitialized(m_index, initialized);
}
@@ -42,7 +46,9 @@ class DigitalPWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetDutyCycle() { return HALSIM_GetDigitalPWMDutyCycle(m_index); }
double GetDutyCycle() const { return HALSIM_GetDigitalPWMDutyCycle(m_index); }
void SetDutyCycle(double dutyCycle) {
HALSIM_SetDigitalPWMDutyCycle(m_index, dutyCycle);
}
@@ -55,7 +61,9 @@ class DigitalPWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetPin() { return HALSIM_GetDigitalPWMPin(m_index); }
int GetPin() const { return HALSIM_GetDigitalPWMPin(m_index); }
void SetPin(int pin) { HALSIM_SetDigitalPWMPin(m_index, pin); }
void ResetData() { HALSIM_ResetDigitalPWMData(m_index); }

View File

@@ -27,7 +27,9 @@ class DriverStationSim {
&CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetEnabled() { return HALSIM_GetDriverStationEnabled(); }
bool GetEnabled() const { return HALSIM_GetDriverStationEnabled(); }
void SetEnabled(bool enabled) { HALSIM_SetDriverStationEnabled(enabled); }
std::unique_ptr<CallbackStore> RegisterAutonomousCallback(
@@ -38,7 +40,9 @@ class DriverStationSim {
&CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetAutonomous() { return HALSIM_GetDriverStationAutonomous(); }
bool GetAutonomous() const { return HALSIM_GetDriverStationAutonomous(); }
void SetAutonomous(bool autonomous) {
HALSIM_SetDriverStationAutonomous(autonomous);
}
@@ -51,7 +55,9 @@ class DriverStationSim {
&CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetTest() { return HALSIM_GetDriverStationTest(); }
bool GetTest() const { return HALSIM_GetDriverStationTest(); }
void SetTest(bool test) { HALSIM_SetDriverStationTest(test); }
std::unique_ptr<CallbackStore> RegisterEStopCallback(NotifyCallback callback,
@@ -62,7 +68,9 @@ class DriverStationSim {
&CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetEStop() { return HALSIM_GetDriverStationEStop(); }
bool GetEStop() const { return HALSIM_GetDriverStationEStop(); }
void SetEStop(bool eStop) { HALSIM_SetDriverStationEStop(eStop); }
std::unique_ptr<CallbackStore> RegisterFmsAttachedCallback(
@@ -73,7 +81,9 @@ class DriverStationSim {
&CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetFmsAttached() { return HALSIM_GetDriverStationFmsAttached(); }
bool GetFmsAttached() const { return HALSIM_GetDriverStationFmsAttached(); }
void SetFmsAttached(bool fmsAttached) {
HALSIM_SetDriverStationFmsAttached(fmsAttached);
}
@@ -86,7 +96,9 @@ class DriverStationSim {
&CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetDsAttached() { return HALSIM_GetDriverStationDsAttached(); }
bool GetDsAttached() const { return HALSIM_GetDriverStationDsAttached(); }
void SetDsAttached(bool dsAttached) {
HALSIM_SetDriverStationDsAttached(dsAttached);
}

View File

@@ -29,7 +29,9 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetEncoderInitialized(m_index); }
bool GetInitialized() const { return HALSIM_GetEncoderInitialized(m_index); }
void SetInitialized(bool initialized) {
HALSIM_SetEncoderInitialized(m_index, initialized);
}
@@ -42,7 +44,9 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetCount() { return HALSIM_GetEncoderCount(m_index); }
int GetCount() const { return HALSIM_GetEncoderCount(m_index); }
void SetCount(int count) { HALSIM_SetEncoderCount(m_index, count); }
std::unique_ptr<CallbackStore> RegisterPeriodCallback(NotifyCallback callback,
@@ -53,7 +57,9 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetPeriod() { return HALSIM_GetEncoderPeriod(m_index); }
double GetPeriod() const { return HALSIM_GetEncoderPeriod(m_index); }
void SetPeriod(double period) { HALSIM_SetEncoderPeriod(m_index, period); }
std::unique_ptr<CallbackStore> RegisterResetCallback(NotifyCallback callback,
@@ -64,7 +70,9 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetReset() { return HALSIM_GetEncoderReset(m_index); }
bool GetReset() const { return HALSIM_GetEncoderReset(m_index); }
void SetReset(bool reset) { HALSIM_SetEncoderReset(m_index, reset); }
std::unique_ptr<CallbackStore> RegisterMaxPeriodCallback(
@@ -75,7 +83,9 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetMaxPeriod() { return HALSIM_GetEncoderMaxPeriod(m_index); }
double GetMaxPeriod() const { return HALSIM_GetEncoderMaxPeriod(m_index); }
void SetMaxPeriod(double maxPeriod) {
HALSIM_SetEncoderMaxPeriod(m_index, maxPeriod);
}
@@ -88,7 +98,9 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetDirection() { return HALSIM_GetEncoderDirection(m_index); }
bool GetDirection() const { return HALSIM_GetEncoderDirection(m_index); }
void SetDirection(bool direction) {
HALSIM_SetEncoderDirection(m_index, direction);
}
@@ -101,9 +113,11 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetReverseDirection() {
bool GetReverseDirection() const {
return HALSIM_GetEncoderReverseDirection(m_index);
}
void SetReverseDirection(bool reverseDirection) {
HALSIM_SetEncoderReverseDirection(m_index, reverseDirection);
}
@@ -116,9 +130,11 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetSamplesToAverage() {
int GetSamplesToAverage() const {
return HALSIM_GetEncoderSamplesToAverage(m_index);
}
void SetSamplesToAverage(int samplesToAverage) {
HALSIM_SetEncoderSamplesToAverage(m_index, samplesToAverage);
}
@@ -131,9 +147,11 @@ class EncoderSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetDistancePerPulse() {
double GetDistancePerPulse() const {
return HALSIM_GetEncoderDistancePerPulse(m_index);
}
void SetDistancePerPulse(double distancePerPulse) {
HALSIM_SetEncoderDistancePerPulse(m_index, distancePerPulse);
}

View File

@@ -30,9 +30,11 @@ class PCMSim {
m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetSolenoidInitialized(int channel) {
bool GetSolenoidInitialized(int channel) const {
return HALSIM_GetPCMSolenoidInitialized(m_index, channel);
}
void SetSolenoidInitialized(int channel, bool solenoidInitialized) {
HALSIM_SetPCMSolenoidInitialized(m_index, channel, solenoidInitialized);
}
@@ -46,9 +48,11 @@ class PCMSim {
m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetSolenoidOutput(int channel) {
bool GetSolenoidOutput(int channel) const {
return HALSIM_GetPCMSolenoidOutput(m_index, channel);
}
void SetSolenoidOutput(int channel, bool solenoidOutput) {
HALSIM_SetPCMSolenoidOutput(m_index, channel, solenoidOutput);
}
@@ -61,9 +65,11 @@ class PCMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetCompressorInitialized() {
bool GetCompressorInitialized() const {
return HALSIM_GetPCMCompressorInitialized(m_index);
}
void SetCompressorInitialized(bool compressorInitialized) {
HALSIM_SetPCMCompressorInitialized(m_index, compressorInitialized);
}
@@ -76,7 +82,9 @@ class PCMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetCompressorOn() { return HALSIM_GetPCMCompressorOn(m_index); }
bool GetCompressorOn() const { return HALSIM_GetPCMCompressorOn(m_index); }
void SetCompressorOn(bool compressorOn) {
HALSIM_SetPCMCompressorOn(m_index, compressorOn);
}
@@ -89,9 +97,11 @@ class PCMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetClosedLoopEnabled() {
bool GetClosedLoopEnabled() const {
return HALSIM_GetPCMClosedLoopEnabled(m_index);
}
void SetClosedLoopEnabled(bool closedLoopEnabled) {
HALSIM_SetPCMClosedLoopEnabled(m_index, closedLoopEnabled);
}
@@ -104,7 +114,11 @@ class PCMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetPressureSwitch() { return HALSIM_GetPCMPressureSwitch(m_index); }
bool GetPressureSwitch() const {
return HALSIM_GetPCMPressureSwitch(m_index);
}
void SetPressureSwitch(bool pressureSwitch) {
HALSIM_SetPCMPressureSwitch(m_index, pressureSwitch);
}
@@ -117,9 +131,11 @@ class PCMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetCompressorCurrent() {
double GetCompressorCurrent() const {
return HALSIM_GetPCMCompressorCurrent(m_index);
}
void SetCompressorCurrent(double compressorCurrent) {
HALSIM_SetPCMCompressorCurrent(m_index, compressorCurrent);
}

View File

@@ -29,7 +29,9 @@ class PDPSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetPDPInitialized(m_index); }
bool GetInitialized() const { return HALSIM_GetPDPInitialized(m_index); }
void SetInitialized(bool initialized) {
HALSIM_SetPDPInitialized(m_index, initialized);
}
@@ -42,7 +44,9 @@ class PDPSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetTemperature() { return HALSIM_GetPDPTemperature(m_index); }
double GetTemperature() const { return HALSIM_GetPDPTemperature(m_index); }
void SetTemperature(double temperature) {
HALSIM_SetPDPTemperature(m_index, temperature);
}
@@ -55,7 +59,9 @@ class PDPSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetVoltage() { return HALSIM_GetPDPVoltage(m_index); }
double GetVoltage() const { return HALSIM_GetPDPVoltage(m_index); }
void SetVoltage(double voltage) { HALSIM_SetPDPVoltage(m_index, voltage); }
std::unique_ptr<CallbackStore> RegisterCurrentCallback(
@@ -66,9 +72,11 @@ class PDPSim {
m_index, channel, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetCurrent(int channel) {
double GetCurrent(int channel) const {
return HALSIM_GetPDPCurrent(m_index, channel);
}
void SetCurrent(int channel, double current) {
HALSIM_SetPDPCurrent(m_index, channel, current);
}

View File

@@ -29,7 +29,9 @@ class PWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitialized() { return HALSIM_GetPWMInitialized(m_index); }
bool GetInitialized() const { return HALSIM_GetPWMInitialized(m_index); }
void SetInitialized(bool initialized) {
HALSIM_SetPWMInitialized(m_index, initialized);
}
@@ -42,7 +44,9 @@ class PWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetRawValue() { return HALSIM_GetPWMRawValue(m_index); }
int GetRawValue() const { return HALSIM_GetPWMRawValue(m_index); }
void SetRawValue(int rawValue) { HALSIM_SetPWMRawValue(m_index, rawValue); }
std::unique_ptr<CallbackStore> RegisterSpeedCallback(NotifyCallback callback,
@@ -53,7 +57,9 @@ class PWMSim {
store.get(), initialNotify));
return store;
}
double GetSpeed() { return HALSIM_GetPWMSpeed(m_index); }
double GetSpeed() const { return HALSIM_GetPWMSpeed(m_index); }
void SetSpeed(double speed) { HALSIM_SetPWMSpeed(m_index, speed); }
std::unique_ptr<CallbackStore> RegisterPositionCallback(
@@ -64,7 +70,9 @@ class PWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetPosition() { return HALSIM_GetPWMPosition(m_index); }
double GetPosition() const { return HALSIM_GetPWMPosition(m_index); }
void SetPosition(double position) {
HALSIM_SetPWMPosition(m_index, position);
}
@@ -77,7 +85,9 @@ class PWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetPeriodScale() { return HALSIM_GetPWMPeriodScale(m_index); }
int GetPeriodScale() const { return HALSIM_GetPWMPeriodScale(m_index); }
void SetPeriodScale(int periodScale) {
HALSIM_SetPWMPeriodScale(m_index, periodScale);
}
@@ -90,7 +100,9 @@ class PWMSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetZeroLatch() { return HALSIM_GetPWMZeroLatch(m_index); }
bool GetZeroLatch() const { return HALSIM_GetPWMZeroLatch(m_index); }
void SetZeroLatch(bool zeroLatch) {
HALSIM_SetPWMZeroLatch(m_index, zeroLatch);
}

View File

@@ -29,9 +29,11 @@ class RelaySim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitializedForward() {
bool GetInitializedForward() const {
return HALSIM_GetRelayInitializedForward(m_index);
}
void SetInitializedForward(bool initializedForward) {
HALSIM_SetRelayInitializedForward(m_index, initializedForward);
}
@@ -44,9 +46,11 @@ class RelaySim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetInitializedReverse() {
bool GetInitializedReverse() const {
return HALSIM_GetRelayInitializedReverse(m_index);
}
void SetInitializedReverse(bool initializedReverse) {
HALSIM_SetRelayInitializedReverse(m_index, initializedReverse);
}
@@ -59,7 +63,9 @@ class RelaySim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetForward() { return HALSIM_GetRelayForward(m_index); }
bool GetForward() const { return HALSIM_GetRelayForward(m_index); }
void SetForward(bool forward) { HALSIM_SetRelayForward(m_index, forward); }
std::unique_ptr<CallbackStore> RegisterReverseCallback(
@@ -70,7 +76,9 @@ class RelaySim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetReverse() { return HALSIM_GetRelayReverse(m_index); }
bool GetReverse() const { return HALSIM_GetRelayReverse(m_index); }
void SetReverse(bool reverse) { HALSIM_SetRelayReverse(m_index, reverse); }
void ResetData() { HALSIM_ResetRelayData(m_index); }

View File

@@ -29,7 +29,9 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetFPGAButton() { return HALSIM_GetRoboRioFPGAButton(m_index); }
bool GetFPGAButton() const { return HALSIM_GetRoboRioFPGAButton(m_index); }
void SetFPGAButton(bool fPGAButton) {
HALSIM_SetRoboRioFPGAButton(m_index, fPGAButton);
}
@@ -42,7 +44,9 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetVInVoltage() { return HALSIM_GetRoboRioVInVoltage(m_index); }
double GetVInVoltage() const { return HALSIM_GetRoboRioVInVoltage(m_index); }
void SetVInVoltage(double vInVoltage) {
HALSIM_SetRoboRioVInVoltage(m_index, vInVoltage);
}
@@ -55,7 +59,9 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetVInCurrent() { return HALSIM_GetRoboRioVInCurrent(m_index); }
double GetVInCurrent() const { return HALSIM_GetRoboRioVInCurrent(m_index); }
void SetVInCurrent(double vInCurrent) {
HALSIM_SetRoboRioVInCurrent(m_index, vInCurrent);
}
@@ -68,7 +74,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetUserVoltage6V() { return HALSIM_GetRoboRioUserVoltage6V(m_index); }
double GetUserVoltage6V() const {
return HALSIM_GetRoboRioUserVoltage6V(m_index);
}
void SetUserVoltage6V(double userVoltage6V) {
HALSIM_SetRoboRioUserVoltage6V(m_index, userVoltage6V);
}
@@ -81,7 +91,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetUserCurrent6V() { return HALSIM_GetRoboRioUserCurrent6V(m_index); }
double GetUserCurrent6V() const {
return HALSIM_GetRoboRioUserCurrent6V(m_index);
}
void SetUserCurrent6V(double userCurrent6V) {
HALSIM_SetRoboRioUserCurrent6V(m_index, userCurrent6V);
}
@@ -94,7 +108,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetUserActive6V() { return HALSIM_GetRoboRioUserActive6V(m_index); }
bool GetUserActive6V() const {
return HALSIM_GetRoboRioUserActive6V(m_index);
}
void SetUserActive6V(bool userActive6V) {
HALSIM_SetRoboRioUserActive6V(m_index, userActive6V);
}
@@ -107,7 +125,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetUserVoltage5V() { return HALSIM_GetRoboRioUserVoltage5V(m_index); }
double GetUserVoltage5V() const {
return HALSIM_GetRoboRioUserVoltage5V(m_index);
}
void SetUserVoltage5V(double userVoltage5V) {
HALSIM_SetRoboRioUserVoltage5V(m_index, userVoltage5V);
}
@@ -120,7 +142,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetUserCurrent5V() { return HALSIM_GetRoboRioUserCurrent5V(m_index); }
double GetUserCurrent5V() const {
return HALSIM_GetRoboRioUserCurrent5V(m_index);
}
void SetUserCurrent5V(double userCurrent5V) {
HALSIM_SetRoboRioUserCurrent5V(m_index, userCurrent5V);
}
@@ -133,7 +159,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetUserActive5V() { return HALSIM_GetRoboRioUserActive5V(m_index); }
bool GetUserActive5V() const {
return HALSIM_GetRoboRioUserActive5V(m_index);
}
void SetUserActive5V(bool userActive5V) {
HALSIM_SetRoboRioUserActive5V(m_index, userActive5V);
}
@@ -146,9 +176,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetUserVoltage3V3() {
double GetUserVoltage3V3() const {
return HALSIM_GetRoboRioUserVoltage3V3(m_index);
}
void SetUserVoltage3V3(double userVoltage3V3) {
HALSIM_SetRoboRioUserVoltage3V3(m_index, userVoltage3V3);
}
@@ -161,9 +193,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetUserCurrent3V3() {
double GetUserCurrent3V3() const {
return HALSIM_GetRoboRioUserCurrent3V3(m_index);
}
void SetUserCurrent3V3(double userCurrent3V3) {
HALSIM_SetRoboRioUserCurrent3V3(m_index, userCurrent3V3);
}
@@ -176,7 +210,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetUserActive3V3() { return HALSIM_GetRoboRioUserActive3V3(m_index); }
bool GetUserActive3V3() const {
return HALSIM_GetRoboRioUserActive3V3(m_index);
}
void SetUserActive3V3(bool userActive3V3) {
HALSIM_SetRoboRioUserActive3V3(m_index, userActive3V3);
}
@@ -189,7 +227,9 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetUserFaults6V() { return HALSIM_GetRoboRioUserFaults6V(m_index); }
int GetUserFaults6V() const { return HALSIM_GetRoboRioUserFaults6V(m_index); }
void SetUserFaults6V(int userFaults6V) {
HALSIM_SetRoboRioUserFaults6V(m_index, userFaults6V);
}
@@ -202,7 +242,9 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetUserFaults5V() { return HALSIM_GetRoboRioUserFaults5V(m_index); }
int GetUserFaults5V() const { return HALSIM_GetRoboRioUserFaults5V(m_index); }
void SetUserFaults5V(int userFaults5V) {
HALSIM_SetRoboRioUserFaults5V(m_index, userFaults5V);
}
@@ -215,7 +257,11 @@ class RoboRioSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetUserFaults3V3() { return HALSIM_GetRoboRioUserFaults3V3(m_index); }
int GetUserFaults3V3() const {
return HALSIM_GetRoboRioUserFaults3V3(m_index);
}
void SetUserFaults3V3(int userFaults3V3) {
HALSIM_SetRoboRioUserFaults3V3(m_index, userFaults3V3);
}

View File

@@ -29,7 +29,9 @@ class SPIAccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
bool GetActive() { return HALSIM_GetSPIAccelerometerActive(m_index); }
bool GetActive() const { return HALSIM_GetSPIAccelerometerActive(m_index); }
void SetActive(bool active) {
HALSIM_SetSPIAccelerometerActive(m_index, active);
}
@@ -42,7 +44,9 @@ class SPIAccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
int GetRange() { return HALSIM_GetSPIAccelerometerRange(m_index); }
int GetRange() const { return HALSIM_GetSPIAccelerometerRange(m_index); }
void SetRange(int range) { HALSIM_SetSPIAccelerometerRange(m_index, range); }
std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
@@ -53,7 +57,9 @@ class SPIAccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetX() { return HALSIM_GetSPIAccelerometerX(m_index); }
double GetX() const { return HALSIM_GetSPIAccelerometerX(m_index); }
void SetX(double x) { HALSIM_SetSPIAccelerometerX(m_index, x); }
std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
@@ -64,7 +70,9 @@ class SPIAccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetY() { return HALSIM_GetSPIAccelerometerY(m_index); }
double GetY() const { return HALSIM_GetSPIAccelerometerY(m_index); }
void SetY(double y) { HALSIM_SetSPIAccelerometerY(m_index, y); }
std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
@@ -75,7 +83,9 @@ class SPIAccelerometerSim {
m_index, &CallbackStoreThunk, store.get(), initialNotify));
return store;
}
double GetZ() { return HALSIM_GetSPIAccelerometerZ(m_index); }
double GetZ() const { return HALSIM_GetSPIAccelerometerZ(m_index); }
void SetZ(double z) { HALSIM_SetSPIAccelerometerZ(m_index, z); }
void ResetData() { HALSIM_ResetSPIAccelerometerData(m_index); }

View File

@@ -13,10 +13,15 @@
namespace frc {
namespace sim {
void WaitForProgramStart() { HALSIM_WaitForProgramStart(); }
void SetProgramStarted() { HALSIM_SetProgramStarted(); }
bool GetProgramStarted() { return HALSIM_GetProgramStarted(); }
void RestartTiming() { HALSIM_RestartTiming(); }
} // namespace sim
} // namespace frc