开云体育

Locked Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works) #layouteditor #logix


 

Some may remember my name from a while back when I was trying to get started and having the usual difficulties.? Many of you were very helpful, and indeed without your help I wouldn't have the working system that I have now.? The main help came from Dave Sand - but I have thanked him separately.? To those who helped thanks.

My control system has worked well and run my small UK layout well.? It's fully interlocked, BUT I chickened out on block occupancy.? It would probably have been the final straw back than anyway.? Now I am going to have a go.

I would LIKE to mimic the UK approach of having the track dark grey and marking a selected route through it in white.? The occupancy would show up red and clear to dark grey after clearance.? The switching to red on a sensor is easy enough (and I already do this manually) but the white route is different. There IS an alternative colour for the track and both Entry/Exit NX facilities and Dispatcher:

NX: "The full interlock will also set the state of the layout Blocks to use the alternative color, and the NX sensor buttons will remain in a solid active state".
Dispatcher: "Check Use alternate color for allocated Blocks to use the Layout Editor alternate unoccupied color for allocated Blocks in Layout Editor panels. This option is designed to make it easier for the dispatcher to see which Sections have been allocated."

Sadly neither NX or Dispatcher are suitable for my use.

I am sorry, but I have searched and searched but can find no way to cause this colour change in Logix.? I am happy to use other facilities or even Scripting if I must.? Can anybody please tell me how?


 

Iain,

The ManageBlocks.py script in the JMRI install directory will do what you want. ?There is another version which has additional features. ?It used to be in the group's file area, but is no longer there. ?There are also internal JMRI changes which require script changes so newer versions will be coming soon.

Dave Sand


----- Original message -----
From: Iain <iain@...>
Subject: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Friday, May 08, 2020 3:41 AM

Some may remember my name from a while back when I was trying to get started and having the usual difficulties.? Many of you were very helpful, and indeed without your help I wouldn't have the working system that I have now.? The main help came from Dave Sand - but I have thanked him separately.? To those who helped thanks.

My control system has worked well and run my small UK layout well.? It's fully interlocked, BUT I chickened out on block occupancy.? It would probably have been the final straw back than anyway.? Now I am going to have a go.

I would LIKE to mimic the UK approach of having the track dark grey and marking a selected route through it in white.? The occupancy would show up red and clear to dark grey after clearance.? The switching to red on a sensor is easy enough (and I already do this manually) but the white route is different. There IS an alternative colour for the track and both Entry/Exit NX facilities and Dispatcher:

NX: "The full interlock will also set the state of the layout Blocks to use the alternative color, and the NX sensor buttons will remain in a solid active state".
Dispatcher: "Check Use alternate color for allocated Blocks to use the Layout Editor alternate unoccupied color for allocated Blocks in Layout Editor panels. This option is designed to make it easier for the dispatcher to see which Sections have been allocated."

Sadly neither NX or Dispatcher are suitable for my use.

I am sorry, but I have searched and searched but can find no way to cause this colour change in Logix.? I am happy to use other facilities or even Scripting if I must.? Can anybody please tell me how?



 

I finally saw your answer in the #NX topic.? I'll follow that up.? Thank you again ...............


 

Had my first read through of the code and I think (?) I understand it.

The reserve/release does exactly what I want - by flipping? the variable?layoutBlock.setUseExtraColor() so I'll get either (as set up) Dark-Grey or white. Excellent!

I have played with reserving Memorys and I have the problem that JMRI insists on putting IM at the front - is that OK or should I be using the user name column?

It looks as if I will have to add to the .py Script an "rTest" function so I can check which state the block is in - normal or reserved since I do not want my Logix to reallocate a reserved block or an occupied block.? The test for an "active" occupied block is already available on a sensor setting.? I can see that there is a?layoutBlock.getUseExtraColor() construct so if I read that and have an "rState" memory to return I would be able to test that as 0 or 1 perhaps? It will complicate the Logix a bit since I will have to fetch the value before I can test it - unlike with a sensor - or is there a way to set a sensor from within the Script?? There must be, I just don't know enough about JMRI.? Could you give me a hint please when you have time?

