Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
dcc::DccTrain< Payload > Class Template Reference

TrainImpl class for a DCC locomotive. More...

#include <Loco.hxx>

Inheritance diagram for dcc::DccTrain< Payload >:
dcc::AbstractTrain< Payload > dcc::PacketSource openlcb::TrainImpl

Public Member Functions

 DccTrain (DccShortAddress a)
 Constructor.
 
 DccTrain (DccLongAddress a)
 Constructor.
 
void get_next_packet (unsigned code, Packet *packet) OVERRIDE
 Generates next outgoing packet.
 
- Public Member Functions inherited from dcc::AbstractTrain< Payload >
void set_speed (SpeedType speed) OVERRIDE
 Sets the train speed (asking for a high-priority outgoing update packet to be generated).
 
SpeedType get_speed () OVERRIDE
 
SpeedType get_commanded_speed () OVERRIDE
 
void set_emergencystop () OVERRIDE
 Sets the train to ESTOP state, generating an emergency stop packet.
 
bool get_emergencystop () OVERRIDE
 Gets the train's ESTOP state.
 
void set_fn (uint32_t address, uint16_t value) OVERRIDE
 Sets a function to a given value.
 
uint16_t get_fn (uint32_t address) OVERRIDE
 
uint32_t legacy_address () OVERRIDE
 
TrainAddressType legacy_address_type () OVERRIDE
 
- Public Member Functions inherited from openlcb::TrainImpl
virtual SpeedType get_actual_speed ()
 Returns the actual speed of the locomotive, as provided by feedback from the decoder.
 

Additional Inherited Members

- Protected Member Functions inherited from dcc::AbstractTrain< Payload >
unsigned get_effective_f0 ()
 
void update_f0_direction_changed ()
 Updates the f0 states after a direction change occurred.
 
- Protected Attributes inherited from dcc::AbstractTrain< Payload >
Payload p
 Payload – actual data we know about the train.
 
- Static Protected Attributes inherited from dcc::AbstractTrain< Payload >
static constexpr unsigned VIRTF0_DIRECTIONAL_ENABLE
 Function number of "enable directional F0".
 
static constexpr unsigned VIRTF0_BLANK_FWD
 Function number of "Blank F0 Forward".
 
static constexpr unsigned VIRTF0_BLANK_REV
 Function number of "Blank F0 Reverse".
 

Detailed Description

template<class Payload>
class dcc::DccTrain< Payload >

TrainImpl class for a DCC locomotive.

Definition at line 492 of file Loco.hxx.

Constructor & Destructor Documentation

◆ DccTrain() [1/2]

template<class Payload >
dcc::DccTrain< Payload >::DccTrain ( DccShortAddress  a)
inline

Constructor.

Parameters
ais the address.

Definition at line 496 of file Loco.hxx.

◆ DccTrain() [2/2]

template<class Payload >
dcc::DccTrain< Payload >::DccTrain ( DccLongAddress  a)
inline

Constructor.

Parameters
ais the address.

Definition at line 504 of file Loco.hxx.

◆ ~DccTrain() [1/2]

Definition at line 48 of file Loco.cxx.

◆ ~DccTrain() [2/2]

Definition at line 53 of file Loco.cxx.

Member Function Documentation

◆ get_next_packet()

template<class Payload >
void dcc::DccTrain< Payload >::get_next_packet ( unsigned  code,
Packet packet 
)
virtual

Generates next outgoing packet.

Parameters
codeis the packet code (as requested by the previous cycle or the on-update notification).
packetneeds to be filled in for the output.

Implements dcc::PacketSource.

Definition at line 81 of file Loco.cxx.


The documentation for this class was generated from the following files: