![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
A sensor whose reading and connection are set directly, for tests. More...
#include <SimulationSensor.hpp>
Public Member Functions | |
| void | set (T value) |
| void | disconnect () |
| void | reconnect (T value) |
| Reconnects, optionally with a new reading (as if the device power-cycled). | |
| bool | connected () const override |
| Public Member Functions inherited from rz::Sensor< T > | |
| Sensor ()=default | |
| Sensor (const Sensor &)=delete | |
| Sensor & | operator= (const Sensor &)=delete |
| Sensor (Sensor &&)=delete | |
| Sensor & | operator= (Sensor &&)=delete |
| virtual | ~Sensor ()=default |
| T | get () |
| The current reading. The last good value while disconnected. | |
| T | delta () |
| Change since the previous snapshot (covers several ticks if nobody read in between). | |
Protected Member Functions | |
| T | raw () const override |
| This tick's reading from the source; the last good value while disconnected. May restart after a reconnect. | |
| std::uint32_t | epoch () const override |
| Increments every time the source reconnects. Readings across a reconnect are not comparable. | |
A sensor whose reading and connection are set directly, for tests.
|
inlinenodiscardoverridevirtual |
Implements rz::Sensor< T >.
|
inline |
|
inlinenodiscardoverrideprotectedvirtual |
Increments every time the source reconnects. Readings across a reconnect are not comparable.
Reimplemented from rz::Sensor< T >.
|
inlinenodiscardoverrideprotectedvirtual |
This tick's reading from the source; the last good value while disconnected. May restart after a reconnect.
Implements rz::Sensor< T >.
|
inline |
Reconnects, optionally with a new reading (as if the device power-cycled).
|
inline |