¿ªÔÆÌåÓý

Date

Locked back up to another comuter #backup

 

I have my Decoder Pro and JMRI Operations on my laptop. As I was working on building a train my computer went off and would not come back up. We I had dislodged one end of the batter. Plugged in back into the laptop and everything is fine.?

In the mean time the scare of loosing my roster of locomotive decoder setting in Decoder Pro along with my car roster and layout locations. Really gave me a scare.?

So my question is: I want to back up everything to another computer. Can someone tel me how?
I would also use that computer to do the Operations program. Keep the lap top for programing decoders but still keep the back up of decoders on both machines.?


Locked Re: Raspberry Pi with DCC++ and PR3 Stand-alone LocoNet

 

Hi
ON a Pi, or most other Linux systems you can add a udev rule.
In?/etc/udev/rules.d? ?add a rule. Call it something like jmri.rules. It should/must finish with ".rules"

IN that file put
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="ff7e", ENV{ID_MM_CANDIDATE}="0",? KERNEL=="ttyACM*" SYMLINK+="tty.PR3"?
ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0043", ENV{ID_MM_CANDIDATE}="0",? KERNEL=="ttyACM*" SYMLINK+="tty.Arduino.uno"
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042", ENV{ID_MM_CANDIDATE}="0",? KERNEL=="ttyACM*" SYMLINK+="tty.Arduino.mega"
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fc1e", ENV{ID_MM_CANDIDATE}="0",? KERNEL=="ttyACM*" SYMLINK+="tty.Bachrus"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c7d0", ENV{ID_MM_CANDIDATE}="0",? KERNEL=="ttyUSB*" SYMLINK+="tty.LocoBuffer"

You can now set the connection to /dev/tty.PR3 and /dev/tty.Arduino.xxxxx etc. Then it doesnt matter where you plug it in.
If you dont want to mess with the udev rules you could also hack the prefernces file and point at /dev/serial/by-id/usb-Digitrax_Inc._VC0M_Port-if00 etc. But thats not quite as simple.
The rules file works for a single pr3 (or other digitrax usb) / arduino.uno etc. There are different rules if you have more than one pr3/4/etc, but then you have to be sure of the order, or be real sneaky.
You can also do some neat rules that will stop and start jmri-headless when you plug in or remove a device.

Steve G.



?


Locked Re: signal heads and masts

 

3) Finally there was a bug in the DCC++ code which was tagging an extra 0 byte on the end of the packet on the rails, so I corrected this.
Terry could you please elaborate on this? I am playing with SignalMasts over DCC decoder using NMRADCC library and can see the same very extra 0 at the end of extended accessory packet.


Locked Re: Digitrax programming and Track Power On (was JMRI 4.18 is available for download)

 

This issue has been address and resolved in Jenkins build 4.19.3,

Tested it on? LB-USB > DCS50 Zephyr?? and Track power remains off.
Tested it? on the Digitrax PR3 >DCS50 Zephyr ? and track power remains off.

Tested it on Digitrax PR3 in Standalone Programmer mode and track power remains off.

Marc


Locked Re: CATS: Where is new CATS Group? Was Moving objects on the designer panel #cats

 

Dave in Trempealeau this question is for you.? I searched but only found thousands of sites related to 4 legged cats.

Dave...in Colorado


Locked Re: Raspberry Pi with DCC++ and PR3 Stand-alone LocoNet

 

Solved.? Problem was with how the RPi assigns ports.? When only the DCC++ was connected it was assigned ttyACM0.? When two devices are connected the first one RPi recognizes is given port ttyACM0 and the second is ttyACM1.? When you plug in a 3rd device OR unplug a device and re-plug it that device will be given port ttyACM2, and so on.

So the RPi saw the port with the LocoNet first and assigned it port number ttyACM0.? I switched the ports in Preferences and the problem was solved.? This would make a great comment to add to JMRI help.

Ken, thanks for suggesting the ports issue.? BTW the defaults were correctly assigned to DCC++.


Locked Re: propertyChangeListener

 

Thanks everyone - I created a class called runTask? and called it with the standard invocation? runTask.start() as Bob suggested and it worked for me.

Billybob - sorry did not know about the developers group so will go take a look at that for future reference.?

class runTask(jmri.jmrit.automat.AbstractAutomaton) :
? ? ? def inti(self):
? ? ? ? ? return
? ? ? def handle(self):
? ? ? ? ?print(str(time.ctime())+" Run task runnning")
? ? ? ? ?time.sleep (15)
? ? ? ? ?print(str(time.ctime())+" Run Task finished")
? ? ? ? ?return
?


