mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add ability to associate other devices with a SimDevice
Implemented only for AnalogInput, DIO, and Encoder.
This commit is contained in:
@@ -286,6 +286,13 @@ class AnalogInput : public ErrorBase,
|
||||
*/
|
||||
double PIDGet() override;
|
||||
|
||||
/**
|
||||
* Indicates this input is used by a simulated device.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -71,6 +71,13 @@ class DigitalInput : public DigitalSource,
|
||||
*/
|
||||
int GetChannel() const override;
|
||||
|
||||
/**
|
||||
* Indicates this input is used by a simulated device.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -125,6 +125,13 @@ class DigitalOutput : public ErrorBase,
|
||||
*/
|
||||
void UpdateDutyCycle(double dutyCycle);
|
||||
|
||||
/**
|
||||
* Indicates this output is used by a simulated device.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -332,6 +332,13 @@ class Encoder : public ErrorBase,
|
||||
void SetIndexSource(const DigitalSource& source,
|
||||
IndexingType type = kResetOnRisingEdge);
|
||||
|
||||
/**
|
||||
* Indicates this encoder is used by a simulated device.
|
||||
*
|
||||
* @param device simulated device handle
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
int GetFPGAIndex() const;
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
Reference in New Issue
Block a user