DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CommandStationListener Class Reference

Class to manage broadcasts and responses from the CommandStation. More...

#include <CommandStationListener.h>

Inheritance diagram for CommandStationListener:
Inheritance graph
[legend]
Collaboration diagram for CommandStationListener:
Collaboration graph
[legend]

Public Member Functions

 CommandStationListener (EventManager *eventManager)
 Consructor for the CommandStation listener.
 
void receivedRosterList () override
 Respond to receiving the roster list which updates the roster menu.
 
void receivedLocoUpdate (Loco *loco) override
 Respond to receiving an update for a loco to update the throttle screen.
 
void receivedLocoBroadcast (int address, int speed, Direction direction, int functionMap) override
 Respond to receiving a loco broadcast to update throttle screen for non-roster locos.
 
void receivedTrackPower (TrackPower powerState) override
 Respond to receiving a track power state broadcast to update the throttle screen.
 
void receivedReadLoco (int address) override
 Respond to receiving the loco address read from the programming track If valid (not -1), sets this as the loco controlled by the throttle.
 

Private Attributes

EventManager_eventManager
 

Detailed Description

Class to manage broadcasts and responses from the CommandStation.

Constructor & Destructor Documentation

◆ CommandStationListener()

CommandStationListener::CommandStationListener ( EventManager eventManager)

Consructor for the CommandStation listener.

Parameters
eventManagerPointer to the event manager

Member Function Documentation

◆ receivedLocoBroadcast()

void CommandStationListener::receivedLocoBroadcast ( int  address,
int  speed,
Direction  direction,
int  functionMap 
)
override

Respond to receiving a loco broadcast to update throttle screen for non-roster locos.

Parameters
addressDCC address of the loco
speedCurrent speed 0 - 126
directionCurrent direction
functionMapCurrent function map of states
Here is the call graph for this function:

◆ receivedLocoUpdate()

void CommandStationListener::receivedLocoUpdate ( Loco *  loco)
override

Respond to receiving an update for a loco to update the throttle screen.

Parameters
locoPointer to the loco address the update is related to
Here is the call graph for this function:

◆ receivedReadLoco()

void CommandStationListener::receivedReadLoco ( int  address)
override

Respond to receiving the loco address read from the programming track If valid (not -1), sets this as the loco controlled by the throttle.

Parameters
addressDCC address of the loco on the programming track, -1 if not read
Here is the call graph for this function:

◆ receivedRosterList()

void CommandStationListener::receivedRosterList ( )
override

Respond to receiving the roster list which updates the roster menu.

Here is the call graph for this function:

◆ receivedTrackPower()

void CommandStationListener::receivedTrackPower ( TrackPower  powerState)
override

Respond to receiving a track power state broadcast to update the throttle screen.

Parameters
powerState[PowerOff|PowerOn|PowerUnknown]
Here is the call graph for this function:

Member Data Documentation

◆ _eventManager

EventManager* CommandStationListener::_eventManager
private

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