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 Object implements Section<CodeGroupTwoBits,CodeGroupTwoBits>
Drive a single Turnout section on a USS CTC panel.
Implements
The two parts
are implemented as separate
Section
for both the field and CTC machine parts.

FieldSection
and CentralSection
static 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.
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 class
TurnoutSection.TurnoutCentralSection
(package private) class
TurnoutSection.TurnoutFieldSection
-
Field Summary
Fields Modifier and Type Field Description (package private) TurnoutSection.TurnoutCentralSection
central
(package private) static CodeGroupTwoBits
CODE_CLOSED
(package private) static CodeGroupTwoBits
CODE_NEITHER
(package private) static CodeGroupTwoBits
CODE_THROWN
(package private) TurnoutSection.TurnoutFieldSection
field
(package private) Station
station
-
Constructor Summary
Constructors Constructor Description TurnoutSection()
Anonymous object only for testingTurnoutSection(String layoutTO, String normalIndicator, String reversedIndicator, String normalInput, String reversedInput, Station station)
Create and configure. -
Method Summary
Modifier and Type Method Description void
addLocks(List<Lock> locks)
CodeGroupTwoBits
codeSendStart()
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.void
codeValueDelivered(CodeGroupTwoBits value)
Provide the transferred value to the field unit at the end of the code-send operation.String
getName()
Name of this Section.Station
getStation()
void
indicationComplete(CodeGroupTwoBits value)
Provides the code sequence to the central CTC machine at the end of the indication-send operation.CodeGroupTwoBits
indicationStart()
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.
-
Field Details
-
Constructor Details
-
TurnoutSection
Anonymous object only for testing -
TurnoutSection
public TurnoutSection(String layoutTO, String normalIndicator, String reversedIndicator, String normalInput, String reversedInput, Station 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 Details
-
addLocks
-
getStation
- Specified by:
getStation
in interfaceSection<CodeGroupTwoBits,CodeGroupTwoBits>
-
getName
Description copied from interface:Section
Name of this Section. Does not include name of associated Station.- Specified by:
getName
in interfaceSection<CodeGroupTwoBits,CodeGroupTwoBits>
- Returns:
- section name without station.
-
codeSendStart
Description copied from interface:CentralSection
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.- Specified by:
codeSendStart
in interfaceCentralSection<CodeGroupTwoBits,CodeGroupTwoBits>
- Returns:
- The value to be conveyed to the field.
-
codeValueDelivered
Description copied from interface:FieldSection
Provide the transferred value to the field unit at the end of the code-send operation.- Specified by:
codeValueDelivered
in interfaceFieldSection<CodeGroupTwoBits,CodeGroupTwoBits>
- Parameters:
value
- transfer value.
-
indicationStart
Description copied from interface:FieldSection
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.- Specified by:
indicationStart
in interfaceFieldSection<CodeGroupTwoBits,CodeGroupTwoBits>
- Returns:
- The value to be conveyed to the central CTC machine.
-
indicationComplete
Description copied from interface:CentralSection
Provides the code sequence to the central CTC machine at the end of the indication-send operation.- Specified by:
indicationComplete
in interfaceCentralSection<CodeGroupTwoBits,CodeGroupTwoBits>
- Parameters:
value
- to be conveyed.
-