¿ªÔÆÌåÓý

Date

Locked Re: Cannot operate turnouts from Layout #layouteditor

 

Premis: I do not have a Tam Valley booster.

Open the turnout table, then change one turnout with the throttle and watch if the table changes for that turnout. If it does, then click the Close/Thrown button and see if the turnout throws. If yes, the definition of the icon needs to change. If not, the problem may be with the Tam Valley boster and how it is known? by JMRI via the NCE station.?

Leo P

On Tue, Dec 24, 2019, 4:25 PM WHurry <Wttr@...> wrote:

System consists of Power House Pro-R, PB5, and a stand-alone Loconet.

To unload the PB5 booster, I installed a Tam Valley accessory booster to power the turnout Tortoise machines.? Upon power up of the layout including the Tam Valley accessory booster, operation of the layout was normal. ?

The PB5 booster load was reduced as expected.? I can operate the turnouts via the throttle as well as the local push buttons.? The changes made to the turnouts via these two methods (throttle and local push buttons) were properly indicated the layout panel.?

As a loco travelled on the layout, the block occupancy was being properly indicated.

However, I can no longer operate the turnouts by clicking on the turnout icons.

What do I need to do to recover turnout operation via the layout turnout icons?

Merry Christmas

Bill R


Locked Cannot operate turnouts from Layout #layouteditor

 

System consists of Power House Pro-R, PB5, and a stand-alone Loconet.

To unload the PB5 booster, I installed a Tam Valley accessory booster to power the turnout Tortoise machines. ?Upon power up of the layout including the Tam Valley accessory booster, operation of the layout was normal. ?

The PB5 booster load was reduced as expected. ?I can operate the turnouts via the throttle as well as the local push buttons. ?The changes made to the turnouts via these two methods (throttle and local push buttons) were properly indicated the layout panel.?

As a loco travelled on the layout, the block occupancy was being properly indicated.

However, I can no longer operate the turnouts by clicking on the turnout icons.

What do I need to do to recover turnout operation via the layout turnout icons?

Merry Christmas

Bill R


Locked Re: Running a python script in JMRI #scripting

 

Tim,

I see where you are now.....? This is a good undertaking.....

Inobu


Locked Re: Running a python script in JMRI #scripting

 

Hi all

this is what Iv'e ended up at:

# Simple script to setup audio objects

import time
import jmri

from javax.vecmath import Vector3f
fileorder=[5, 4, 1, 3, 7, 6, 0, 0, 0, 0]
filetime = {5: 2.6, 4: 0.5, 1: 0.6, 3: 0.8, 2: 1.4, 6: 1.5, 7:1.5}
for plloop in range(0, len(fileorder)):
??? filechk = fileorder[plloop]
??? if filechk != 0:
??????? # Create the first Audio Source object
??????? filepointer = "IAS" + str(fileorder[plloop])
??????? source1 = audio.provideAudio(filepointer)
?
??????? # Assign Audio Buffer to this Audio Source
??????? filepointer = "IAB" + str(fileorder[plloop])
??????? source1.setAssignedBuffer(filepointer)
???????
??????? # Start playing the first Audio Source
??????? source1.play()
??? print
??????? delay = filetime[fileorder[plloop]]
??? print(delay)
??????? time.sleep(delay)

it requires the manual loading of audio files into the JMRI audio buffers, when the script is then run it reads the file order list which is easily set with software sets up the audio source and buffers and then starts playing the files. the delay between one file and the next is set in the dictionary entry. Again these values have been manually arrived at.

So in theory once all the sound files are loaded in the buffers and timings determined for the dictionary it will work.

comments appreciated as to any methods of loading the files from the sound directory automatically and determining their lengths would be helpful?


Tim


Locked Need help with script update #scripting

 

Hi all,
There appears to be a script change to the "ReporterFormatter.py" script that I a wondering if it affects the "ReporterOperations.py" script. I have a custom script based on the ReporterOperations one and it is now throwing an error:

2019-12-24 11:08:13,549 jython.RunJythonScript??????????????? INFO? - No file selected [AWT-EventQueue-0]
2019-12-24 11:08:36,646 jmrix.AbstractMRTrafficController???? WARN? - notify: During reply dispatch to jmri.jmrix.rfid.merg.concentrator.ConcentratorReporterManager@54c62d71 [AWT-EventQueue-0]
Traceback (most recent call last):
? File "<script>", line 34, in propertyChange
? File "<script>", line 83, in format
AttributeError: 'unicode' object has no attribute 'toString'