Finally, my ignorance showing again, I have no idea how to set a Logix to run on start up??????


 

Iain,

Define the memory variable with whatever system name you want and use the r???? names as the user names. ?I use IM900, etc., for the system names.

Setting UseExtraColor to it's current state has no impact on anything. ?I handle block locking outside of the ManageBlocks process. ?

A typical allocation action:
?????????????? On Change To True, Set Memory, "OD1-Lock". to 2.??
?????????????? On Change To True, Set Memory, "BDM-Lock". to W.??
?????????????? On Change To True, Set Sensor, "LK-BSME" to Active??
?????????????? On Change To True, Clear Signal Mast Held, "SM-CS1W".??
?????????????? On Change To True, Set Memory, "OD1-Signal". to SM-CS1W.??
?????????????? On Change To True, Set Memory, "rBlocks". to iBDM1, iBDM2, iOD1.??
?????????????? On Change To True, Set Memory, "rDirection". to W.??
?????????????? On Change To True, Set Memory, "rAction". to reserve.??
?????????????? On Change To True, Set Memory, "Message".??

You could update a sensor within the script but you have to have a method to correlate a block name with a locking sensor name. ?It is easier to let the Logix handle it.

To initialize Logix, create a LRoute with the "Initializer" type selected. ?To simplify things, select one sensor from Output Actions and return to the Basics tab and select Create. ?This will create a RTXINITIALIZER Logix. ?As of 4.19.5, the name changes to IX:RTXINITIALIZER. ? This is the first Logix that runs after panel loading is complete.

Once the Logix is created, you can edit the RTXINITIALIZER Logix to perform whatever startup processing you need. ?Here is mine:

? IX:RTXINITIALIZER1T? Route 1C Initialize??
?? Antecedent: R1?
??? [x]? R1? IF? IX:RTXINITIALIZER type???
???????????? THEN??
?????????????? On Change To True, Run Script from file, preference:scripts/TurnoutSimulator.py.??
?????????????? On Change To True, Set Memory, "rAction". to Done.??
?????????????? On Change To True, Set Memory, "rDebug". to No.??
?????????????? On Change To True, Run Script from file, preference:scripts/ManageBlocks2.py.??
?????????????? On Change To True, Set Sensor, "Reset1" to Active??
?????????????? On Change To True, Delayed Set Sensor, "Reset2" to Active, after 10 seconds.??

I am using ManageBlocks2 which has additional features. ?

Notice that the script is part of the user files location. ?This way it is protected from JMRI installs.

Dave Sand


----- Original message -----
From: Iain <iain@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Friday, May 08, 2020 12:05 PM

Had my first read through of the code and I think (?) I understand it.

The reserve/release does exactly what I want - by flipping? the variable?layoutBlock.setUseExtraColor() so I'll get either (as set up) Dark-Grey or white. Excellent!

I have played with reserving Memorys and I have the problem that JMRI insists on putting IM at the front - is that OK or should I be using the user name column?

It looks as if I will have to add to the .py Script an "rTest" function so I can check which state the block is in - normal or reserved since I do not want my Logix to reallocate a reserved block or an occupied block.? The test for an "active" occupied block is already available on a sensor setting.? I can see that there is a?layoutBlock.getUseExtraColor() construct so if I read that and have an "rState" memory to return I would be able to test that as 0 or 1 perhaps? It will complicate the Logix a bit since I will have to fetch the value before I can test it - unlike with a sensor - or is there a way to set a sensor from within the Script?? There must be, I just don't know enough about JMRI.? Could you give me a hint please when you have time?

Finally, my ignorance showing again, I have no idea how to set a Logix to run on start up??????


 

Dave,

Thank you so much for your kind, detailed and rapid help.? I have been playing with an NCE AIU and BD20s this afternoon - testing them before trying to fit them under my layout.

