Package jmri.jmrit.ussctc
Class TurnoutSection
- java.lang.Object
-
- jmri.jmrit.ussctc.TurnoutSection
-
- All Implemented Interfaces:
CentralSection<CodeGroupTwoBits,CodeGroupTwoBits>,FieldSection<CodeGroupTwoBits,CodeGroupTwoBits>,Section<CodeGroupTwoBits,CodeGroupTwoBits>
public class TurnoutSection extends java.lang.Object implements Section<CodeGroupTwoBits,CodeGroupTwoBits>
Drive a single Turnout section on a USS CTC panel. ImplementsSectionfor both the field and CTC machine parts.
The two parts
are implemented as separate FieldSectionandCentralSectionstatic inner classes to ensure they're functionally separate, connected only by the code they exchange. They're combined in this single class to make sure they work together.Note that this intentionally does not turn off indicators when the code button is pressed unless a change has been requested. This is a model-railroad compromise to speed up the dispatcher's ability to see what's going on.
The state diagram for the central section is presented in three parts to make it more useful:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classTurnoutSection.TurnoutCentralSection(package private) classTurnoutSection.TurnoutFieldSection
-
Field Summary
Fields Modifier and Type Field Description (package private) TurnoutSection.TurnoutCentralSectioncentral(package private) static CodeGroupTwoBitsCODE_CLOSED(package private) static CodeGroupTwoBitsCODE_NEITHER(package private) static CodeGroupTwoBitsCODE_THROWN(package private) TurnoutSection.TurnoutFieldSectionfield(package private) Station<CodeGroupTwoBits,CodeGroupTwoBits>station
-
Constructor Summary
Constructors Constructor Description TurnoutSection()Anonymous object only for testingTurnoutSection(java.lang.String layoutTO, java.lang.String normalIndicator, java.lang.String reversedIndicator, java.lang.String normalInput, java.lang.String reversedInput, Station<CodeGroupTwoBits,CodeGroupTwoBits> station)Create and configure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocks(java.util.List<Lock> locks)CodeGroupTwoBitscodeSendStart()Inform central CTC machine part of section that a code-send operation (from central to field) has started and obtain the value to be sent over the line.voidcodeValueDelivered(CodeGroupTwoBits value)Provide the transferred value to the field unit at the end of the code-send operation.java.lang.StringgetName()Name of this Section.Station<CodeGroupTwoBits,CodeGroupTwoBits>getStation()voidindicationComplete(CodeGroupTwoBits value)Provides the code sequence to the central CTC machine at the end of the indication-send operation.CodeGroupTwoBitsindicationStart()Inform field part of section that an indication operation (from field to machine) has started and obtain the value to be conveyed to the central CTC machine.java.lang.StringtoString()
-
-
-
Field Detail
-
station
Station<CodeGroupTwoBits,CodeGroupTwoBits> station
-
CODE_CLOSED
static final CodeGroupTwoBits CODE_CLOSED
-
CODE_THROWN
static final CodeGroupTwoBits CODE_THROWN
-
CODE_NEITHER
static final CodeGroupTwoBits CODE_NEITHER
-
-
Constructor Detail
-
TurnoutSection
TurnoutSection()
Anonymous object only for testing
-
TurnoutSection
public TurnoutSection(java.lang.String layoutTO, java.lang.String normalIndicator, java.lang.String reversedIndicator, java.lang.String normalInput, java.lang.String reversedInput, Station<CodeGroupTwoBits,CodeGroupTwoBits> station)
Create and configure. Accepts user or system names.- Parameters:
layoutTO- Name for turnout on railroadnormalIndicator- Turnout name for normal (left) indicator light on panelreversedIndicator- Turnout name for reversed (right) indicator light on panelnormalInput- Sensor name for normal (left) side of switch on panelreversedInput- Sensor name for reversed (right) side of switch on panelstation- Station to which this Section belongs
-
-
Method Detail
-
getStation
public Station<CodeGroupTwoBits,CodeGroupTwoBits> getStation()
- Specified by:
getStationin interfaceSection<CodeGroupTwoBits,CodeGroupTwoBits>
-
getName
public java.lang.String getName()
Description copied from interface:SectionName of this Section. Does not include name of associated Station.- Specified by:
getNamein interfaceSection<CodeGroupTwoBits,CodeGroupTwoBits>- Returns:
- section name without station.
-
codeSendStart
public CodeGroupTwoBits codeSendStart()
Description copied from interface:CentralSectionInform central CTC machine part of section that a code-send operation (from central to field) has started and obtain the value to be sent over the line.- Specified by:
codeSendStartin interfaceCentralSection<CodeGroupTwoBits,CodeGroupTwoBits>- Returns:
- The value to be conveyed to the field.
-
codeValueDelivered
public void codeValueDelivered(CodeGroupTwoBits value)
Description copied from interface:FieldSectionProvide the transferred value to the field unit at the end of the code-send operation.- Specified by:
codeValueDeliveredin interfaceFieldSection<CodeGroupTwoBits,CodeGroupTwoBits>- Parameters:
value- transfer value.
-
indicationStart
public CodeGroupTwoBits indicationStart()
Description copied from interface:FieldSectionInform field part of section that an indication operation (from field to machine) has started and obtain the value to be conveyed to the central CTC machine.- Specified by:
indicationStartin interfaceFieldSection<CodeGroupTwoBits,CodeGroupTwoBits>- Returns:
- The value to be conveyed to the central CTC machine.
-
indicationComplete
public void indicationComplete(CodeGroupTwoBits value)
Description copied from interface:CentralSectionProvides the code sequence to the central CTC machine at the end of the indication-send operation.- Specified by:
indicationCompletein interfaceCentralSection<CodeGroupTwoBits,CodeGroupTwoBits>- Parameters:
value- to be conveyed.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-


