¿ªÔÆÌåÓý

Locked Speed Match Loop Script Help #scripting


 

File Location:?/g/jmriusers/files/ProblemsBeingWorkedOn//Speed%20Match%20Loop%20Problem


 

Steve,

The error you're seeing is due to this script using a deprecated (and now removed) way of manipulating the power to the layout, namely:

`jmri.InstanceManager.powerManagerInstance().setPower(jmri.PowerManager.OFF)`

becomes

`jmri.InstanceManager.getDefault(jmri.PowerManager).setPower(jmri.PowerManager.OFF)`

I've modified the file to the new way, and uploaded it to:

/g/jmriusers/files/ProblemsBeingWorkedOn/Speed%20Match%20Loop%20Problem/USpeedMatch_v1.3.2.py

Hopefully that helps you further.

Best regards,

Matt H?


 

Thanks Matt, I might be over my head on this one.? It kicked out another Error.? I believe it applies to all the CV changes. If anyone knows how to get this error to clear I can apply those changes to future ones. (I Hope)
Thanks For Looking at this
Steve N.


i2019-12-05 07:51:58,259 sprog.SprogCommandStation? ? ? ? ? ? ?INFO? - Changing currentSprogAddress (for pseudo-idle packets) to 1(L) [Automated Speed Table]
2019-12-05 07:51:58,811 automat.AbstractAutomaton? ? ? ? ? ? ?WARN? - Unexpected Exception ends AbstractAutomaton thread [Automated Speed Table]
Traceback (most recent call last):
? File "<script>", line 516, in handle
TypeError: writeCV(): 1st arg can't be coerced to String
?
at org.python.core.Py.TypeError(Py.java:259)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:209)
at org.python.core.PyReflectedFunction.throwBadArgError(PyReflectedFunction.java:312)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:321)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:167)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
at org.python.core.PyObject.__call__(PyObject.java:515)
at org.python.core.PyObject.__call__(PyObject.java:521)
at org.python.core.PyMethod.__call__(PyMethod.java:171)
at org.python.pycode._pyx0.handle$5(<script>:974)
at org.python.pycode._pyx0.call_function(<script>)
at org.python.core.PyTableCode.call(PyTableCode.java:167)
at org.python.core.PyBaseCode.call(PyBaseCode.java:307)
at org.python.core.PyBaseCode.call(PyBaseCode.java:198)
at org.python.core.PyFunction.__call__(PyFunction.java:482)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
at org.python.core.PyMethod.__call__(PyMethod.java:228)
at org.python.core.PyMethod.__call__(PyMethod.java:218)
at org.python.core.PyMethod.__call__(PyMethod.java:213)
at org.python.core.PyObject._jcallexc(PyObject.java:3626)
at org.python.core.PyObject._jcall(PyObject.java:3658)
at org.python.proxies.__builtin__$AutoSpeedTable$0.handle(Unknown Source)
at jmri.jmrit.automat.AbstractAutomaton.run(AbstractAutomaton.java:150)
at java.base/java.lang.Thread.run(Thread.java:834)
?


 

Steve,

This has tripped over another method deprecation - this time, the now outdated form of writing to CVs as numerical values (this change was needed to support so-called indexed CVs in many newer decoders).

I've changed the file and uploaded a new version:

/g/jmriusers/files/ProblemsBeingWorkedOn/Speed%20Match%20Loop%20Problem/USpeedMatch_v1.3.3.py

Let's hope that works better for you.

Best regards,

Matt H


 

Thanks. It is up and running now. Im going to try to tweak a couple of things. Ie file output and add credit to you in the notes and reupload over ne next couple of days. Thanks again!

Steve N.


 

Matthew i have some questions about this, i have built a board and i ran your script on jmri version 4.16 but at the end of 15 minutes the loco stops and there is a warn that pops up about the throttle. It doesn't give you the CV speed table either.
I have a Zepher DCS52 BDL168 and a USB Locobuffer.

I also have a Sprog Pi id like to use on the board.
Thanks in advance!