I understand all of your reply (well so far!). Its not that I was worried about multiple "reserve" calls, but that a route would be invalid and setting must be aborted (vetoed) if any of the Blocks it requires is either Occupied (Block occupancy sensor active) OR in Reserved status (alternate colour displayed - and of course already in another route).? I get your point about keeping Sensor setting out of the ManageBlocks Script.? I shall define 2 sensors for each Block: e.g for "Platform 1a", OP1a (activated by an occupancy sensor) and RP1a? (reserved via ManageBlocks) which will enable me to test if occupied or if reserved in a Logix conditional. The Logix action(s) which calls ManageBlocks will also set the appropriate "R" sensors.? I have yet to think through the route clearing process to ensure that when a Block becomes inactive again it reverts to normal (released) status and not reserved.? This may be something to attach to a changed "O" Sensor state (going to inactive) setting its twin "R" Sensor inactive and invoking ManageBlocks to release to ensure the "normal" line colour appears on the diagram.

I am sorry - you DID tell me how to set up an RTXINITIALIZER before - it was hidden in an email exchange.? Likewise you had taught me "Notice that the script is part of the user files location. ?This way it is protected from JMRI installs." before too - but I would have forgotten (again!).

Pointing me at LRoute again made me think I should re-read that documentation as a way forward to generate the Logix.

Thanks again.? Got me started ................

Iain


 

Iain,

I keep all of the logic in Logix. ?ManageBlocks just handles the color.

I release the allocation when the block becomes Active, but only if the block is not locked. ?The block lock memory variable has 3 states: 0 (not locked), E or W. ?The block is still protected since it is now occupied. ?When it changes to unoccupied, it becomes eligible for another route.

? IX400C5? Release BDP1??
??? [x]? R1? IF? Sensor "BDP1" state is "Sensor Active"??
??? [ ]? R2??? AND NOT Memory "BDP1-Lock" = value "0"??
???????????? THEN??
?????????????? On Change To True, Set Memory, "BDP1-Lock". to 0.??
?????????????? On Change To True, Set Memory, "rBlocks". to iBDP1.??
?????????????? On Change To True, Set Memory, "rAction". to release.??

Dave Sand



----- Original message -----
From: Iain <iain@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Friday, May 08, 2020 4:07 PM

Dave,

Thank you so much for your kind, detailed and rapid help.? I have been playing with an NCE AIU and BD20s this afternoon - testing them before trying to fit them under my layout.

I understand all of your reply (well so far!). Its not that I was worried about multiple "reserve" calls, but that a route would be invalid and setting must be aborted (vetoed) if any of the Blocks it requires is either Occupied (Block occupancy sensor active) OR in Reserved status (alternate colour displayed - and of course already in another route).? I get your point about keeping Sensor setting out of the ManageBlocks Script.? I shall define 2 sensors for each Block: e.g for "Platform 1a", OP1a (activated by an occupancy sensor) and RP1a? (reserved via ManageBlocks) which will enable me to test if occupied or if reserved in a Logix conditional. The Logix action(s) which calls ManageBlocks will also set the appropriate "R" sensors.? I have yet to think through the route clearing process to ensure that when a Block becomes inactive again it reverts to normal (released) status and not reserved.? This may be something to attach to a changed "O" Sensor state (going to inactive) setting its twin "R" Sensor inactive and invoking ManageBlocks to release to ensure the "normal" line colour appears on the diagram.

I am sorry - you DID tell me how to set up an RTXINITIALIZER before - it was hidden in an email exchange.? Likewise you had taught me "Notice that the script is part of the user files location. ?This way it is protected from JMRI installs." before too - but I would have forgotten (again!).

Pointing me at LRoute again made me think I should re-read that documentation as a way forward to generate the Logix.

Thanks again.? Got me started ................

Iain


 

Dave,

Thanks for the advice. I had been using Sensors for everything - since up until now they were really only on/off states.? Clearly I need to store the state of the Block - but that can be evaluated either as a Sensor or a Memory and since setting the state is not going to trigger some other action (as a Sensor could) it is better to use a passive Memory rather than an active Sensor.

