Table of Contents
Automatic Mode
Build & Compile → General Information
In automatic mode many objects are involved to get it running.
Low level objects
Those objects are as close to hardware as possible. There are two categories: input and output.
A list of low level objects directly involved:
- sensors
- switches
- signals
- loco decoders
High level objects
The high level objects are using low level objects for getting information from the layout and controlling it.
Main high level objects:
- locos
- blocks
The LcDriver library
The Loc Driver library is the conductor of the automatic mode.
It uses a lot of objects to get its work done:
- locos
- blocks
- routes
- schedules
- groups
Blocks
Blocks are only interested in sensor events which will be evaluated as set in the routes definitions.
A block add it self as listener to all sensors defined for it.
If a sensor event make sense and the block is reserved by a loco object it will inform that object of the event.
Locos
Every Loco runs in its own thread.
Locos are getting informed by block events which are processed in the LcDriver library. The LcDriver will send commands back to the loco object incase the decoder must change velocity, direction or function.
LcDriver overview
lcdriver
The library entry point which runs in the loco's thread context.
events
Events are coming indirectly from block objects from the loco object.
enter
The enter event is evaluated if it fits the current status of the loco involved.
If all is OK the loco status is set to ENTER.