Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
TractionTestTrain.hxx
Go to the documentation of this file.
1
35#ifndef _OPENLCB_TRACTIONTESTTRAIN_HXX_
36#define _OPENLCB_TRACTIONTESTTRAIN_HXX_
37
38#include <map>
39
41
42namespace openlcb
43{
44
46class LoggingTrain : public TrainImpl
47{
48public:
50 dcc::TrainAddressType address_type =
51 dcc::TrainAddressType::DCC_LONG_ADDRESS);
53 void set_speed(SpeedType speed) OVERRIDE;
57 void set_fn(uint32_t address, uint16_t value) OVERRIDE;
58 uint16_t get_fn(uint32_t address) OVERRIDE;
59 uint32_t legacy_address() OVERRIDE;
61
62private:
63 uint32_t legacyAddress_;
64 dcc::TrainAddressType legacyAddressType_;
65 SpeedType currentSpeed_;
66 bool estopActive_;
67 std::map<uint32_t, uint16_t> fnValues_;
68};
69
70} // namespace openlcb
71
72#endif // _OPENLCB_TRACTIONTESTTRAIN_HXX_
Test train implementation that just logs every action to the info log.
dcc::TrainAddressType legacy_address_type() OVERRIDE
void set_emergencystop() OVERRIDE
Sets the train to emergency stop.
uint16_t get_fn(uint32_t address) OVERRIDE
void set_speed(SpeedType speed) OVERRIDE
Sets the speed of the locomotive.
void set_fn(uint32_t address, uint16_t value) OVERRIDE
Sets the value of a function.
bool get_emergencystop() OVERRIDE
Get the current E-Stop state.
SpeedType get_speed() OVERRIDE
uint32_t legacy_address() OVERRIDE
Abstract base class for train implementations.
This class provides a mechanism for working with velocity in different forms.
Definition Velocity.hxx:73
TrainAddressType
Which address type this legacy train node uses.
Definition dcc/Defs.hxx:46
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
Definition macros.h:180