Package jmri
Class TransitSection
java.lang.Object
jmri.TransitSection
This class holds information and options for a Section when assigned to a
Transit. Corresponds to an allocatable "Section" of track assigned to a
Transit.
A TransitSection holds the following information: Section ID Section Direction Sequence number of Section within the Transit Special actions list for train in this Section, if requested (see TransitSectionAction.java) Whether this Section is a primary section or an alternate section
A TransitSection is referenced via a list in its parent Transit, and is stored on disk when its parent Transit is stored.
Provides for delayed initialization of Section when loading panel files, so that this is not dependent on order of items in the panel file.
-
Constructor Summary
ConstructorsConstructorDescriptionTransitSection(String secName, int seq, int direction, boolean alt) Create an alternate or primary TransitSection with a delayed initialization.TransitSection(String secName, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName, float fwdStopPerCent, float revStopPerCent) Create an alternate or primary TransitSection with a delayed initialization.TransitSection(Section s, int seq, int direction) Create a TransitSection.TransitSection(Section s, int seq, int direction, boolean alt) Create an alternate or primary TransitSection.TransitSection(Section s, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName, float fwdStopPerCent, float revStopPerCent) Create an alternate or primary TransitSection, and defined as safe or not -
Method Summary
Modifier and TypeMethodDescriptionvoidintfloatReturns the stopping distance percentage of section when transit allocated fwd.floatReturns the stopping distance percentage of section when transit allocated rev.Get the associated section.intGet a list of the actions for this TransitSectionbooleanbooleanisSafe()booleanvoidsetAlternate(boolean alt) voidsetFwdStopPerCent(float val) Sets the stopping distance percentage of section when transit allocated fwd.voidsetRevStopPerCent(float val) Sets actual distance percentage of section when transit allocated fwd.voidsetSafe(boolean safe) voidsetStopAllocatingSensor(String stopAllocatingSensor) voidsetTemporary(boolean boo)
-
Constructor Details
-
TransitSection
Create a TransitSection. This calls the alternate constructor with false for the alt value.- Parameters:
s- the section to add to the transitseq- the sequence number of the section in the transitdirection- the direction of travel within the transit
-
TransitSection
Create an alternate or primary TransitSection.- Parameters:
s- the section to add to the transitseq- the sequence number of the section in the transitdirection- the direction of travel within the transitalt- true if the section is an alternate; false if section is primary or has no alternates
-
TransitSection
public TransitSection(Section s, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName, float fwdStopPerCent, float revStopPerCent) Create an alternate or primary TransitSection, and defined as safe or not- Parameters:
s- the section to add to the transitseq- the sequence number of the section in the transitdirection- the direction of travel within the transitalt- true if the section is an alternate; false if section is primary or has no alternatessafe- true if this is a safe section. When dispatcher by safe sections a train is dispatched safe section to safe section with all intervening sections available.stopAllocatingSensorName- If this sensor is present, valid, and Active allocation will stop until it is no longer Active.fwdStopPerCent- The distance into the section when traveling fwd thru the transit.revStopPerCent- The distance into the section when traveling rev thru the transit.
-
TransitSection
Create an alternate or primary TransitSection with a delayed initialization.- Parameters:
secName- the name of the section to add to the transitseq- the sequence number of the section in the transitdirection- the direction of travel within the transitalt- true if the section is an alternate; false if section is primary or has no alternates
-
TransitSection
public TransitSection(String secName, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName, float fwdStopPerCent, float revStopPerCent) Create an alternate or primary TransitSection with a delayed initialization.- Parameters:
secName- the name of the section to add to the transitseq- the sequence number of the section in the transitdirection- the direction of travel within the transitalt- true if the section is an alternate; false if section is primary or has no alternatessafe- true if this is a safe section. When dispatcher by safe sections a train is dispatched safe section to safe section with all intervening sections available.stopAllocatingSensorName- If this sensor is present, valid, and Active allocation will stop until it is no longer Active.fwdStopPerCent- The distance into the section when traveling fwd thru the transit.revStopPerCent- The distance into the section when traveling rev thru the transit.
-
-
Method Details
-
setTemporary
-
isTemporary
-
getSection
Get the associated section.- Returns:
- the section or null if no section is associated with this TransitSection
-
getSectionName
-
getDirection
-
getSequenceNumber
-
addAction
-
isAlternate
-
setAlternate
-
isSafe
-
setSafe
-
getStopAllocatingSensor
-
setStopAllocatingSensor
-
setFwdStopPerCent
Sets the stopping distance percentage of section when transit allocated fwd.- Parameters:
val- length as a percentage of section;
-
getFwdStopPerCent
Returns the stopping distance percentage of section when transit allocated fwd. -
setRevStopPerCent
Sets actual distance percentage of section when transit allocated fwd.- Parameters:
val- length as a percentage of section;
-
getRevStopPerCent
Returns the stopping distance percentage of section when transit allocated rev. -
getTransitSectionActionList
Get a list of the actions for this TransitSection- Returns:
- a list of actions or an empty list if there are no actions
-