Locked Re: propertyChangeListener

 

James,

Your issue contains some deep programming issues and may not be of interest to the average jmriusers list member.

The jmri-developers.groups.io list is more programming-oriented, and is a better fit for your issue.

Regards,
Billybob


Locked Re: propertyChangeListener

 

Take a look at the jython/BackAndForth.py sample script. (In the JMRI distribution or here: )

It creates an indepedent thread via the AbstractAutomaton class, which handles those details. That then waits for sensors and commands a throttle.

For more:





Bob

On Jan 30, 2020, at 1:16 AM, James Anderson <james_anderson_999@...> wrote:

Hi, I have included a small cut down version of something I am trying to do.

I set up a propertyChangeLlistener for a sensor. When the sensor is activated it runs. I have simulated it running a long time just by putting a time.sleep in.
My problem is that when the se.setSate(ACTIVE) in the main function runs. It does not complete until the propertChangeListener completes.

Is there a way to have the propertyChageListener run without the main function waiting for it to complete.

I have looked at some of the documentation on threads but do not understand how to get this to work with jython.
I have used threading.Thread from the standard library start a thread running to do the long running task but this has some really strange behaviour and does not appear to run as thread but runs sequentially.

Some examples of why I want to do this is that when a sensor is activated I want to set a function key on the throttle a number of seconds later and not at the time the senor is activated or to start running some animation program on the layout that
could take some time.

Thanks jim.

Code
---------

import jmri
import java.beans
import time

class _SET_SENSOR(jmri.jmrit.automat.AbstractAutomaton) :

def init(self):
return


def handle(slef):
se=sensors.provideSensor("IStest")
se.addPropertyChangeListener(_LISTENER(), "IStest", "TCPDeviceMgr")
print(str(time.ctime())+" setting ACTIVE")
se.setState(ACTIVE)
print(str(time.ctime())+" setting INACTIVE")
se.setState(INACTIVE)
return


class _LISTENER(java.beans.PropertyChangeListener):
def propertyChange(self, event):
if event.newValue==2:
print(str(time.ctime())+" PropertyChange Activated...")
se=sensors.getSensor("IStest")
for oldListener in se.getPropertyChangeListenersByReference("IStest"):
if se.getListenerRef(oldListener) == "TCPDeviceMgr":
print(str(time.ctime())+" Removing old listner for sensor : IStest")
se.removePropertyChangeListener(oldListener)
time.sleep(15)
print(str(time.ctime())+" PropertyChange Complete")
return

test=_SET_SENSOR()
test.start()


OUTPUT from script
---------------------------
Thu Jan 30 08:48:24 2020 setting ACTIVE
Thu Jan 30 08:48:24 2020 PropertyChange Activated...
Thu Jan 30 08:48:24 2020 Removing old listner for sensor : IStest

--->>> 15 second gap for the time.sleep(15) inside the propertyChangeListener function.

Thu Jan 30 08:48:39 2020 PropertyChange Complete
Thu Jan 30 08:48:39 2020 setting INACTIVE

--
Bob Jacobsen
rgj1927@...


Locked Re: Errors moving from 4.14 to 4.18 #tables #merg

 

Thanks Steve, the main problem has been resolved, actually quite simple, I had a turnout MT+N0E9 as well as MT+N0E09, same for E6 and E7.
Checking the turnout table in 4.14 only showed N0E9 and not N0E09 and I guess the new address validation in 4.18 quite correctly picked up on this.
No idea why but could not delete the turnouts using the button in the table, clicking delete had no effect even though I had removed the signal heads associated with them, no error message, edited the XML and the panel now works with 4.18.

PT5/6T-11T-PT7C-PT8T-PT9T etc. are just user names, the system name follows the standard JMRI / MERG naming convention.
I use Logix to determine the state of the five turnouts, "PT5/6T-11T-PT7C-PT8T-PT9T"?will be Thrown if any of the turnouts are not set as required, setting PT5/6T-11T-PT7C-PT8T-PT9T to Closed changes the turnouts to the required position by sending a specific event e.g.+N0E103 which has been taught to each of the turnouts. Makes the Jython script a lot simpler, just one route to check and set.
I used Node 0 as I thought this was necessary as the event is produced by the PC / JMRI but since learnt that I could used any node number providing it was not a duplicate.

Thanks
Pete


Locked Re: 4.17.3ish and csvreader #scripting