??? at org.python.core.Py.AttributeError(Py.java:207)
??? at org.python.core.PyObject.noAttributeError(PyObject.java:1032)
??? at org.python.core.PyObject.__getattr__(PyObject.java:1027)
??? at org.python.pycode._pyx4.format$5(<script>:109)
??? at org.python.pycode._pyx4.call_function(<script>)
??? at org.python.core.PyTableCode.call(PyTableCode.java:171)
??? at org.python.core.PyBaseCode.call(PyBaseCode.java:154)
??? at org.python.core.PyFunction.__call__(PyFunction.java:423)
??? at org.python.core.PyMethod.__call__(PyMethod.java:141)
??? at org.python.pycode._pyx4.propertyChange$2(<script>:44)
??? at org.python.pycode._pyx4.call_function(<script>)
??? at org.python.core.PyTableCode.call(PyTableCode.java:171)
??? at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
??? at org.python.core.PyBaseCode.call(PyBaseCode.java:199)
??? 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:3644)
??? at org.python.core.PyObject._jcall(PyObject.java:3676)
??? at org.python.proxies.__builtin__$ReporterOperations$2.propertyChange(Unknown Source)
??? at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
??? at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
??? at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
??? at jmri.implementation.AbstractNamedBean.firePropertyChange(AbstractNamedBean.java:289)
??? at jmri.implementation.AbstractReporter.setReport(AbstractReporter.java:61)
??? at jmri.implementation.AbstractIdTagReporter.notify(AbstractIdTagReporter.java:54)
??? at jmri.jmrix.rfid.TimeoutRfidReporter.notify(TimeoutRfidReporter.java:59)
??? at jmri.jmrix.rfid.merg.concentrator.ConcentratorReporterManager.processReply(ConcentratorReporterManager.java:79)
??? at jmri.jmrix.rfid.merg.concentrator.ConcentratorReporterManager.reply(ConcentratorReporterManager.java:64)
??? at jmri.jmrix.rfid.RfidTrafficController.forwardReply(RfidTrafficController.java:93)
??? at jmri.jmrix.AbstractMRTrafficController.notifyReply(AbstractMRTrafficController.java:284)
??? at jmri.jmrix.AbstractMRTrafficController$RcvNotifier.run(AbstractMRTrafficController.java:1226)
??? at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
??? at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
??? at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
??? at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
??? at java.base/java.security.AccessController.doPrivileged(Native Method)
??? at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
??? at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
??? at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
??? at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
??? at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
??? at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
??? at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
??? at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

I tried copying over the different code in the ReporterFormatter but I still get the same error.

Regards,

Allen


Locked Re: Running a python script in JMRI #scripting

 

Hi Bob
the idea is that the sound changes for each different type of train, option one is to get the software to do it on the fly so to speak. Option 2 is to have several audio files for each engine train. as there are loads of combinations you can appreciate the storage involved. hence the reason for trying to get software to do it on the fly.

Tim


Locked Re: Running a python script in JMRI #scripting

 

Hi Matt

this is what I have so far.
?Simple script to setup audio objects

import time
import jmri

from javax.vecmath import Vector3f

fileorder = [5, 4, 1, 3, 2, 6, 0, 0, 0, 0]
for plloop in range(0, len(fileorder)):
??? filechk = fileorder[plloop]
??? if filechk != 0:
??????? # Create the first Audio Source object
??????? filepointer = "IAS" + str(fileorder[plloop])
??????? source1 = audio.provideAudio(filepointer)
?
??????? # Assign Audio Buffer to this Audio Source
??????? filepointer = "IAB" + str(fileorder[plloop])
??????? source1.setAssignedBuffer(filepointer)
???????
??????? # Start playing the first Audio Source
??????? source1.play()
??????? #state = source1.getState()
??? #while state == True :
?????????? # print("state")
??????? time.sleep(1.5)

What I now need is a way to find out when i file stops so I can play the next ?

Tim


Locked Re: id tags not found error though they seem to be there

 

¿ªÔÆÌåÓý




On Dec 23, 2019, at 5:33 AM, Randall Wood via Groups.Io <rhwood@...> wrote:

Routes predate Reporters in JMRI, and have always had the type letter 'R', so maybe its Reporters that should have a different letter.


Hmmm... I had to go back and look... the first Route implementation was introduced on June 11,2004. ?The first reporter was July 18, 2004, so yes, routes predate reporters, but only by 5 weeks.... which really means that they came about at the same time, in the grand scheme of things. ?( our release schedule wasn¡¯t the same as it is now, it would take some more digging to verify if they were introduced in the same release version or in two different, but successive, ones... )