More thoughts for the design process. I am still considering the implications of process of "reserving" Blocks and tossing around ideas of the need to actually have a further state of "locked" after the signal is cleared and until the Block occupancy sensor has reset.? I certainly will need "normal" and "reserved" (reflected in thrie display colours).

Why do I need locked?? Is it to prevent interference after the route is fully evaluated and set, or is there another purpose?? If only the first I am not sure that my small layout really needs it.

If you have time to comment or point me at some JMRI or other documents please do.? Your help is always to the point and appreciated.

Thanks again,

Iain


 

I get three track colours in Logix by using a multiway sensor. You can define three different icons for each position of the sensor. I have grey, yellow and red track sections defined ?and by turning on the required sensor and the others off can change the colour of the track. My panels are somewhat basically programmed, with almost all done in Logix because I wanted full control over all the addresses to allow me to take modules in and out of the layout, and keep addresses for each module in set number ranges.

Mike Ruby


 

Mike,

Interesting concept but it sounds to me like you are talking about a Panel Editor or Control Panel Editor panel. ?They use icons for track. ?Layout Editor draws lines for tracks, including turnouts.

Dave Sand


----- Original message -----
From: "Mike via groups.io" <mike_rby=[email protected]>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Saturday, May 09, 2020 8:52 AM

I get three track colours in Logix by using a multiway sensor. You can define three different icons for each position of the sensor. I have grey, yellow and red track sections defined ?and by turning on the required sensor and the others off can change the colour of the track. My panels are somewhat basically programmed, with almost all done in Logix because I wanted full control over all the addresses to allow me to take modules in and out of the layout, and keep addresses for each module in set number ranges.

Mike Ruby


 

Iain,

I prefer to separate the logic from the display.

Consider setting up a meet. ? One train will take the main, the other train will take the siding.

The dispatcher lines the route to the main and activates the route for the first train. ?The logic checks to make sure the route is free and then locks the blocks for route. ?For visual feedback for the dispatcher, the blocks are "reserved" which sets the ?block colors to the alternate track color.

If the dispatcher tries to set a route for the opposing train to the main, the logic will create an error indicating the the proposed route has one or more locked blocks. ?A look at the panel will remind the dispatcher that another train has been routed to the main.

When a block becomes occupied, the logic removes the lock and "releases" the block so that "use alternate track color" is no longer active. ? When the block becomes unoccupied, it will now show the track color which informs the dispatcher that another route can be activated.

While it is certainly possible to use "geteUseExtraColor" as a block locking state, the lack of direct access from Logix makes it complicated. ?Adding logic to ManageBlocks2.py to set and clear a locking sensor would not be difficult but now logic and display actions have been mixed together.

BTW: ?ManageBlocks.py is obsolete and is replaced by ManageBlocks2.py. Until the JMRI install gets updated, it is available at?/g/jmriusers/files/ProblemsBeingWorkedOn/dsand//ManageBlocks2.py

Dave Sand


----- Original message -----
From: Iain <iain@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Saturday, May 09, 2020 6:07 AM

Dave,

Thanks for the advice. I had been using Sensors for everything - since up until now they were really only on/off states.? Clearly I need to store the state of the Block - but that can be evaluated either as a Sensor or a Memory and since setting the state is not going to trigger some other action (as a Sensor could) it is better to use a passive Memory rather than an active Sensor.

More thoughts for the design process. I am still considering the implications of process of "reserving" Blocks and tossing around ideas of the need to actually have a further state of "locked" after the signal is cleared and until the Block occupancy sensor has reset.? I certainly will need "normal" and "reserved" (reflected in thrie display colours).

Why do I need locked?? Is it to prevent interference after the route is fully evaluated and set, or is there another purpose?? If only the first I am not sure that my small layout really needs it.

