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
TrackSpeedsint0-25548

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.
TrackPointsboolean

false-true

(Branch=true,Straight=false)

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

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