Paul


Locked Re: id tags not found error though they seem to be there

 

On Dec 23, 2019, at 10:52 AM, ahouse3761 <trainmail1@...> wrote:
I tried opening the Id Tag table first then the Cars window to no effect. Still no tag id in the drop down. Same error list in the console. The console list is showing errors for valid id tags.
Ok, I will look at this when I get a chance.

Pau


Locked Re: Running a python script in JMRI #scripting

 

Inobu,
It helped me, thanks.
--
Mike Heintzman
Modeling the P&PU since 1953


Locked Re: Setting up routes #routes

 

Wayne,
I can't tell from your post if you use JMRI or not. If you use JMRI, setting up routes is much much easier than if you have to use the Digitrax throttle to do it. The DS64 manual has a copy of a worksheet in it that is helpful is mapping the routes out. The DS64 will allow 8 routes, but there is?something you need to be aware of if you aren't already. Route number 1, also know as the top route, can cause issues if you don't know how it works. The 1st route turnout number becomes the route number of each route. If turnout 50 is the first turnout in the route 1 position?in the DS64, then the route number is?50. This is where a problem can occur.
IF EACH TURNOUT NUMBER IN?THE ROUTE 1 POSITION? OF ALL THE DS64'S IS DIFFERENT, THEN YOU SHOULD NOT HAVE A PROBLEM. BUT, IF THE TURNOUT NUMBER OF THE TURNOUT IN THE TOP, OR 1ST ROUTE POSITION IS THE SAME ON MORE THAN ONE DS64, THIS WILL CAUSE A PROBLEM.
If turnout 50 is the top or 1st turnout on more than one route, then each time a route is selected that 50 is the top turnout, then EVERY route that has 50 in the top position will try and throw. From my experience one of two things will happen, multiple routes will throw or the Loconet will be flooded with commands.
The simplest way to keep this from happening is to use a DIFFERENT virtual turnout number in the top position of every route. The downside to this is that now you only have 7 routes that you can use rather than 8.
I hope I haven't confused you with this, but it cost me a lot of time before I figured it out.
Clay Smith


Locked JMRI 4.18 is available for download #4-18

 

Production version 4.18 of JMRI/DecoderPro is available for download.

This is a new production release containing changes since last July.

If you are currently using JMRI 4.9.6 or earlier, we strongly recommend that you first update to JMRI 4.12 and make sure that's running OK before updating to this release. There have been a number of changes in serial port support, panel file format and configuration options since those earlier releases, and moving to the stable JMRI 4.12 release is a good way to work through any possible problems.
<>
(In the future, we¡¯ll probably saying that about this one too)

If you use JMRI on Linux or Mac and are updating from JMRI 4.7.3 or earlier, there¡¯s a necessary migration step. (Not needed on Windows) Please see the JMRI 4.12 release note for details: <>

For more information on the issues, new features and bug fixes in 4.18 please see the release note:
<>

Note that JMRI is made available under the GNU General Public License. For more information, please see our copyright and licensing page.
<>

The download links, along with lots of other information which we hope you'll read, can be found on the release note page:
<>

Bob
--
Bob Jacobsen
rgj1927@...


Locked Re: Running a python script in JMRI #scripting

 

Could you do the combining separately, in an audio editor, to create a new wav file outside JMRI? Then, at the appropriate time, just select that file and play it.

Bob

On Dec 23, 2019, at 10:53 PM, tim_p1964@... wrote:

Thanks for the replies. i have previously tried adding import JMRI and import java, makes no difference. the premise for the script is that i want to be able to combine various short wave files into one so as to be able to play the one file as a train arrival announcement. e.g. "the train arriving"+"at platform 1"+ "is the" etc etc.which files would depend on which train etc etc. whilst i can do the logic and read the sensors and block values. I can also play the wav file from within JMRI. what i cant do is get the combine wav script to run in jmri.
--
Bob Jacobsen
rgj1927@...


Locked Re: Running a python script in JMRI #scripting

 

Hi Matt

was just contemplating that way around the issue, there would i say be around a max of 8 files all very small in size wav files, I can add all the files to the JMRI audio buffers and play them using a script but when i try to combine or get them to follow one another they all play together???
i am thinking of a script that could read a list of file indicators indicating which files to play in which order determined by the rest of the program just need to find the command? to check when one file has finished and play the next file.
Tim


Locked Display throttle panel/frame from script

 

Hi, having issued a self.getThrottle is there a way to cause the throttle to be visible from a script.

