Posts

Continuing from my last post: Automatic two trains layout

Image
 This post is the next step, where I bring the idea from paper to JMRI. I started in creating a new panel using the Control Panel Editor, then placed all the icons I needed to create a demo layout for two trains going back and forth, passing each other at a siding. I then created all the sensors I needed, which included the ends, single tracks and main/siding. The two turnouts are also set up as separate sensors. Then I created the turnouts. Next will be the OBlocks (which are created using the Circuit Builder). Within the OBlocks, there are also the Paths and Portals. But that will be my next posting.
Image
 This post was created following an email in the JMRI User Group list, with sort of a challenge, to create a short back and forth end to end two trains layout, single track with a siding in the middle. An exercise for anybody wanting to exercise: Write pseudo code for a layout having ten blocks to track two trains starting in blocks 1 and 10 towards each other. Blocks are numbered 1-10 from left to right. There is a passing siding in blocks 5&6. It is block 56.  Train A is in block 1 and train B is in block 10. Initially blocks 1 and 10 are the only blocks that are occupied. Each block has a sensor at each end for detecting occupancy.  Train A direction of travel (DOT) is east and train B DOT is west.  Each train is shorter than any block.  Have fun if you choose this exercise.  Jim K Jim Kirwan via groups.io < cact25=aol.com@groups.io > Tue, Jan 4, 10:39 PM (15 hours ago) to jmriusers Following this, and a few emails later, I drew up the following sketch, and an init