Package jmri.jmrit.ussctc
Class RouteLock
- java.lang.Object
-
- jmri.jmrit.ussctc.RouteLock
-
- All Implemented Interfaces:
Lock
public class RouteLock extends java.lang.Object implements Lock
Lock if any of the SignalHeads controlling traffic over a turnout are not at stop.This checks SignalHeads for RED; it locks against Restricting (FLASHRED) but you can change that by overriding the checkSignalClear() method.
-
-
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) java.lang.Iterable<BeanSetting>
beans
(package private) java.lang.Iterable<NamedBeanHandle<SignalHead>>
list
-
Fields inherited from interface jmri.jmrit.ussctc.Lock
debugLockLogger, signalLockLogger, turnoutLockLogger
-
-
Constructor Summary
Constructors Constructor Description RouteLock(java.lang.String head)
RouteLock(java.lang.String[] array)
RouteLock(java.lang.String[] array, BeanSetting[] beans)
RouteLock(java.util.List<NamedBeanHandle<SignalHead>> list)
RouteLock(java.util.List<NamedBeanHandle<SignalHead>> list, java.util.List<BeanSetting> beans)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLockClear(LockLogger lockLogger)
Test the lock conditions(package private) boolean
isSignalClear(NamedBeanHandle<SignalHead> handle)
java.lang.String
toString()
-
-
-
Field Detail
-
list
java.lang.Iterable<NamedBeanHandle<SignalHead>> list
-
beans
java.lang.Iterable<BeanSetting> beans
-
-
Constructor Detail
-
RouteLock
public RouteLock(@Nonnull java.util.List<NamedBeanHandle<SignalHead>> list)
- Parameters:
list
- SignalHeads that cover this route
-
RouteLock
public RouteLock(@Nonnull java.util.List<NamedBeanHandle<SignalHead>> list, @Nonnull java.util.List<BeanSetting> beans)
- Parameters:
list
- SignalHeads that cover this routebeans
- Defines the specific route
-
RouteLock
public RouteLock(@Nonnull java.lang.String[] array)
- Parameters:
array
- User or system names of SignalHeads that cover this route
-
RouteLock
public RouteLock(@Nonnull java.lang.String[] array, @Nonnull BeanSetting[] beans)
- Parameters:
array
- User or system names of SignalHeads that cover this routebeans
- Defines the specific route
-
-
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
-
isSignalClear
boolean isSignalClear(@Nonnull NamedBeanHandle<SignalHead> handle)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-