Thanks Jim.


Locked Re: Running a python script in JMRI #scripting

 

Tim,

I'll need to take a closer look, but you might be able to achieve what you're after by using the queueAudioBuffer method available within the Audio framework in JMRI.

In essence, you would load each file segment into JMRI as AudioBuffer objects then queue then accordingly based upon your logic to a suitable configured AudioSource and then play the sequence.

This removes the need to mash together individual fragments into a single wav file, rather queues each segment one after the other and plays in order.

Roughly how many individual sound segments are we talking about?

Best regards,

Matt H


Locked Re: Running a python script in JMRI #scripting

Randall Wood
 

Some notes about scripting in JMRI:

  • JMRI does not support Python C, the Python variant that ships with most Linux distributions
  • JMRI supports Jython, a Python variant that runs inside a Java Virtual Machine (JVM)
  • The JMRI version of Jython is 2.7.1, supporting the Python 2.7 language
  • Any Python library that relies on native C code, or is written for Python 3, will not work within JMRI


Locked Re: Running a python script in JMRI #scripting

 

Hi

The issue is not the playing of the Wav file from JMRI when a sensor is triggered, this I can do. the issue is that of having several wav files that are selected and combined depending on the value of the memory in the block section that the sensor is attached to, and other vales such as turnouts.? That is what the script is supposed to do. eg combining the following, "the train"+"approaching"+"platform 1" +"is the"+"10:42"+"virgin trains"+"service to"+"London Paddington" to give " the train approaching platform1 is the 10:42 virgin trains service to london paddington"

so as a train triggers the sensor the logic works out what train it is and which platform depending on the sensors and turnouts and produces the correct sound file. all trains have unique rfid tags that JMRI stores in the memory of the block as the train moves from block to block.

Tim


Locked Re: Running a python script in JMRI #scripting

 

TIm,

Create SensndExample_1.py file from the test code below the ** , save it in your directory C:/Users/tim_p/sounds/Peter/

In Panel Pro, Panel, select Run Script - go to the Peter directory and run the SensndExample_1.py. Python is now running in the background.
Go to Tools, Table Sensor and create sensor 473 in my case I used LS473


When its created just click the active button and listen. Click the inactive button it silent.
In the if statement you can see where the playback is in a loop via the...... snd.loop() command. that the active/inactive states are registered.?

Now you can replace the "Crossing.wav" with your General01.wav and link the sensor representing the station. Step by step you can get this going.

I can believe how much time I wasted on an indentation issue in the original file. When you posted up your log I thought duh!!? Looked at the log and found the dent space, the file worked.?

It would be crazy to do the coding outside of JMRI when its already done. Thanks for the question as it got me to do something I should have done long time ago. ? ?

Inobu
*

?? # It listens for changes to a sensor,
# and then plays a sound file when sensor active

import jarray
import jmri

# create the sound object by loading a file
snd = jmri.jmrit.Sound("resources/sounds/Crossing.wav")

class SensndExample(jmri.jmrit.automat.Siglet) :

??????? # Modify this to define all of your turnouts, sensors and
??????? # signal heads.
??????? def defineIO(self):
???????????????
??????????????? # get the sensor
??????????????? self.Sen1Sensor = sensors.provideSensor("LS473")
???????????????????????????????
??????????????? # Register the inputs so setOutput will be called when needed.
??????????????? self.setInputs(jarray.array([self.Sen1Sensor], jmri.NamedBean))

??????????????? return

??????? # setOutput is called when one of the inputs changes, and is
??????? # responsible for setting the correct output
??????? #
??????? # Modify this to do your calculation.
??????? def setOutput(self):
???????????????????????????????
??????????????? if self.Sen1Sensor.knownState==INACTIVE:
??????????????????????? snd.stop()
??????????????? elif self.Sen1Sensor.knownState==ACTIVE:
??????????????????????? snd.loop()
???????????????
??????????????? return
???????
# end of class definition

# start one of these up
SensndExample().start()


Locked Re: Decoder Pro not seeing Power Cab #nce #powercab

 

Andrew,

On 24 Dec 2019, at 3:50 PM, andrew.woolman <apwool@...> wrote:

Well, new USB interface arrived today. Given that everything is already installed and working on the computer, should I just be able to swap it in and go, or do I need to re-install driver?
No need to reinstall and it's almost certain that port will stay at cu.SLAB_USBtoUART, so just give it a try.

But system console is your friend...

If you get the same symptoms, you've ruled out the NCE USB as the cause :(

Dave in Australia