Class AllocatedSection
AllocatedSections are referenced via a list in DispatcherFrame, which serves as a manager for AllocatedSection objects. Each ActiveTrain also maintains a list of AllocatedSections currently assigned to it.
AllocatedSections are transient, and are not saved to disk.
AllocatedSections keep track of whether they have been entered and exited.
If the Active Train this Section is assigned to is being run automatically, support is provided for monitoring Section changes and changes for Blocks within the Section.
This file is part of JMRI.
JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class -
Constructor Summary
ConstructorsConstructorDescriptionAllocatedSection(Section s, ActiveTrain at, int seq, Section next, int nextSeqNo) Create an AllocatedSection. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidvoiddispose()protected voidprotected voidfirePropertyChangeEvent(String name, Object oldVal, Object newVal) intintintprotected BlockgetEnterBlock(AllocatedSection previousAllocatedSection) booleanprotected BlockbooleanintgetIndex()floatgetLengthRemaining(Block block) Get the length of the section remaining including current blockintintprotected TransitSectionfinal voidprotected booleanprotected voidvoidvoidreset()voidsetAllocationNumber(int n) voidvoidsetExitSignalListener(PropertyChangeListener xSigListener) voidsetIndex(int i) protected booleansetNextSection(Section sec, int i) voidsetNextSectionSequence(int i) protected final voidMethods
-
Constructor Details
-
AllocatedSection
Create an AllocatedSection.- Parameters:
s- the section to allocationat- the train to allocate the section toseq- the sequence location of the section in the routenext- the following sectionnextSeqNo- the sequence location of the following section
-
-
Method Details
-
setAutoTurnoutsResponse
-
getLengthRemaining
Get the length of the section remaining including current block- Parameters:
block- block to start totaling block lengths- Returns:
- length in millimetres
-
getAutoTurnoutsResponse
-
getSection
-
getSectionName
-
getActiveTrain
-
getActiveTrainName
-
getSequence
-
getNextSection
-
getNextSectionSequence
-
setNextSection
-
setNextSectionSequence
-
getEntered
-
getExited
-
getAllocationNumber
-
setAllocationNumber
-
getForwardStoppingSensor
-
getReverseStoppingSensor
-
setIndex
-
getIndex
-
setExitSignalListener
-
getExitSignalListener
-
setStoppingSensors
Methods -
getTransitSection
-
getDirection
-
getActualLength
-
reset
-
initializeMonitorBlockOccupancy
-
getExitBlock
-
getEnterBlock
-
addToActiveBlockList
-
removeFromActiveBlockList
-
isInActiveBlockList
-
dispose
-
addPropertyChangeListener
-
removePropertyChangeListener
-
firePropertyChangeEvent
-
firePropertyChangeEvent
-