Test train implementation that just logs every action to the info log.
More...
#include <TractionTestTrain.hxx>
Test train implementation that just logs every action to the info log.
Definition at line 46 of file TractionTestTrain.hxx.
◆ LoggingTrain()
◆ ~LoggingTrain()
| openlcb::LoggingTrain::~LoggingTrain |
( |
| ) |
|
◆ get_emergencystop()
| bool openlcb::LoggingTrain::get_emergencystop |
( |
| ) |
|
|
virtual |
◆ get_fn()
| uint16_t openlcb::LoggingTrain::get_fn |
( |
uint32_t |
address | ) |
|
|
virtual |
◆ get_speed()
| SpeedType openlcb::LoggingTrain::get_speed |
( |
| ) |
|
|
virtual |
◆ legacy_address()
| uint32_t openlcb::LoggingTrain::legacy_address |
( |
| ) |
|
|
virtual |
- Returns
- the legacy (DCC) address of this train. This value is used in determining the train's NMRAnet NodeID.
- Todo:
- (balazs.racz) This function should not be here. Specifying the NodeID should be more generic, but it is not clear what would be the best interface for that.
Implements openlcb::TrainImpl.
Definition at line 124 of file TractionTestTrain.cxx.
◆ legacy_address_type()
◆ set_emergencystop()
| void openlcb::LoggingTrain::set_emergencystop |
( |
| ) |
|
|
virtual |
◆ set_fn()
| void openlcb::LoggingTrain::set_fn |
( |
uint32_t |
address, |
|
|
uint16_t |
value |
|
) |
| |
|
virtual |
Sets the value of a function.
- Parameters
-
| 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. |
Implements openlcb::TrainImpl.
Definition at line 103 of file TractionTestTrain.cxx.
◆ set_speed()
| void openlcb::LoggingTrain::set_speed |
( |
SpeedType |
speed | ) |
|
|
virtual |
Sets the speed of the locomotive.
- Parameters
-
| speed | is the requested scale speed in m/s. The sign of the number means the direction. |
Implements openlcb::TrainImpl.
Definition at line 62 of file TractionTestTrain.cxx.
◆ currentSpeed_
| SpeedType openlcb::LoggingTrain::currentSpeed_ |
|
private |
◆ estopActive_
| bool openlcb::LoggingTrain::estopActive_ |
|
private |
◆ fnValues_
| std::map<uint32_t, uint16_t> openlcb::LoggingTrain::fnValues_ |
|
private |
◆ legacyAddress_
| uint32_t openlcb::LoggingTrain::legacyAddress_ |
|
private |
◆ legacyAddressType_
The documentation for this class was generated from the following files: