|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.AbstractNamedBean
jmri.Section
public class Section
Sections represent a group of one or more connected Blocks that may be allocated to one or more trains travelling in a given direction.
A Block may be in multiple Sections. All Blocks contained in a given section must be unique. Blocks are kept in order--the first block is connected to the second, the second is connected to the third, etc.
A Block in a Section must be connected to the Block before it (if there is one) and to the Block after it (if there is one), but may not be connected to any other Block in the Section. This restriction is enforced when a Section is created, and checked when a Section is loaded from disk.
A Section has a "direction" defined by the sequence in which Blocks are added to the Section. A train may run through a Section in either the forward direction (from first block to last block) or reverse direction (from last block to first block).
A Section has two or more EntryPoints. Each EntryPoint is a Path of one of the Blocks in the Section that defines a connection to a Block outside of the Section. EntryPoints are grouped into two lists: "forwardEntryPoints" - entry through which will result in a train travelling in the "forward" direction "reverseEntryPoints" - entry through which will result in a train travelling in the "reverse" direction Note that "forwardEntryPoints" are also reverse exit points, and vice versa.
A Section has one of the following states" FREE - available for allocation by a dispatcher FORWARD - allocated for travel in the forward direction REVERSE - allocated for travel in the reverse direction
A Section has an occupancy. A Section is OCCUPIED if any of its Blocks is OCCUPIED. A Section is UNOCCUPIED if all of its Blocks are UNOCCUPIED
A Section of sufficient length may be allocated to more than one train provided the trains are travelling in the same direction. There must be at least one block between trains travelling in the same direction in a section.
A Section may not contain any reverse loops. The track that is reversed in a reverse loop must be in a separate Section.
Each Section optionally carries two direction sensors, one for the forward direction and one for the reverse direction. These sensors force signals for travel in their respective directions to "RED" when they are active. When the Section is free, both the sensors are Active. These internal sensors follow the state of the Section, permitting signals to function normally in the direction of allocation.
Each Section optionally carries two stopping sensors, one for the forward direction and one for the reverse direction. These sensors change to active when a train traversing the Section triggers its sensing device. Stopping sensors are physical layout sensors, and may be either point sensors or occupancy sensors for short blocks at the end of the Section. A stopping sensor is used during automatic running to stop a train that has reached the end of its allocated Section. This is needed, for example, to allow a train to enter a passing siding and clear the track behind it. When not running automatically, these sensors may be used to light panel lights to notify the dispatcher that the train has reached the end of the Section.
This Section implementation provides for delayed initialization of blocks and direction sensors to be independent of order of items in panel files.
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.
| Field Summary | |
|---|---|
static int |
FORWARD
|
static int |
FREE
|
static int |
OCCUPIED
Constants representing the occupancy of the Section. |
static int |
REVERSE
|
static int |
UNKNOWN
Constants representing the state of the Section. |
static int |
UNOCCUPIED
|
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT |
| Constructor Summary | |
|---|---|
Section(String systemName)
|
|
Section(String systemName,
String userName)
|
|
| Method Summary | |
|---|---|
boolean |
addBlock(Block b)
Add a Block to the Section Block and sequence number must be unique within the Section. |
void |
addToForwardList(EntryPoint ep)
Access methods for EntryPoints within the Section |
void |
addToReverseList(EntryPoint ep)
|
boolean |
checkSignals(JmriJFrame frame,
LayoutEditor panel)
Checks that there are Signal Heads at all Entry Points to this Section. |
boolean |
connectsToBlock(Block b)
|
boolean |
containsBlock(Block b)
|
void |
delayedAddBlock(String blockName)
|
void |
delayedSetForwardBlockingSensorName(String forwardSensor)
|
void |
delayedSetForwardStoppingSensorName(String forwardSensor)
|
void |
delayedSetReverseBlockingSensorName(String reverseSensor)
|
void |
delayedSetReverseStoppingSensorName(String reverseSensor)
|
String |
getBeginBlockName()
Access methods for beginning and ending block names |
Block |
getBlockBySequenceNumber(int seqNumber)
Get Block by its Sequence number in the Block list Blocks are numbered 0 to size-1; |
ArrayList<Block> |
getBlockList()
Get a Copy of this Section's Block List |
int |
getBlockSequenceNumber(Block b)
Get the sequence number of a Block Returns -1 if Block is not in the Section |
String |
getEndBlockName()
|
Block |
getEntryBlock()
|
EntryPoint |
getEntryPointFromBlock(Block b,
int dir)
Returns the EntryPoint for entry from specified Block for travel in specified direction Returns 'null' if not found. |
EntryPoint |
getEntryPointFromSection(Section s,
int dir)
Returns the EntryPoint for entry from specified Section for travel in specified direction Returns 'null' if not found. |
List<EntryPoint> |
getEntryPointList()
|
EntryPoint |
getExitPointToBlock(Block b,
int dir)
Returns the EntryPoint for exit to specified Block for travel in specified direction Returns 'null' if not found. |
EntryPoint |
getExitPointToSection(Section s,
int dir)
Returns the EntryPoint for exit to specified Section for travel in specified direction Returns 'null' if not found. |
Sensor |
getForwardBlockingSensor()
|
String |
getForwardBlockingSensorName()
Access methods for forward and reverse blocking sensors The set methods return a Sensor object if successful, or else they return "null"; |
List<EntryPoint> |
getForwardEntryPointList()
|
Sensor |
getForwardStoppingSensor()
|
String |
getForwardStoppingSensorName()
Access methods for forward and reverse stopping sensors The set methods return a Sensor object if successful, or else they return "null"; |
Block |
getNextBlock()
|
int |
getOccupancy()
Query the occupancy of a section |
Sensor |
getReverseBlockingSensor()
|
String |
getReverseBlockingSensorName()
|
List<EntryPoint> |
getReverseEntryPointList()
|
Sensor |
getReverseStoppingSensor()
|
String |
getReverseStoppingSensorName()
|
int |
getState()
Query the state of the Section |
boolean |
isForwardEntryPoint(EntryPoint ep)
|
boolean |
isReverseEntryPoint(EntryPoint ep)
|
int |
placeDirectionSensors(LayoutEditor panel)
Places direction sensors in SSL for all Signal Heads in this Section if the Sensors are not already present in the SSL. |
void |
removeAllBlocksFromSection()
Remove all Blocks, Block Listeners, and Entry Points |
void |
removeEntryPoint(EntryPoint ep)
|
Sensor |
setForwardBlockingSensorName(String forwardSensor)
|
Sensor |
setForwardStoppingSensorName(String forwardSensor)
|
Sensor |
setReverseBlockingSensorName(String reverseSensor)
|
Sensor |
setReverseStoppingSensorName(String reverseSensor)
|
void |
setState(int state)
Set the state of the Section |
String |
validate(LayoutEditor lePanel)
Validate the Section. |
| Methods inherited from class jmri.implementation.AbstractNamedBean |
|---|
addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNKNOWN
public static final int FREE
public static final int FORWARD
public static final int REVERSE
public static final int OCCUPIED
public static final int UNOCCUPIED
| Constructor Detail |
|---|
public Section(String systemName,
String userName)
public Section(String systemName)
| Method Detail |
|---|
public int getState()
getState in interface NamedBeanpublic void setState(int state)
setState in interface NamedBeanpublic int getOccupancy()
public String getForwardBlockingSensorName()
public Sensor getForwardBlockingSensor()
public Sensor setForwardBlockingSensorName(String forwardSensor)
public void delayedSetForwardBlockingSensorName(String forwardSensor)
public String getReverseBlockingSensorName()
public Sensor setReverseBlockingSensorName(String reverseSensor)
public void delayedSetReverseBlockingSensorName(String reverseSensor)
public Sensor getReverseBlockingSensor()
public String getForwardStoppingSensorName()
public Sensor getForwardStoppingSensor()
public Sensor setForwardStoppingSensorName(String forwardSensor)
public void delayedSetForwardStoppingSensorName(String forwardSensor)
public String getReverseStoppingSensorName()
public Sensor setReverseStoppingSensorName(String reverseSensor)
public void delayedSetReverseStoppingSensorName(String reverseSensor)
public Sensor getReverseStoppingSensor()
public boolean addBlock(Block b)
public void delayedAddBlock(String blockName)
public ArrayList<Block> getBlockList()
public Block getBlockBySequenceNumber(int seqNumber)
public int getBlockSequenceNumber(Block b)
public void removeAllBlocksFromSection()
public Block getEntryBlock()
public Block getNextBlock()
public boolean containsBlock(Block b)
public boolean connectsToBlock(Block b)
public String getBeginBlockName()
public String getEndBlockName()
public void addToForwardList(EntryPoint ep)
public void addToReverseList(EntryPoint ep)
public void removeEntryPoint(EntryPoint ep)
public List<EntryPoint> getForwardEntryPointList()
public List<EntryPoint> getReverseEntryPointList()
public List<EntryPoint> getEntryPointList()
public boolean isForwardEntryPoint(EntryPoint ep)
public boolean isReverseEntryPoint(EntryPoint ep)
public EntryPoint getEntryPointFromSection(Section s,
int dir)
public EntryPoint getExitPointToSection(Section s,
int dir)
public EntryPoint getEntryPointFromBlock(Block b,
int dir)
public EntryPoint getExitPointToBlock(Block b,
int dir)
public int placeDirectionSensors(LayoutEditor panel)
public boolean checkSignals(JmriJFrame frame,
LayoutEditor panel)
public String validate(LayoutEditor lePanel)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||