Model Railroad System  2.2.1
Public Member Functions | List of all members
FCFSupport::TrainDisplayCallback Class Reference

Callback to manage a train status display. More...

#include <CallBack.h>

Public Member Functions

 TrainDisplayCallback ()
 Constructor. More...
 
virtual ~TrainDisplayCallback ()
 Destructor. More...
 
virtual void InitializeTrainDisplay (string name, int stationCount, int maxLength, int maxCars) const
 Initialize the train status display. More...
 
virtual void CloseTrainDisplay () const
 Close the train display. More...
 
virtual void GrabTrainDisplay () const
 Grab the train display. More...
 
virtual void ReleaseTrainDisplay () const
 Release the train display. More...
 
virtual void UpdateTrainDisplay (string currentStationName, string currentStopName, int trainLength, int numberCars, int trainTons, int trainLoads, int trainEmpties, int trainLongest, int currentStop) const
 Update the train display. More...
 

Detailed Description

Callback to manage a train status display.

This callback is used to manage an application supplied train status display. Used in the train running methods when train runs are simulated to move cars from place place. The train status shows the train's progress and the pickups and drops it makes as it traverses its route.

@author Robert Heller \<heller\@deepsoft.com\>

Constructor & Destructor Documentation

◆ TrainDisplayCallback()

FCFSupport::TrainDisplayCallback::TrainDisplayCallback ( )
inline

Constructor.

The base constructor does nothing. It is presumed that a derived class might do something useful.

◆ ~TrainDisplayCallback()

virtual FCFSupport::TrainDisplayCallback::~TrainDisplayCallback ( )
inlinevirtual

Destructor.

The base destructor does nothing. It is presumed that a derived class might do something useful.

Member Function Documentation

◆ CloseTrainDisplay()

virtual void FCFSupport::TrainDisplayCallback::CloseTrainDisplay ( ) const
inlinevirtual

Close the train display.

This is called when the train status display is no longer needed.

◆ GrabTrainDisplay()

virtual void FCFSupport::TrainDisplayCallback::GrabTrainDisplay ( ) const
inlinevirtual

Grab the train display.

This is used when the train status display needs to be `‘front and center’'.

◆ InitializeTrainDisplay()

virtual void FCFSupport::TrainDisplayCallback::InitializeTrainDisplay ( string  name,
int  stationCount,
int  maxLength,
int  maxCars 
) const
inlinevirtual

Initialize the train status display.

Set the train name, the station count, max length and the maximum number of cars. Generally, this initializes the train status display for a new train start.

Parameters
nameName of the train.
stationCountThe station count (number of stops).
maxLengthMaximum train length.
maxCarsMaximum number of cars.

◆ ReleaseTrainDisplay()

virtual void FCFSupport::TrainDisplayCallback::ReleaseTrainDisplay ( ) const
inlinevirtual

Release the train display.

This is used when the train status display no longer needs to be `‘front and center’'.

◆ UpdateTrainDisplay()

virtual void FCFSupport::TrainDisplayCallback::UpdateTrainDisplay ( string  currentStationName,
string  currentStopName,
int  trainLength,
int  numberCars,
int  trainTons,
int  trainLoads,
int  trainEmpties,
int  trainLongest,
int  currentStop 
) const
inlinevirtual

Update the train display.

This updates the train status display when a train arrives at a station (or industry), drops cars, picks up cars and leaves a station (or industry).

Parameters
currentStationNameThe current station name.
currentStopNameThe current stop name.
trainLengthThe current train length.
numberCarsThe current number of cars.
trainTonsThe current number of tons.
trainLoadsThe current number of loaded cars.
trainEmptiesThe current number of empty cars.
trainLongestThe longest the train has been.
currentStopThe current stop number.