If you have time to comment or point me at some JMRI or other documents please do.? Your help is always to the point and appreciated.

Thanks again,

Iain


 

Dave, yes I am using panel editor, I have a panel for each module each interlocking (there may be more than one interlocking per module) has one Logix which runs that interlocking. I transmit the status of the end of each module with an out memory, each end has an in memory which receives the next module status, from this the interlocking Logix decides if a route can be set and the aspect of signals.
There is one Logix which connects the panels it moves out memories to in memories on a time interval set by an internal turnout pulsing on and off. When the modular layout changes I only need to change the connections in that Logix. This means I can write a Logix for a new module, test it out then add it to the layout panel file which has all the panels, some have two panels to allow them to be either way around, we use Freemo so a module can be installed either way around. On the dispatchers screen I arrange the panels in the order of the modules, then the route can be selected across the modules, setting turnouts and signals.

My Logix is working similar to yours, when a route is selected it sets the track to yellow and a conflicting route cannot be set. A train entering a block sets the block to red, still blocking conflicts. Once the train leaves the block it reverts to grey and allows another route to be set.

Mike


David Parks
 

开云体育

Iain

?

I’m jumping in late so my post may be redundant with previous posts.? I have a fairly large layout with lots of automatic features.? ??I use only JMRI with no scripting. ?One of the features is track that changes color essentially as you describe.? I do this with Control Panel Editor (CPE) with Indicator Track and Warrants.? Warrants is intended for automatic train running which I do a lot of, but you can use Warrants for track color management without running the train.? As others have said, Layout Editor is basically a vector graphic track system and CPE is all Icons for track.? Unfortunately the two system’s track managements are not compatible.? If CPE is an option then Warrants track color management might work for you.

?

One of my current projects is designing the control system and operations management for a large layout not yet built.? I am using the Warrants for simulation to test signal logic and visually see future traffic patterns.? Various track colors are used for occupancy, reserved, automated train, shorted or error and out of service.? Conflicting roots are resolved via simulated signals.? In the project I am describing the signals are all virtual with JMRI’s built-in Rules.? There are no Logix or LRoutes except for initialization and feature selection management. ?LRoutes generates specialized Logix with simplified list logic.? Logix can be used to run a previously created Warrants, although the Warrant management features in Logix are thin.

?

I once experimented with track color management using the Shapes’ built-in Sensor feature to change the layer or visual effect.? I found this workable, but too cumbersome for track.? I use CPE Shapes, both visible and invisible to alter either the shapes appearance or the layering (1-10).? I use the shapes in combination with Icons with only one visible state and then stack multiple shapes and Icons to get the desired behavior.? I use this property of Shapes to enable or disable various graphical features for input or display on the control panels.

?

David Parks

Los Altos, CA

?


 

Dave Sands,

Thanks again for all your advice.? I had misunderstood you - I thought you had another "Locked" state for the block. I understood your example - my situation is different.? I have trains leaving a station through a set of throat turnouts and onto a main line.? Similar but different.

My Logix simulates an OCS (One Control Switch) Panel - there is one switch per route from any location, so one signal may cover many routes and hence have several swiches (in my case buttons) associated with it.

An example appears below:

