Page tree
Skip to end of metadata
Go to start of metadata

Controller Output

The controller executable outputs JSON data whenever certain internal values are updated. The JSON output contains one or more of the following fields.

Field nameContent typeValue rangeNumber of valuesDescription

The speed each track is set at.

TrackContactsbooleanfalse-true96Whether or not a contact is triggered. Contacts on the same track are consecutive, for instance the contacts on track 0 are represented by indexes 0 and 1 in this array.



30Whether a given directional switch is set to straight or branch.

The track each train is currently on.

Bellbooleanfalse-true1Whether the bell is ringing or not.
Gate0booleanfalse-true1Whether gate 0 is raised or not.
Gate1booleanfalse-true1Whether gate 1 is raised or not.

Controller Input

The controller accepts the following input format read from a JSON file. The JSON file is called input.json and is found in $XDG_CONFIG_HOME/railway if XDG_CONFIG_HOME is set or from $HOME/.config/railway if it isn't.

Field nameContent typeValue rangeNumber of valuesDescription
Actionint0-MAXINT,0-10, 0-473Contains the description of a new train action in the format: [ action id, train id, destination ]
  • No labels