Package jmri.jmrit.ctc
Class CodeButtonHandler
- java.lang.Object
-
- jmri.jmrit.ctc.CodeButtonHandler
-
public class CodeButtonHandler extends java.lang.Object
This is the "master" class that handles everything when a code button is pressed. As such, it has a LOT of external data passed into it's constructor, and operates and modifies all objects it contains on a dynamic basis both when the button is pressed, and when external events happen that affect this object.Notes:
Changing both signal direction to non signals normal and switch direction at the same time "is allowed". Lock/Unlock is the LOWEST priority! Call on is the HIGHEST priority.
As of V1.04 of the CTC system, preconditioning (a.k.a. stacking) is supported. It is enabled by setting the internal sensor (automatically created) "IS:PRECONDITIONING_ENABLED" to active. Any other value inactivates this feature. For example, the user can create a toggle switch to activate / inactivate it.
-
-
Constructor Summary
Constructors Constructor Description CodeButtonHandler(boolean turnoutLockingOnlyEnabled, LockedRoutesManager lockedRoutesManager, java.lang.String userIdentifier, int uniqueID, NBHSensor codeButtonInternalSensor, int codeButtonDelayInMilliseconds, NBHSensor osSectionOccupiedExternalSensor, NBHSensor osSectionOccupiedExternalSensor2, SignalDirectionIndicatorsInterface signalDirectionIndicators, SignalDirectionLever signalDirectionLever, SwitchDirectionIndicators switchDirectionIndicators, SwitchDirectionLever switchDirectionLever, Fleeting fleeting, CallOn callOn, TrafficLocking trafficLocking, TurnoutLock turnoutLock, IndicationLockingSignals indicationLockingSignals)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelLockedRoute()
SignalDirectionIndicators calls us here when time locking is done.void
externalLockTurnout()
NBHSensor
getOSSectionOccupiedExternalSensor()
void
removeAllListeners()
This routine SHOULD ONLY be called by CTCMain when the CTC system is shutdown in order to clean up all resources prior to a restart.boolean
uniqueIDMatches(int uniqueID)
-
-
-
Constructor Detail
-
CodeButtonHandler
public CodeButtonHandler(boolean turnoutLockingOnlyEnabled, LockedRoutesManager lockedRoutesManager, java.lang.String userIdentifier, int uniqueID, NBHSensor codeButtonInternalSensor, int codeButtonDelayInMilliseconds, NBHSensor osSectionOccupiedExternalSensor, NBHSensor osSectionOccupiedExternalSensor2, SignalDirectionIndicatorsInterface signalDirectionIndicators, SignalDirectionLever signalDirectionLever, SwitchDirectionIndicators switchDirectionIndicators, SwitchDirectionLever switchDirectionLever, Fleeting fleeting, CallOn callOn, TrafficLocking trafficLocking, TurnoutLock turnoutLock, IndicationLockingSignals indicationLockingSignals)
-
-
Method Detail
-
removeAllListeners
public void removeAllListeners()
This routine SHOULD ONLY be called by CTCMain when the CTC system is shutdown in order to clean up all resources prior to a restart. Nothing else should call this.
-
cancelLockedRoute
public void cancelLockedRoute()
SignalDirectionIndicators calls us here when time locking is done.
-
uniqueIDMatches
public boolean uniqueIDMatches(int uniqueID)
-
getOSSectionOccupiedExternalSensor
public NBHSensor getOSSectionOccupiedExternalSensor()
-
externalLockTurnout
public void externalLockTurnout()
-
-