Randall Wood
 

The release notes already cover how to use the old CSV API by linking into the documentation for setting JMRI parameters.

The draft release notes for 4.19.3 are at


Locked Re: Raspberry Pi with DCC++ and PR3 Stand-alone LocoNet

 

Dave,

You should do the test of watching /dev while plugging and unplugging the
devices. From the confused traffic, I would suspect that the picks might be
reversed for the ports. ttyACM1 and ttyACM0 may not be the device you think
it may be.

Make sure of which name shows up when you plug in the device.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


Locked Re: Raspberry Pi with DCC++ and PR3 Stand-alone LocoNet

 

Dave,

You might want to check the Edit->Preferences->Defaults, it may not have the
selections you think it should. It may have some things defaulting to the
LocoNet that should be on the DCC++.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


Locked Re: Raspberry Pi with DCC++ and PR3 Stand-alone LocoNet

 

One more thing, on the PR3 the green LED is mostly on and winks off and the red LED is on solid indicating no LocoNet signal.? So yesterday I unplugged the BDL and plugged a LocoNet cable from a DCS50 Zephyr into the PR3.? The red LED went out, but the problem in JMRI with Unknown throttle was still there.

Below is the info from the System Console:

2020-01-08 10:37:26,686 util.Log4JUtil? ? ? ? ? ? ? ? ? ? ? ? INFO? - * JMRI log ** [main]
2020-01-08 10:37:27,292 util.Log4JUtil? ? ? ? ? ? ? ? ? ? ? ? INFO? - This log is appended to file: /home/pi/.jmri/log/messages.log [main]
2020-01-08 10:37:27,296 util.Log4JUtil? ? ? ? ? ? ? ? ? ? ? ? INFO? - This log is appended to file: /home/pi/.jmri/log/session.log [main]
2020-01-08 10:37:27,448 apps.Apps? ? ? ? ? ? ? ? ? ? ? ? ? ? ?INFO? - PanelPro version 4.18+R37ad3d0 starts under Java 11.0.5 on Linux arm v4.19.75-v7+ at Wed Jan 08 10:37:27 EST 2020 [main]
2020-01-08 10:37:35,364 apps.Apps? ? ? ? ? ? ? ? ? ? ? ? ? ? ?INFO? - Starting with profile DCC.3f4cd52a [main]
2020-01-08 10:37:36,067 node.NodeIdentity? ? ? ? ? ? ? ? ? ? ?INFO? - Using c6f3cdb0-4677-11e9-8000-b827eb71f7dc as the JMRI storage identity for profile id 3f4cd52a [AWT-EventQueue-0]
2020-01-08 10:37:37,251 xml.AbstractSerialConnectionConfigXml INFO? - Starting to connect for "DCC++" [main]
2020-01-08 10:37:38,058 serial.DCCppAdapter? ? ? ? ? ? ? ? ? ?INFO? - ttyACM0 port opened at 115200 baud with DTR: true RTS: true DSR: false CTS: true? CD: false [main]
2020-01-08 10:37:43,267 jmrix.AbstractMRTrafficController? ? ?WARN? - Timeout on reply to message: s consecutive timeouts = 0 in serial.SerialDCCppPacketizer [serial.SerialDCCppPacketizer Transmit thread]
2020-01-08 10:37:48,471 xml.AbstractSerialConnectionConfigXml INFO? - Starting to connect for "LocoNet" [main]
2020-01-08 10:37:48,590 pr3.PR3Adapter? ? ? ? ? ? ? ? ? ? ? ? INFO? - PR3 adapter set hardware flow control, mode=2 RTSCTS_OUT=2 RTSCTS_IN=1 [main]
2020-01-08 10:37:48,596 locobuffer.LocoBufferAdapter? ? ? ? ? INFO? - ttyACM1 port opened at 57600 baud with DTR: true RTS: true DSR: false CTS: true? CD: false [main]
2020-01-08 10:37:48,855 loconet.LnPacketizer? ? ? ? ? ? ? ? ? INFO? - lnPacketizer Started [main]
2020-01-08 10:37:49,087 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 9B 9D [LocoNet receive handler]
2020-01-08 10:37:49,099 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,126 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: ee ended early. Expected length: 195 seen length: 2 unexpected byte: 9f [LocoNet receive handler]
2020-01-08 10:37:49,133 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 9F 9F [LocoNet receive handler]
2020-01-08 10:37:49,138 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,155 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: c2 ended early. Expected length: 6 seen length: 2 unexpected byte: e6 [LocoNet receive handler]
2020-01-08 10:37:49,164 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: e6 ended early. Expected length: 255 seen length: 2 unexpected byte: 8c [LocoNet receive handler]
2020-01-08 10:37:49,171 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 8C 10 [LocoNet receive handler]
2020-01-08 10:37:49,175 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,185 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: bd ended early. Expected length: 4 seen length: 2 unexpected byte: c8 [LocoNet receive handler]
2020-01-08 10:37:49,196 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: c8 ended early. Expected length: 6 seen length: 3 unexpected byte: b8 [LocoNet receive handler]
2020-01-08 10:37:49,205 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: B8 28 31 29 [LocoNet receive handler]
2020-01-08 10:37:49,209 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,225 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: c4 ended early. Expected length: 6 seen length: 5 unexpected byte: 80 [LocoNet receive handler]
2020-01-08 10:37:49,232 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 80 48 [LocoNet receive handler]
2020-01-08 10:37:49,237 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,247 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: c8 ended early. Expected length: 6 seen length: 2 unexpected byte: c8 [LocoNet receive handler]
2020-01-08 10:37:49,256 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: c8 ended early. Expected length: 6 seen length: 2 unexpected byte: c8 [LocoNet receive handler]
2020-01-08 10:37:49,271 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: C8 D6 08 48 08 0A [LocoNet receive handler]
2020-01-08 10:37:49,275 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,284 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 88 0E [LocoNet receive handler]
2020-01-08 10:37:49,288 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,299 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - LocoNet message with opCode: cc ended early. Expected length: 6 seen length: 2 unexpected byte: 8e [LocoNet receive handler]
2020-01-08 10:37:49,306 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 8E 06 [LocoNet receive handler]
2020-01-08 10:37:49,311 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:49,326 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - Ignore LocoNet packet with bad checksum: 9E D6 [LocoNet receive handler]
2020-01-08 10:37:49,331 loconet.LnPacketizer? ? ? ? ? ? ? ? ? WARN? - run: unexpected LocoNetMessageException: {} [LocoNet receive handler]
jmri.jmrix.loconet.LocoNetMessageException
at jmri.jmrix.loconet.LnPacketizer$RcvHandler.run(LnPacketizer.java:317)
at java.base/java.lang.Thread.run(Thread.java:834)
2020-01-08 10:37:52,776 withrottle.FacelessServer? ? ? ? ? ? ?INFO? - Published ZeroConf service for 'rpi-jmri dcc++._withrottle._tcp.local.' on 192.168.6.1:12090 [WiThrottleServer]
2020-01-08 10:37:52,782 withrottle.FacelessServer? ? ? ? ? ? ?INFO? - Creating new WiThrottle DeviceServer(socket) on port 12090, waiting for incoming connection... [WiThrottleServer]
2020-01-08 10:37:53,132 jmrix.AbstractMRTrafficController? ? ?WARN? - Timeout on reply to message: s consecutive timeouts = 1 in serial.SerialDCCppPacketizer [serial.SerialDCCppPacketizer Transmit thread]
2020-01-08 10:37:54,227 server.WebServer? ? ? ? ? ? ? ? ? ? ? INFO? - Starting Web Server on port 12080 [WebServer]
2020-01-08 10:37:57,244 simpleserver.SimpleServer? ? ? ? ? ? ?INFO? - JMRI SimpleServer started on port 2048 [AWT-EventQueue-0]
2020-01-08 10:37:57,267 util.FileUtilSupport? ? ? ? ? ? ? ? ? INFO? - File path program: is /home/pi/JMRI/ [main]
2020-01-08 10:37:57,272 util.FileUtilSupport? ? ? ? ? ? ? ? ? INFO? - File path preference: is /home/pi/JMRI_UserFiles/ [main]
2020-01-08 10:37:57,276 util.FileUtilSupport? ? ? ? ? ? ? ? ? INFO? - File path profile: is /home/pi/.jmri/DCC/ [main]
2020-01-08 10:37:57,281 util.FileUtilSupport? ? ? ? ? ? ? ? ? INFO? - File path settings: is /home/pi/.jmri/ [main]
2020-01-08 10:37:57,285 util.FileUtilSupport? ? ? ? ? ? ? ? ? INFO? - File path home: is /home/pi/ [main]
2020-01-08 10:37:57,288 util.FileUtilSupport? ? ? ? ? ? ? ? ? INFO? - File path scripts: is /home/pi/JMRI_UserFiles/jython/ [main]
2020-01-08 10:38:00,997 server.WebServer? ? ? ? ? ? ? ? ? ? ? INFO? - Starting ZeroConfService _http._tcp.local for Web Server with properties {path=/, json=5.2.0} [WebServer]
2020-01-08 10:38:02,813 PanelPro.PanelPro? ? ? ? ? ? ? ? ? ? ?INFO? - Main initialization done [main]
2020-01-08 10:38:05,859 jmrix.AbstractMRTrafficController? ? ?WARN? - Timeout on reply to message: 0 consecutive timeouts = 2 in serial.SerialDCCppPacketizer [serial.SerialDCCppPacketizer Transmit thread]
2020-01-08 10:38:10,865 jmrix.AbstractMRTrafficController? ? ?WARN? - Timeout on reply to message: 0 consecutive timeouts = 3 in serial.SerialDCCppPacketizer [serial.SerialDCCppPacketizer Transmit thread]
2020-01-08 10:38:18,275 jmrix.AbstractMRTrafficController? ? ?WARN? - Timeout on reply to message: 0 consecutive timeouts = 4 in serial.SerialDCCppPacketizer [serial.SerialDCCppPacketizer Transmit thread]
?


