In automatic mode many objects are involved to get it running.
Those objects are as close to hardware as possible. There are two categories: input and output.
A list of low level objects directly involved:
The high level objects are using low level objects for getting information from the layout and controlling it.
Main high level objects:
The Loc Driver library is the conductor of the automatic mode.
It uses a lot of objects to get its work done:
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.
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.
The library entry point which runs in the loco's thread context.
Events are coming indirectly from block objects from the loco object.
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.