? IX:AUTO:0060C2? Locking? ?
? ?Antecedent: R1 and R2 or R3 or R4 or R5 or R6 or R7 or R8??
? ? [x]? R1? IF? Sensor "RP1toM" state is "Sensor Active"? ?[ route control switch Platform 1 to Main Line
? ? [ ]? R2? ? AND Sensor "SRouteStarted" state is "Sensor Active"? ?[ Other Routing started
? ? [ ]? R3? ? OR Sensor "TA" state is "Sensor Inactive"? ?[Next signal box not redy
? ? [ ]? R4? ? OR Sensor "SinRset" state is "Sensor Active"? ?[ a Route is already set (now surplus to requirements and will be deleted)
? ? [ ]? R5? ? OR Sensor "SoutRset" state is "Sensor Active"? ?
? ? [ ]? R6? ? OR Memory "rBThroat" = value "1"? ?[ conflicting route test
? ? [ ]? R7? ? OR Memory "rBApproach" = value "1"? ?
? ? [ ]? R8? ? OR Sensor "SP1b" state is "Sensor Inactive"? ?[ no train available anyway!!!
? ? ? ? ? ? ?THEN? ?
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "RP1toM" to Inactive? ?
?
? IX:AUTO:0060C1? RP1toM? ?
? ? [x]? R1? IF? Conditional "Locking" state is "Conditional False"? ?[ safe to go ahead with route
? ? [x]? R2? ? AND Sensor "RP1toM" state is "Sensor Active"? ?[ and it hasn't been cancelled
? ? ? ? ? ? ?THEN? ?
? ? ? ? ? ? ? ?When Triggered True, Set Sensor, "SRouteStarted" to Active? ?[ block other routing whilst this one set
? ? ? ? ? ? ? ?When Triggered True, Set Sensor, "resetSignals" to Active? ?[ everything to danger
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Turnout, "Crossover" to Closed, after 1 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Turnout, "Throat2" to Closed, after 3 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Turnout, "Throat1" to Closed, after 4 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "SoutRset" to Active, after 5 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "SRouteLocked" to Active, after 5.5 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "setP1Sproceed" to Active, after 6 seconds.? ?[platform starter signal
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "RP1toM" to Inactive, after 6 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "SRouteStarted" to Inactive, after 9.6 seconds.? ?[ release routing
? ? ? ? ? ? ? ?When Triggered True, Set Memory, "rBlocks". to BThroat? BApproach.? ?[ reserve blocks
? ? ? ? ? ? ? ?When Triggered True, Set Memory, "rAction". to reserve.? ?
? ? ? ? ? ? ? ?When Triggered True, Run Script from file, preference:jython/ManageBlocks2.py.? ?

Which after a bit of debugging works as required.? Now when each block is passed through - becomes Active then Inactive - we need to "release" the Block so the colour goes from Red (Occupied colour) to normal - OR DO WE????? I wrote the Logix below just to test this on one Block.?

? IX:AUTO:0153C1? C1? ?
? ? [x]? R1? IF? Sensor "SThroat" state is "Sensor Inactive"? ?[this is on change of state
? ? ? ? ? ? ?THEN? ?
? ? ? ? ? ? ? ?On Change To True, Set Memory, "rBlocks". to BThroat.? ?
? ? ? ? ? ? ? ?On Change To True, Set Memory, "rAction". to release.? ?
? ? ? ? ? ? ? ?On Change To True, Run Script from file, preference:jython/ManageBlocks2.py.? ?
?
But blow me if the OTHER block in this - BApproch - on the SApproch Sensor going to Inactive came up coloured Dark-Grey as normal and NOT as I would have expected White because I had "reserved" it (set the bit which says use the alternate colour) but there was no code I had written to reverse that.? Is this an accidental side effect or an intended one - or a sheer fluke??? I haven't added code to the Logix to use the rBThroat/rBApproach Memories yet.

Anyway, what I wanted to do works, with that strange side effect.

If you do investigate please let me know the outcome.

Best wishes,

Iain.

?


 

David Parks,

Thanks for joining in.? It's always interesting to hear what others are doing - but in this case we are so far apart (not just in miles) that there is little to take from your experience because I am automating a British model using Layout Editor.? We don't do Warrants over here!

Best wishes,

Iain


 

Iain,

The ManageBlocks2.py script is run ONE TIME only.

I use the RTXINITIALIZER LRoute Logix to load the script after the panel xml file has been loaded. ?When the script runs, it "listens" for changes to rAction. ? When the change occurs, it looks at the other memory variables and performs the requested action.

The script does have logic to keep from having multiple listeners for the same object, but there is no reason to incur the overhead.

If you upload the latest version of your panel xml file to the group's ProblemsBeingWorkedOn Files folder I can review it.

Dave Sand


----- Original message -----
From: Iain <iain@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Sunday, May 10, 2020 10:47 AM

Dave Sands,

Thanks again for all your advice.? I had misunderstood you - I thought you had another "Locked" state for the block. I understood your example - my situation is different.? I have trains leaving a station through a set of throat turnouts and onto a main line.? Similar but different.

My Logix simulates an OCS (One Control Switch) Panel - there is one switch per route from any location, so one signal may cover many routes and hence have several swiches (in my case buttons) associated with it.

An example appears below:

? IX:AUTO:0060C2? Locking? ?
? ?Antecedent: R1 and R2 or R3 or R4 or R5 or R6 or R7 or R8??
? ? [x]? R1? IF? Sensor "RP1toM" state is "Sensor Active"? ?[ route control switch Platform 1 to Main Line
? ? [ ]? R2? ? AND Sensor "SRouteStarted" state is "Sensor Active"? ?[ Other Routing started
? ? [ ]? R3? ? OR Sensor "TA" state is "Sensor Inactive"? ?[Next signal box not redy
? ? [ ]? R4? ? OR Sensor "SinRset" state is "Sensor Active"? ?[ a Route is already set (now surplus to requirements and will be deleted)
? ? [ ]? R5? ? OR Sensor "SoutRset" state is "Sensor Active"? ?
? ? [ ]? R6? ? OR Memory "rBThroat" = value "1"? ?[ conflicting route test
? ? [ ]? R7? ? OR Memory "rBApproach" = value "1"? ?
? ? [ ]? R8? ? OR Sensor "SP1b" state is "Sensor Inactive"? ?[ no train available anyway!!!
? ? ? ? ? ? ?THEN? ?
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "RP1toM" to Inactive? ?
?
? IX:AUTO:0060C1? RP1toM? ?
? ? [x]? R1? IF? Conditional "Locking" state is "Conditional False"? ?[ safe to go ahead with route
? ? [x]? R2? ? AND Sensor "RP1toM" state is "Sensor Active"? ?[ and it hasn't been cancelled
? ? ? ? ? ? ?THEN? ?
? ? ? ? ? ? ? ?When Triggered True, Set Sensor, "SRouteStarted" to Active? ?[ block other routing whilst this one set
? ? ? ? ? ? ? ?When Triggered True, Set Sensor, "resetSignals" to Active? ?[ everything to danger
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Turnout, "Crossover" to Closed, after 1 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Turnout, "Throat2" to Closed, after 3 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Turnout, "Throat1" to Closed, after 4 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "SoutRset" to Active, after 5 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "SRouteLocked" to Active, after 5.5 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "setP1Sproceed" to Active, after 6 seconds.? ?[platform starter signal
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "RP1toM" to Inactive, after 6 seconds.? ?
? ? ? ? ? ? ? ?When Triggered True, Delayed Set Sensor, "SRouteStarted" to Inactive, after 9.6 seconds.? ?[ release routing
? ? ? ? ? ? ? ?When Triggered True, Set Memory, "rBlocks". to BThroat? BApproach.? ?[ reserve blocks
? ? ? ? ? ? ? ?When Triggered True, Set Memory, "rAction". to reserve.? ?
? ? ? ? ? ? ? ?When Triggered True, Run Script from file, preference:jython/ManageBlocks2.py.? ?

Which after a bit of debugging works as required.? Now when each block is passed through - becomes Active then Inactive - we need to "release" the Block so the colour goes from Red (Occupied colour) to normal - OR DO WE????? I wrote the Logix below just to test this on one Block.?


? IX:AUTO:0153C1? C1? ?
? ? [x]? R1? IF? Sensor "SThroat" state is "Sensor Inactive"? ?[this is on change of state
? ? ? ? ? ? ?THEN? ?
? ? ? ? ? ? ? ?On Change To True, Set Memory, "rBlocks". to BThroat.? ?
? ? ? ? ? ? ? ?On Change To True, Set Memory, "rAction". to release.? ?
? ? ? ? ? ? ? ?On Change To True, Run Script from file, preference:jython/ManageBlocks2.py.? ?
?
But blow me if the OTHER block in this - BApproch - on the SApproch Sensor going to Inactive came up coloured Dark-Grey as normal and NOT as I would have expected White because I had "reserved" it (set the bit which says use the alternate colour) but there was no code I had written to reverse that.? Is this an accidental side effect or an intended one - or a sheer fluke??? I haven't added code to the Logix to use the rBThroat/rBApproach Memories yet.

Anyway, what I wanted to do works, with that strange side effect.

If you do investigate please let me know the outcome.

Best wishes,

Iain.
?


 

Dave Sad,

Sorry I was such an idiot. A) you told me it only ran once then "listened" B) I read the code and saw that.

I have taken out the multiple calls (there were only 2 as I am testing using a single control switch) but the behaviour remains the same.? I am manually simulating the move from one Block to another until I get the layout set up (had to return a faulty AIU!).? So when the SThroat sensor is deactivated, the the released Block BThroat (Logix onSThroat) goes to Dark-Grey and its Memory rBThroat goes to 0 as there is code to DO that, but as there is no code to reverse it rBApproach remains at 1 as set in the RP1toM Logix BUT it also goes to the primary line colour Dark-Grey.

I think it unlikely that this is something in my Panel definition of Logix, but I have uploaded it for you as requested.

Iain


 

File moved to this folder:
/g/jmriusers/files/ProblemsBeingWorkedOn//Iain%20Tolmie

--
Peter Ulvestad

JMRI Users Group Moderator - ( )
Tam Valley Group Moderator - ( )
Sprog-DCC Group Moderator - ( )
Edmonton Model Railroad Association -


 

Iain,

Can you zip the?IconsSml directory and upload it also to the directory that Peter created for you?

Dave Sand



----- Original message -----
From: Iain <iain@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Sunday, May 10, 2020 11:57 AM

Dave Sad,

Sorry I was such an idiot. A) you told me it only ran once then "listened" B) I read the code and saw that.

I have taken out the multiple calls (there were only 2 as I am testing using a single control switch) but the behaviour remains the same.? I am manually simulating the move from one Block to another until I get the layout set up (had to return a faulty AIU!).? So when the SThroat sensor is deactivated, the the released Block BThroat (Logix onSThroat) goes to Dark-Grey and its Memory rBThroat goes to 0 as there is code to DO that, but as there is no code to reverse it rBApproach remains at 1 as set in the RP1toM Logix BUT it also goes to the primary line colour Dark-Grey.

I think it unlikely that this is something in my Panel definition of Logix, but I have uploaded it for you as requested.

Iain


 

Iain,

I missed Icons50. Maybe just do resources.

Dave Sand


----- Original message -----
From: Dave Sand <ds@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Sunday, May 10, 2020 12:15 PM

Iain,

Can you zip the?IconsSml directory and upload it also to the directory that Peter created for you?

Dave Sand



----- Original message -----
From: Iain <iain@...>
Subject: Re: [jmriusers] Displaying the "Alternative Track Colour" when using Logix (or Lroute or anything else that works)
Date: Sunday, May 10, 2020 11:57 AM

Dave Sad,

Sorry I was such an idiot. A) you told me it only ran once then "listened" B) I read the code and saw that.

I have taken out the multiple calls (there were only 2 as I am testing using a single control switch) but the behaviour remains the same.? I am manually simulating the move from one Block to another until I get the layout set up (had to return a faulty AIU!).? So when the SThroat sensor is deactivated, the the released Block BThroat (Logix onSThroat) goes to Dark-Grey and its Memory rBThroat goes to 0 as there is code to DO that, but as there is no code to reverse it rBApproach remains at 1 as set in the RP1toM Logix BUT it also goes to the primary line colour Dark-Grey.

I think it unlikely that this is something in my Panel definition of Logix, but I have uploaded it for you as requested.

Iain