Locked propertyChangeListener

 

Hi, I have included a small cut down version of something I am trying to do.?

I set up a propertyChangeLlistener for a sensor. When the sensor is activated it runs. I have simulated it running a long time just by putting a time.sleep in.
My problem is that when the se.setSate(ACTIVE) in the main function runs. It does not complete until the propertChangeListener completes.

Is there a way to have the propertyChageListener run without the main function waiting for it to complete.

I have looked at some of the documentation on threads but do not understand how to get this to work with jython.
I have used threading.Thread from the standard library start a thread running to do the long running task but this has some really strange behaviour and does not appear to run as? thread but runs sequentially.?

Some examples of why I want to do this is that when a sensor is activated I want to set a function key on the throttle a number of seconds later and not at the time the senor is activated or to start running some animation program on the layout that
could take some time.?

Thanks jim.

?Code?
---------

import jmri
import java.beans
import time

class _SET_SENSOR(jmri.jmrit.automat.AbstractAutomaton) :

? ? def init(self):
? ? ? ? ?return

?

??? def handle(slef):
??????? se=sensors.provideSensor("IStest")
??????? se.addPropertyChangeListener(_LISTENER(), "IStest", "TCPDeviceMgr")
??????? print(str(time.ctime())+" setting ACTIVE")
??????? se.setState(ACTIVE)
??????? print(str(time.ctime())+" setting INACTIVE")
???? ???se.setState(INACTIVE)
??????? return

?

class _LISTENER(java.beans.PropertyChangeListener):
??? def propertyChange(self, event):
??????? if event.newValue==2:
?????????? print(str(time.ctime())+" PropertyChange Activated...")
?????????? se=sensors.getSensor("IStest")
?????????? for oldListener in se.getPropertyChangeListenersByReference("IStest"):
?????????????? if se.getListenerRef(oldListener) == "TCPDeviceMgr":
????????????????? print(str(time.ctime())+" Removing old listner for sensor : IStest")
????????????????? se.removePropertyChangeListener(oldListener)
?????????? time.sleep(15)
?????????? print(str(time.ctime())+" PropertyChange Complete")
??????? return

test=_SET_SENSOR()
test.start()

?

OUTPUT from script
---------------------------
Thu Jan 30 08:48:24 2020 setting ACTIVE
Thu Jan 30 08:48:24 2020 PropertyChange Activated...
Thu Jan 30 08:48:24 2020 Removing old listner for sensor : IStest

--->>> 15 second gap for the time.sleep(15) inside the propertyChangeListener function.

Thu Jan 30 08:48:39 2020 PropertyChange Complete
Thu Jan 30 08:48:39 2020 setting INACTIVE


Locked Re: help with creating xml decoderfile [solved]

 

Thanks for the help!

I created the Decoder File for the Digital Bahn WaLD Decoder and it works. So from now on, i can set up the interior lightning stripe with decoder right aut of jmri.
I think, i will upload the files to the projekt, so everyone can use them in future.


Locked Raspberry Pi with DCC++ and PR3 Stand-alone LocoNet

 

I have a small track that has been successfully running DCC++ connected to a Raspberry Pi currently running PanelPro 4.6.? I am attempting to add block detection using a BDL168 and PR3.? I use TightVNC on a laptop for programming the RPi.

