Found a real logic error in the Train module. Plus lots of little things. Adding documentation to Layout.
Woke-up this morning with the real answer! The real problem is software analysis not coding. Earlier while working on the hardware I wrote the train module software based on the simulator. The simulator written in PHP used the same software to process each train, sequentially, step-by-step cycling through each train. The laptop program written in python used "copies" of the same software to process all the trains, in parallel, as the OS switches control from one instance (copy) of the software to another. As a result of this faulty analysis the current software is to convoluted repeatedly doing thing that are not needed and therefore SLOW. So need to start over with the train module 2.0.
Also need to make changes to module TT4 handle these changes and moving from system state 0 through 6.
While restructuring things I checked for consistency with some naming conventions.
Stumbled on to something ugly. Obviously YELLOW train vs. YELLOW light is a bit confusing. Modules TT4 and TRAINS each use both constants. So changed things to RED_LIGHT, YELLOW_LIGHT and GREEN_LIGHT.
In module Globals I define trains as:
RED = 1
ORANGE = 2
YELLOW = 3
GREEN = 4
In module Signals I define signal lights as:
RED = 1
YELLOW = 2
GREEN = 3
Changed the names in module signals.
Updated PyCharm IDE on the laptops. Windows got in there too.
Really broke it this time. messages from the laptop to the raspberry Pi get stuck in the send buffer.