Final Touches

In the last days, I was able to make multiple trains use the center figure eight. My passed concerns about letting turnouts release trains was wrong. Since trains must check to see if both resources it needs for continued travel are available inside of HandleArrival letting any turnout free a train works fine. To accomplish this, I kept track of the BlockingTurnout as well as a blocking photocell. Inside of ReleasedBlockedTrains I now send two parameters: releasephotocell and releasedturnout. A simple or statement wakes up a trian if the train is blocked by either the release photocell or turnout. Even a turnout of –1 works because the train still must handle the new arrival. If handle arrival finds that the train still cannot move it is simply put back to the blocked list.

Also I wrote a very quick system edit program that initializes the system. The SystemEdit.exe writes to a .sys file that the TrainOS.exe reads from upon running the system.