First, the track was cut into 16 blocks with feeders thru the BDL and the train ran normally.? Next, BDL OpSw 12 was set to "t" to terminate the LocoNet, and track power from Rail A was connected to pin 6 on the LocoNet to provide a RailSync signal per the BDL manual.

Opened Preferences to add a second connection: Mfr - Digitrax; Connection - LocoNetPR3; Serial port - /dev/ttyACM1; Cmd station - Stand-alone LocoNet.? Saved and restarted.

The console window shows -?
Active profile: DCC++
DCC++: using DCC++ Serial port on /dev/ttyACM0
LocoNet: using LocoNet PR3 on /dev/ACM1

The track power button is stuck on "Unknown".? Removed and added the PR3 to Preferences a couple of times with the same results.? Tried Steve Todd's latest image v4.18 with the same results.

What am I missing?? Where do I look next.? It's probably something simple that I have overlooked.

Thanks for any help or suggestion you may be able to offer.

Dave


Locked Re: Working offline with version 14

 

John,

Yes, as long as the "User Files Location" for both profiles have the exact same file path. ?If you are also doing decoder programming, you want to make sure the "Roster Location" for each profile matches.

Use "Help >> Locations..." to see the current location information.

If you go to Preferences >> Config Profiles, at the bottom of the screen you can enable "Show profile selector". ?This makes it easy select the proper profile based on the layout connection state.

Dave Sand


----- Original message -----
From: John <gross144john@...>
Subject: Re: [jmriusers] Working offline with version 14
Date: Wednesday, January 29, 2020 9:22 PM

So, once a simulator protocol is created, I can move back and forth between online and offline mode without losing any of the programming that has been done as long as I switch to simulator mode when opening panel pro offline?

Thank you,

John

On Wed, Jan 29, 2020 at 5:10 PM Dave Sand <ds@...> wrote:

John,

When you want to work offline, you need to use a simulation profile.? For example, if you normally have an NCE connection, the simulation profile would use the NCE Simulator.? Most the connection types will have a simulation mode.

Since the simulation profile will have its own default location for panels and rosters, you will need to use Preferences >> File Locations to change the "User Files Location" to your regular location.


Dave Sand


----- Original message -----
From: John <gross144john@...>
Subject: [jmriusers] Working offline with version 14
Date: Wednesday, January 29, 2020 4:14 PM

Yesterday everything was working correctly: turnouts, sensors, signals, blocks. Today I tried to work offline. Everything in the tables was converted to internal devices. I tried opening some backups of the XML files and most, not all, of the devices were now missing from the tables and what was there was still internal. Offline work seems to be a mistake. Is there a way to recover from this mistake?

I am using windows 8 on an ASUS notebook.

Thanks,

John





 

CV163 to value 4 did the trick. Thank you to all who replied

now to fix that caboose LOL

On Wed, Jan 29, 2020 at 1:24 PM Dave Heap <dgheap@...> wrote:
David,

> On 29 Jan 2020, at 7:16 PM, David Epling <npdcctrains@...> wrote:
>
> Why does JMRI pick it up as a v5?

Because it must be a V5. As Michaelhas said,? Atlas obviously hasn't updated the manual.

Dave in Australia






--
David Epling
Nevada Pacific Custom Model Trains & Repair
Stockton CA


Locked Re: Working offline with version 14

John
 

So, once a simulator protocol is created, I can move back and forth between online and offline mode without losing any of the programming that has been done as long as I switch to simulator mode when opening panel pro offline?

Thank you,

John


On Wed, Jan 29, 2020 at 5:10 PM Dave Sand <ds@...> wrote:
John,

When you want to work offline, you need to use a simulation profile.? For example, if you normally have an NCE connection, the simulation profile would use the NCE Simulator.? Most the connection types will have a simulation mode.

Since the simulation profile will have its own default location for panels and rosters, you will need to use Preferences >> File Locations to change the "User Files Location" to your regular location.


Dave Sand


----- Original message -----
From: John <gross144john@...>
Subject: [jmriusers] Working offline with version 14
Date: Wednesday, January 29, 2020 4:14 PM

Yesterday everything was working correctly: turnouts, sensors, signals, blocks. Today I tried to work offline. Everything in the tables was converted to internal devices. I tried opening some backups of the XML files and most, not all, of the devices were now missing from the tables and what was there was still internal. Offline work seems to be a mistake. Is there a way to recover from this mistake?

I am using windows 8 on an ASUS notebook.

Thanks,

John