|
Open Model Railroad Network (OpenMRN)
|
Abstract base class for train implementations. More...
#include <TrainInterface.hxx>
Public Member Functions | |
| virtual void | set_speed (SpeedType speed)=0 |
| Sets the speed of the locomotive. | |
| virtual SpeedType | get_speed ()=0 |
| virtual SpeedType | get_commanded_speed () |
| virtual SpeedType | get_actual_speed () |
| Returns the actual speed of the locomotive, as provided by feedback from the decoder. | |
| virtual void | set_emergencystop ()=0 |
| Sets the train to emergency stop. | |
| virtual bool | get_emergencystop ()=0 |
| Get the current E-Stop state. | |
| virtual void | set_fn (uint32_t address, uint16_t value)=0 |
| Sets the value of a function. | |
| virtual uint16_t | get_fn (uint32_t address)=0 |
| virtual uint32_t | legacy_address ()=0 |
| virtual dcc::TrainAddressType | legacy_address_type ()=0 |
Abstract base class for train implementations.
This interface links the OpenLCB trains to the dcc packet sources.
Definition at line 50 of file TrainInterface.hxx.
|
inlinevirtual |
Definition at line 53 of file TrainInterface.hxx.
|
inlinevirtual |
Returns the actual speed of the locomotive, as provided by feedback from the decoder.
Definition at line 68 of file TrainInterface.hxx.
|
inlinevirtual |
Reimplemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, and dcc::AbstractTrain< Payload >.
Definition at line 63 of file TrainInterface.hxx.
|
pure virtual |
Get the current E-Stop state.
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Sets the train to emergency stop.
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Sets the value of a function.
| address | is a 24-bit address of the function to set. For legacy DCC locomotives, see TractionDefs for the address definitions (0=light, 1-28= traditional function buttons). |
| value | is the function value. For binary functions, any non-zero value sets the function to on, zero sets it to off. |
Implemented in dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, openlcb::TractionThrottle, and traction_modem::ModemTrain.
|
pure virtual |
Sets the speed of the locomotive.
| speed | is the requested scale speed in m/s. The sign of the number means the direction. |
Implemented in traction_modem::ModemTrain, dcc::AbstractTrain< P >, dcc::AbstractTrain< MMNewPayload >, dcc::AbstractTrain< MMOldPayload >, dcc::AbstractTrain< Payload >, dcc::NonTrainPacketSource, openlcb::LoggingTrain, and openlcb::TractionThrottle.