|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.AbstractNamedBean
jmri.Block
jmri.jmrit.logix.OBlock
public class OBlock
OBlock extends jmri.Block to be used in Logix Conditionals and Warrants. It is the smallest piece of track that can have occupancy detection. A better name would be Detection Circuit. However, an OBlock can be defined without an occupancy sensor and used to calculate routes. Additional states are defined to indicate status of the track and trains to control panels.
Entrances (exits when train moves in opposute direction) to OBlocks have Portals. A Portal object is a pair of OBlocks. Each OBlock has a list of its Portals.
When an OBlock (Detection Circuit) has a Portal whose entrance to the OBlock has a signal, then the OBlock and its chains of adjacent OBlocks up to the next OBlock having an entrance Portal with a signal, can be considered a "Block" in the sense of a prototypical railroad. Preferrably all entrances to the "Block" should have entrance Portals with a signal.
A Portal has a list of paths (OPath objects) for each OBlock it separates. The paths are determined by the turnout settings of the turnouts contained in the block. Paths are contained within the Block boundaries. Names of OPath objects only need be unique within an OBlock.
JMRI is free 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 |
ALLOCATED
|
static int |
DARK
|
static int |
OUT_OF_SERVICE
|
static int |
RUNNING
|
static int |
TRACK_ERROR
|
| Fields inherited from class jmri.Block |
|---|
GRADUAL, NONE, OCCUPIED, SEVERE, TIGHT, UNOCCUPIED |
| Fields inherited from class jmri.implementation.AbstractNamedBean |
|---|
mSystemName, mUserName |
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| Constructor Summary | |
|---|---|
OBlock(String systemName)
|
|
OBlock(String systemName,
String userName)
|
|
| Method Summary | |
|---|---|
boolean |
addPath(OPath path)
Enforce unique path names within block |
void |
addPortal(Portal portal)
Enforce unique portal names. |
String |
allocate(String pathName)
Note the block may be OCCUPIED by a non-warranted train, but the allocation is permitted. |
protected String |
allocate(Warrant warrant)
Allocate (reserves) the block for the Warrant that is the 'value' object Note the block may be OCCUPIED by a non-warranted train, but the allocation is permitted. |
String |
deAllocate(Warrant warrant)
Remove allocation state Remove listener regardless of ownership |
void |
dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others. |
String |
getAllocatedPathName()
|
String |
getDescription()
|
Sensor |
getErrorSensor()
|
float |
getLengthMeters()
|
float |
getLengthScaleFeet()
|
static String |
getLocalStatusName(String str)
|
static Enumeration<String> |
getLocalStatusNames()
|
NamedBeanHandle |
getNamedErrorSensor()
|
OPath |
getPathByName(String name)
|
Portal |
getPortalByName(String name)
|
List<Portal> |
getPortals()
|
float |
getScaleRatio()
|
static String |
getSystemStatusName(String str)
|
protected Warrant |
getWarrant()
|
void |
goingActive()
(Override) Handles Block sensor going ACTIVE: this block is now occupied, figure out from who and copy their value. |
void |
goingInactive()
(Override) Handles Block sensor going INACTIVE: this block is empty. |
boolean |
isFree()
Test that block is not occupied and and not allocated |
boolean |
isMetric()
|
void |
propertyChange(PropertyChangeEvent evt)
|
void |
pseudoPropertyChange(String propName,
Object old,
Object n)
Call for Circuit Builder to make icon color changes for its GUI |
void |
removePath(Path path)
|
void |
removePortal(Portal portal)
Remove portal from block and stub all paths using this portal to be dead end spurs. |
void |
setErrorSensor(String pName)
|
void |
setMetricUnits(boolean type)
|
void |
setNamedSensor(NamedBeanHandle<Sensor> namedSensor)
|
void |
setOutOfService(boolean set)
|
String |
setPath(String pathName,
Warrant warrant)
Set Turnouts for the path Called by warrants to set turnouts for a train it is able to run. |
void |
setScaleRatio(float sr)
|
void |
setSensor(String pName)
|
boolean |
statusIs(String statusName)
|
| Methods inherited from class jmri.Block |
|---|
addPath, getBlockSpeed, getCurvature, getDirection, getLengthCm, getLengthIn, getLengthMm, getNamedSensor, getPaths, getPermissiveWorking, getReporter, getSensor, getSpeedLimit, getState, getValue, getWorkingDirection, isReportingCurrent, setBlockSpeed, setCurvature, setDirection, setLength, setPermissiveWorking, setReporter, setReportingCurrent, setState, setValue, setWorkingDirection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ALLOCATED
public static final int RUNNING
public static final int OUT_OF_SERVICE
public static final int DARK
public static final int TRACK_ERROR
| Constructor Detail |
|---|
public OBlock(String systemName)
public OBlock(String systemName,
String userName)
| Method Detail |
|---|
public static Enumeration<String> getLocalStatusNames()
public static String getLocalStatusName(String str)
public static String getSystemStatusName(String str)
public void setSensor(String pName)
setSensor in class Blockpublic void setNamedSensor(NamedBeanHandle<Sensor> namedSensor)
setNamedSensor in class Blockpublic void setErrorSensor(String pName)
public Sensor getErrorSensor()
public NamedBeanHandle getNamedErrorSensor()
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerprotected Warrant getWarrant()
public String getAllocatedPathName()
public float getLengthScaleFeet()
public float getLengthMeters()
public void setMetricUnits(boolean type)
public boolean isMetric()
public void setScaleRatio(float sr)
public float getScaleRatio()
public boolean statusIs(String statusName)
public boolean isFree()
protected String allocate(Warrant warrant)
warrant -
public String allocate(String pathName)
public String deAllocate(Warrant warrant)
public void setOutOfService(boolean set)
public void addPortal(Portal portal)
public void removePortal(Portal portal)
public Portal getPortalByName(String name)
public List<Portal> getPortals()
public OPath getPathByName(String name)
public boolean addPath(OPath path)
public void removePath(Path path)
removePath in class Block
public String setPath(String pathName,
Warrant warrant)
pathName - name of the pathwarrant - warrant the block is allocated to
public void pseudoPropertyChange(String propName,
Object old,
Object n)
public void goingInactive()
goingInactive in class Blockpublic void goingActive()
goingActive in class Blockpublic void dispose()
NamedBeanFor example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.
dispose in interface NamedBeandispose in class AbstractNamedBeanpublic String getDescription()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||