JMRI: Aspect Signaling
Controling signaling in a prototypical mannerProtoypical signal systems present "aspects" to the engineer to tell him how to run his train. The "Stop" aspect, for example, is pretty simple: Stop the train. The "Approach medium" aspect indicates something more complicated: "Proceed approaching next signal at medium speed". Each aspect has an associated "indication", which is usually codified in the railroad's rule book.
Different signals may show an aspect using different combinations of lights, semaphore positions, and/or placards; these are called "appearances". For example, the "stop" aspect will be a single red light on a signal mast with one lamp, red over red lamps for a signal mast with two lamps, etc.
JMRI Support for Aspect SignalingThe original JMRI support for signals was via "Signal Heads", which could be set to specific appearances (colors).
Starting with JMRI 2.9.1 (early 2010), JMRI also contains "Signal Mast" objects that represent an entire signal, not just an individual head. A Signal Mast can operate multiple heads, as required to do full prototypical signaling based on aspects. When its "Aspect" is set to e.g. "Approach medium", it handles the layout operations needed to make the signals on the layout appear properly.
Signal Masts are configured through the Signal Mast Table You add new ones with the "Add..." button on the table, which takes you to the "Add Signal Mast" window. To add a new signal mast, you specify what kind of signaling system it uses (see below), the specific signal type like "double searchlight" or "double head dwarf", and what signal heads it's going to drive.
>From the table, you can set individual signal masts to any aspect that they're able to display by clicking in the "Aspect" column.
Signal Masts can be both tested (in Conditionals) and set (in Actions) via Logix. When you're editing a Logix Conditional or Action, you have to type the Signal Mast name and hit enter/return so that the program can look up the possible aspects for that particular signal mast.
You can also add a Signal Mast icon in the Panel Editor in the usual way. The icon will display the images from the appearance definition for that particular signal mast.
Signal Mast LogicStarting with JMRI 2.11.7 (mid 2011), JMRI contains a "Signal Mast Logic" tool, that allows the Signalling logic to be built up between Signal Masts on the layout. The signal mast logic will use the states of blocks, turnouts, sensors and other Signal Masts to determine what appearance a Signal Mast should be displaying.
If the layout has been drawn up on the layout editor and the SignalMasts have been placed on the panel using the various tools, then it is possible for all the Signal Mast logic to be dynamically built, with little other user interaction.
Available Signaling SystemsJMRI users have provided a number of pre-defined signal systems:
- A non-prototypical set of aspects and appearances that most model railroaders will understand easily.
- American Association of Railroads 1946 rule book
- Burlington Northern 1989 rule book
- British Rail 2003 rule book
- CSX 1998 rule book
- DB HV 1969
- 1969 Deutsche Bundesbahn "Einheitsbauform" Home Signal/Distant signal (Hauptsignal/Vorsignal) system revision
- New York Central System 1937 rule book
- Norfolk Southern Corporation Operating rules book (NORAC)
- SLSF (Frisco) 1973 rule book
- Southern Pacific Railway and Transportation Company 1930 rule book
- Southern Pacific Railway and Transportation Company 1960 rule book
Access to Aspect Information from CodeA program (in Java or Python) can get access to aspect information two ways. If it has a reference to a specific SignalMast "m", it can use
to get the list of aspect names that this signal mast can display. The program can then access the signal system definition withm.getValidAspects()
and then enquire about properties of the aspect:SignalSystem sys = m.getSignalSystem()
where the first argument is the aspect name (use, for example,sys.getProperty("Clear","speed");
m.getAspect()to obtain the current one on the mast) and the second is a specific property. Properties can be defined programatically via e.g.
m.setProperty("Clear","speed","69");or get loaded automatically from elements in the aspect.xml file that defines the specific signal system.
In addition to the global properties for an aspect, there can also be properties local to a specific Signal Mast type. An example of this is the default icon image: The image for a two-head signal mast is different from that for a one-head signal mast, even if they both represent "Clear".
To get those:
In words, this is saying "Get the appeance info for this mast,
and then check the imagelink property of the Clear aspect".
Alternately, if you know the name of the signal system in use,
you can go directly to it via the InstanceManager:
SignalSystem sys = InstanceManager.signalSystemManagerInstance().getSystem("basic");