开云体育

Re: Changing signal Mast Aspect with jython #jython #signalheads


 

On 3/19/2025 9:28 PM, Canadian Locomotive Logistics via groups.io wrote:
Here is a list of signal mast i have set up
does anyone have the syntax for jython to change the aspect of the signal.
i’m not finding it anywhere.
See JMRI's SignalMastFollower.py script. It uses:

self.outSignal.setAspect(self.inSignal.getAspect())

This is what that script needs to do to make one signal mast reflect another signal mast's aspect. There are a number of requirements that make this a usable solution. One limitation is that the signal referred to in "self.outSignal" does NOT implement Signal Mast Logic!

One can instead allow a script to "selectively-override" a mast's SML-defined Aspect information. One can implement Signal Mast Logic for the signal mast, and implement a "listener" to trigger a script bit that can determine when the aspect is not appropriate, and "override" the Aspect.

Note that the mast might possibly show the original Aspect, briefly before showing the "overridden" Aspect.

To avoid this, one _could_ implement something more like a "signalMastFollower.py" script, with optional Aspect-overriding, and displaying the overridden Aspect on the physical mast. This would probably not be appropriate for any kind of JMRI "automation", though, unless your automation mechanism does not rely on the overridden Aspect, or unless some other "hack" is used.

(It _might_ be appropriate to create a new "signal mast" type for the "Prototype Signaling System", rather than hacking a Jython script, though! That might be a better solution than hacking the Aspect via Jython...)

Join [email protected] to automatically receive all group messages.