Class AutoTrainAction
- java.lang.Object
-
- jmri.jmrit.dispatcher.AutoTrainAction
-
public class AutoTrainAction extends java.lang.Object
This class sets up and executes TransitSectionAction's specified for Sections traversed by one automatically running train. It is an extension to AutoActiveTrain that handles special actions while its train is running automatically.This class is linked via its parent AutoActiveTrain object.
When an AutoActiveTrain enters a Section, it passes the TransitSection of the entered Section to this class.
Similarly when an AutoActiveTrain leaves a Section, it passes the TransitSection of the just vacated Section to this class.
This file is part of JMRI.
JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AutoTrainAction.HornExecution
(package private) class
AutoTrainAction.MonitorTrain
A runnable to monitor whether the autoActiveTrain is moving or stopped.(package private) class
AutoTrainAction.MonitorTrainSpeed
A runnable to monitor the autoActiveTrain speed.(package private) class
AutoTrainAction.TSActionDelay
A runnable that implements delayed execution of a TransitSectionAction.
-
Constructor Summary
Constructors Constructor Description AutoTrainAction(AutoActiveTrain aat)
Create an AutoTrainAction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTransitSection(TransitSection ts)
protected void
cancelDoneSensor()
protected void
clearRemainingActions()
This method is called to clear any actions that have not been completedvoid
executeAction(TransitSectionAction tsa)
protected void
handleBlockStateChange(AllocatedSection as, Block b)
void
handleSensorChange(java.lang.String sName)
protected boolean
isDelayedStart(float speed)
protected void
removeTransitSection(TransitSection ts)
-
-
-
Constructor Detail
-
AutoTrainAction
public AutoTrainAction(AutoActiveTrain aat)
Create an AutoTrainAction.- Parameters:
aat
- the associated train
-
-
Method Detail
-
isDelayedStart
protected boolean isDelayedStart(float speed)
-
addTransitSection
protected void addTransitSection(TransitSection ts)
-
handleSensorChange
public void handleSensorChange(java.lang.String sName)
-
handleBlockStateChange
protected void handleBlockStateChange(AllocatedSection as, Block b)
-
removeTransitSection
protected void removeTransitSection(TransitSection ts)
-
clearRemainingActions
protected void clearRemainingActions()
This method is called to clear any actions that have not been completed
-
cancelDoneSensor
protected void cancelDoneSensor()
-
executeAction
public void executeAction(TransitSectionAction tsa)
-
-