Package jmri.jmrit.ussctc
Class TrafficLock
- java.lang.Object
-
- jmri.jmrit.ussctc.TrafficLock
-
- All Implemented Interfaces:
Lock
public class TrafficLock extends java.lang.Object implements Lock
Implements a traffic lock.A signal can't be set if a route (set of turnout settings) is present and the far-end signal is set against. Each lock object handles one route.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.jmrit.ussctc.Lock
Lock.Valid
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BeanSetting[]
beans
(package private) CodeGroupThreeBits
direction
(package private) SignalHeadSection
farSignal
-
Fields inherited from interface jmri.jmrit.ussctc.Lock
debugLockLogger, signalLockLogger, turnoutLockLogger
-
-
Constructor Summary
Constructors Constructor Description TrafficLock(SignalHeadSection signal, CodeGroupThreeBits direction)
TrafficLock(SignalHeadSection signal, CodeGroupThreeBits direction, BeanSetting[] beans)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLockClear(LockLogger lockLogger)
Test the lock conditionsjava.lang.String
toString()
-
-
-
Field Detail
-
farSignal
SignalHeadSection farSignal
-
direction
CodeGroupThreeBits direction
-
beans
BeanSetting[] beans
-
-
Constructor Detail
-
TrafficLock
public TrafficLock(SignalHeadSection signal, CodeGroupThreeBits direction)
- Parameters:
signal
- SignalHeadSection at far end of this routedirection
- Setting that, if present in the far SignalHeadSection, means to lock
-
TrafficLock
public TrafficLock(SignalHeadSection signal, CodeGroupThreeBits direction, BeanSetting[] beans)
- Parameters:
signal
- SignalHeadSection at far end of this routedirection
- Setting that, if present in the far SignalHeadSection, means to lockbeans
- bean setting array.
-
-
Method Detail
-
isLockClear
public boolean isLockClear(LockLogger lockLogger)
Test the lock conditions- Specified by:
isLockClear
in interfaceLock
- Parameters:
lockLogger
- the logger on which to emit status messages- Returns:
- True if lock is clear and operation permitted
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-