|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.automat.AbstractAutomaton
jmri.jmrit.automat.Siglet
jmri.jmrit.blockboss.BlockBossLogic
public class BlockBossLogic
Drives the "simple signal" logic for one signal.
Signals "protect" by telling the engineer about the conditions ahead. The engineer controls the speed of the train based on what the signals show, and the signals in turn react to whether the track ahead is occupied, what signals further down the line show, etc.
There are four situations that this logic can handle:
In this case, there is only a single set of sensors and a single next signal to protect.
In this case, the signal is forced red if the specified turnout is THROWN. When the turnout is CLOSED, there is a single set of sensors and next signal(s) to protect.
In this case, the signal is forced red if the specified turnout is CLOSED. When the turnout is THROWN, there is a single set of sensors and next signal(s) to protect.
If the turnout is THROWN, one set of sensors and next signal(s) is protected. If the turnout is CLOSED, another set of sensors and next signal(s) is protected.
Note that these four possibilities logically require that certain information be configured consistently; e.g. not specifying a turnout in TRAILINGMAIN doesn't make any sense. That's not enforced explicitly, but violating it can result in confusing behavior.
The protected sensors should cover the track to the next signal. If any of the protected sensors show ACTIVE, the signal will be dropped to red. Normally, the protected sensors cover the occupancy of the track to the next signal. In this case, the signal will show red to prevent trains from entering an occupied stretch of track (often called a "block"). But the actual source of the sensors can be anything useful, for example a microswitch on a local turnout, etc.
There are several varients to how a next signal is protected. In the simplest form, the controlled signal provides a warning to the engineer of what the signal being protected will show when it becomes visible:
In some cases, you want a signal to show exactly what the next signal shows, instead of one speed faster. E.g. if the (protected) next signal is red, this one should be red, instead of yellow. In this case, this signal is called a "distant signal", as it provides a "distant" view of the protected signal's appearance. Note that when in this mode, this signal still protects the interveneing track, etc.
The "hold" unbound parameter can be used to set this logic to show red, regardless of input. That's intended for use with CTC logic, etc.
"Approach lit" signaling sets the signal head to dark (off) unless the specified sensor(s) are ACTIVE. Normally, those sensors are in front of (before) the signal head. The signal heads then only light when a train is approaching. This is used to preserve bulbs and batteries (and sometimes to reduce engineer workload) on prototype railroads, but is uncommon on model railroads; once the layout owner has gone to the trouble and expense of installing signals, he usually wants them lit up.
Two signal heads can be protected. For example, if the next signal has two heads to control travel onto a main track or siding, then both heads should be provided here. The faster signal aspect will control the appearance of this head. For example, if the next signal is showing a green head and a red head, this signal will be green, because the train will be able to proceed at track speed when it reaches that next signal (along the track with the green signal).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrit.automat.AbstractAutomaton |
|---|
AbstractAutomaton.MsgFrame |
| Field Summary | |
|---|---|
static int |
FACING
|
static int |
SINGLEBLOCK
|
static int |
TRAILINGDIVERGING
|
static int |
TRAILINGMAIN
|
| Fields inherited from class jmri.jmrit.automat.Siglet |
|---|
inputs, outputs |
| Fields inherited from class jmri.jmrit.automat.AbstractAutomaton |
|---|
promptOnWait |
| Constructor Summary | |
|---|---|
BlockBossLogic()
Create a default object, without contents. |
|
BlockBossLogic(String name)
Create an object to drive a specific signal. |
|
| Method Summary | |
|---|---|
void |
defineIO()
Define the siglet's input and output. |
static Enumeration |
entries()
|
String |
getApproachSensor1()
Return the system name of the sensor being monitored |
boolean |
getDistantSignal()
|
String |
getDrivenSignal()
The "driven signal" is controlled by this element. |
static BlockBossLogic |
getExisting(String signal)
Return the BlockBossLogic item governing a specific signal. |
boolean |
getHold()
Provide the current value of the "hold" parameter. |
boolean |
getLimitSpeed1()
|
boolean |
getLimitSpeed2()
|
int |
getMode()
|
String |
getSensor1()
Return the system name of the sensor being monitored |
String |
getSensor2()
|
String |
getSensor3()
|
String |
getSensor4()
|
static BlockBossLogic |
getStoppedObject(String signal)
Return the BlockBossLogic item governing a specific signal, having removed it from use. |
String |
getTurnout()
Return the system name of the turnout being monitored |
boolean |
getUseFlash()
|
String |
getWatchedSensor1()
Return the system name of the sensor being monitored |
String |
getWatchedSensor1Alt()
Return the system name of the sensor being monitored |
String |
getWatchedSensor2()
Return the system name of the sensor being monitored |
String |
getWatchedSensor2Alt()
Return the system name of the sensor being monitored |
String |
getWatchedSignal1()
Return the system name of the signal being monitored for first route |
String |
getWatchedSignal1Alt()
Return the system name of the alternate signal being monitored for first route |
String |
getWatchedSignal2()
Return the system name of the signal being monitored for the 2nd route |
String |
getWatchedSignal2Alt()
Return the system name of the secondary signal being monitored for the 2nd route |
void |
retain()
Ensure that this BlockBossLogic object is available for later retrieval |
void |
setApproachSensor1(String name)
|
void |
setDistantSignal(boolean d)
|
void |
setHold(boolean m)
|
void |
setLimitSpeed1(boolean d)
|
void |
setLimitSpeed2(boolean d)
|
void |
setMode(int mode)
|
void |
setOutput()
Recompute new output state and apply it. |
void |
setSensor1(String name)
|
void |
setSensor2(String name)
|
void |
setSensor3(String name)
|
void |
setSensor4(String name)
|
void |
setTurnout(String name)
|
void |
setWatchedSensor1(String name)
|
void |
setWatchedSensor1Alt(String name)
|
void |
setWatchedSensor2(String name)
|
void |
setWatchedSensor2Alt(String name)
|
void |
setWatchedSignal1(String name,
boolean useFlash)
|
void |
setWatchedSignal1Alt(String name)
|
void |
setWatchedSignal2(String name)
|
void |
setWatchedSignal2Alt(String name)
|
| Methods inherited from class jmri.jmrit.automat.Siglet |
|---|
handle, init, setInputs |
| Methods inherited from class jmri.jmrit.automat.AbstractAutomaton |
|---|
getCount, getName, getThrottle, readServiceModeCV, run, setName, setTurnouts, start, stop, wait, waitChange, waitMsec, waitSensorActive, waitSensorActive, waitSensorChange, waitSensorChange, waitSensorInactive, waitSensorInactive, waitSensorState, waitSensorState, waitTurnoutConsistent, writeOpsModeCV, writeServiceModeCV |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SINGLEBLOCK
public static final int TRAILINGMAIN
public static final int TRAILINGDIVERGING
public static final int FACING
| Constructor Detail |
|---|
public BlockBossLogic()
public BlockBossLogic(String name)
name - System or user name of the driven signal.| Method Detail |
|---|
public String getDrivenSignal()
public void setSensor1(String name)
public void setSensor2(String name)
public void setSensor3(String name)
public void setSensor4(String name)
public String getSensor1()
public String getSensor2()
public String getSensor3()
public String getSensor4()
public void setTurnout(String name)
public String getTurnout()
public void setMode(int mode)
public int getMode()
public void setWatchedSignal1(String name,
boolean useFlash)
public String getWatchedSignal1()
public void setWatchedSignal1Alt(String name)
public String getWatchedSignal1Alt()
public void setWatchedSignal2(String name)
public String getWatchedSignal2()
public void setWatchedSignal2Alt(String name)
public String getWatchedSignal2Alt()
public void setWatchedSensor1(String name)
public String getWatchedSensor1()
public void setWatchedSensor1Alt(String name)
public String getWatchedSensor1Alt()
public void setWatchedSensor2(String name)
public String getWatchedSensor2()
public void setWatchedSensor2Alt(String name)
public String getWatchedSensor2Alt()
public void setLimitSpeed1(boolean d)
public boolean getLimitSpeed1()
public void setLimitSpeed2(boolean d)
public boolean getLimitSpeed2()
public boolean getUseFlash()
public void setDistantSignal(boolean d)
public boolean getDistantSignal()
public boolean getHold()
public void setHold(boolean m)
public void setApproachSensor1(String name)
public String getApproachSensor1()
public void defineIO()
defineIO in class Sigletpublic void setOutput()
setOutput in class Sigletpublic static Enumeration entries()
public void retain()
public static BlockBossLogic getStoppedObject(String signal)
signal -
public static BlockBossLogic getExisting(String signal)
Unlike getStoppedObject(String signal)
this does not remove the object from being used.
signal - system name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||