Re: Losing occupancy when trying to record a warrant #warrants

 

Bob,
Also try recording a warrant that doesn't include this block.
Supposedly an NX Warrant doesn't need a block to have detection as it allows 'Dark' blocks. That would mean if the block had an issue then it mightn't register as a problem.
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.10 DecoderPro/Warrants/CPE/SML/LogixNG
Java: OpenLogic jre-17.0.12.7 Windows 10


Re: Script does not Print to System Console on Linux laptop #scripting

 

Thanks again Dave for continuing help. I have never used the Scripting/Scripting Output option, but now that I've found it and opened it, I see all my print results. I guess I can use that rather than, or in addition to, the System Console.
I don't not know what is different now but this will allow me to bumble my way through scripts by giving me the information I print during development.
Phil


Re: Audio Icon on Web Panel - Java

 

> I had to comment-out audioIcon.play() because it caused an error.

What error? If you don't call play(), you don't play the audio.

Daniel


On 2025-05-16 22:14, Vinny DeRobertis via groups.io wrote:

Yes, NY&HV_RR_Yard_Scenes is the name of the panel and Harbor is the ID assigned to the Audio object.
I had to comment-out audioIcon.play() because it caused an error.
Running it now generates no errors but it does not play the audio.


Re: Audio Icon on Web Panel - Java

 

Yes, NY&HV_RR_Yard_Scenes is the name of the panel and Harbor is the ID assigned to the Audio object.
I had to comment-out audioIcon.play() because it caused an error.
Running it now generates no errors but it does not play the audio.


Re: Script does not Print to System Console on Linux laptop #scripting

 

Phil,

If you want script "print output" to go to the system console, do not open the "Script Output" window. Don't use the "Scripting -> Script Output" menu or a "Preferences -> Start Up" action.

The default for Jython print statements is to write them to the system console. If the Script Output window has been opened, then the print statements are redirected to the Script Output window.

You don't need to do anything else.


Dave Sand



----- Original message -----
From: "Phil in gorgeous Young Harris via groups.io" <philabernathy=[email protected]>
Subject: Re: [jmriusers] Script does not Print to System Console on Linux laptop
Date: Friday, May 16, 2025 2:43 PM

On Thu, May 15, 2025 at 10:47 PM, Dave Sand wrote:
If Script Output is NOT open, print output goes to the system console.
Dave Sand
Thanks Dave and Cliff for responding.
However, how do I close Script Output? I looked at the link and at default_lcf.xml, but it appears to be above my pay grade, with no explicit verbiage to turn on or off logging to the console.
Phil
LoggingTest.py output is here, then I loaded my panel and it ran a script to change sensors to Inactive:
15:33:20,563 LoggingTest.py WARN - This WARN is OK, it's emitted from LoggingTest.py on purpose [AWT-EventQueue-0]
15:33:59,634 jmri.configurexml.LoadXmlConfigAction INFO - Loading selected file: /home/phil/Railroad/MQTT/MQTT-ESP32Config-2025-05-16-0849.xml [AWT-EventQueue-0]
28 total sensors found, all 28 changed to INACTIVE


Re: Audio Icon on Web Panel - Java

 

Vinny,

I'm not sure, but I think you should remove ".class".

editor = jmri.InstanceManager.getDefault(jmri.jmrit.display.EditorManager).getByName("NY&HV_RR_Yard_Scenes")

Is "NY&HV_RR_Yard_Scenes" the name of the panel? If so, you need " around it. See above.

Daniel

On 2025-05-16 21:15, Vinny DeRobertis via groups.io wrote:

Ok. Attached .py adapted from Daniel's Java code based on Dave Sand's comments. When I run it, it throws an exception
From System Console:
AttributeError: instance attr: class
?


Re: Script does not Print to System Console on Linux laptop #scripting

 

On Thu, May 15, 2025 at 10:47 PM, Dave Sand wrote:
If Script Output is NOT open, print output goes to the system console.
Dave Sand
Thanks Dave and Cliff for responding.
However, how do I close Script Output? I looked at the link and at default_lcf.xml, but it appears to be above my pay grade, with no explicit verbiage to turn on or off logging to the console.
Phil
LoggingTest.py output is here, then I loaded my panel and it ran a script to change sensors to Inactive:
15:33:20,563 LoggingTest.py WARN - This WARN is OK, it's emitted from LoggingTest.py on purpose [AWT-EventQueue-0]
15:33:59,634 jmri.configurexml.LoadXmlConfigAction INFO - Loading selected file: /home/phil/Railroad/MQTT/MQTT-ESP32Config-2025-05-16-0849.xml [AWT-EventQueue-0]
28 total sensors found, all 28 changed to INACTIVE


Re: Audio Icon on Web Panel - Java

 

Ok. Attached .py adapted from Daniel's Java code based on Dave Sand's comments. When I run it, it throws an exception
From System Console:
AttributeError: instance attr: class
?


Re: Startup Gets Stuck #startup

 

Here I am again. I uninstalled and reinstalled Java 17 : 64 bit using the link - thanks. I then restarted my laptop and ran DecoderPro. The only response was the JMRI Monopoly splash screen and the DecoderPro icon on the taskbar. So, I ran InstallTest and got the three screens shown in the attached photos. Any ideas on why JMRI won't open?
--
Richard Richter


Re: Associating an init script with a panel file?

 

OK, that worked.

At Fri, 16 May 2025 11:36:37 -0500 [email protected] wrote:


Robert,

If you are loading the xml file with a "Preferences -> Startup" action, you can also use a startup action to run the script.

The other approach is to use Logix or LogixNG to run the script. Here is a simple LogixNG.
Because the Startup option is enabled, the ConditonalNG will run after the file loading is done.

Dave Sand


----- Original message -----
From: "Robert Heller via groups.io" <hellere[email protected]>
To: JMRI Users <[email protected]>
Subject: [jmriusers] Associating an init script with a panel file?
Date: Friday, May 16, 2025 11:25 AM

I have a panel file
()
that I have written an init script (it just initializes the internal sensors
to a sane set of states).

Is there some way to run this script when the panel file is loaded?

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
-- Linux Administration Services
heller@... -- Webhosting Services












--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
-- Linux Administration Services
heller@... -- Webhosting Services


Re: Associating an init script with a panel file?

 

The simplest way I’ve created a way to have something start with the panel load is a LRoute. Pick the type: Initializer. Then have it do whatever you want.

-Ken Cameron, Member JMRI Dev Team


Re: How do I hook up a bar code reader to JMRI

 

Bob,
I ran the program yesterday at baud=19200; I thought I had changed that to 9600. When I ran again today with baud=9600 it worked. Yeah!
--
Ready to process
past next = self.inputStream.read()
(0, '')
(1, '0')
(2, '01')
(3, '017')
past values = self.parse(self.line)
['0175']
past count = self.inputStream.available()
at return 1
Skipped character count: 0
Skipped character count: 0
Skipped character count: 0
Ready to process
Thank you very much. I guess the reader can read 1-D also!
Nick


Re: Audio Icon on Web Panel - Java

 

Vinny,

Yes, my code was Java. But you write Jython code.

JMRI is written in Java, but it's difficult for users to write Java code. Therefore JMRI supports Jython, which is another language. But the principles in Java can be applied to Jython, which is why I gave a Java example.

Daniel

On 2025-05-16 19:11, Vinny DeRobertis via groups.io wrote:

I thought you told me that the code you provided (see snip in my first message) was Java script?


Re: Audio Icon on Web Panel - Java

 

I thought you told me that the code you provided (see snip in my first message) was Java script?


Re: Associating an init script with a panel file?

 

Robert,

If you are loading the xml file with a "Preferences -> Startup" action, you can also use a startup action to run the script.

The other approach is to use Logix or LogixNG to run the script. Here is a simple LogixNG.
Because the Startup option is enabled, the ConditonalNG will run after the file loading is done.

Dave Sand


----- Original message -----
From: "Robert Heller via groups.io" <heller=[email protected]>
To: JMRI Users <[email protected]>
Subject: [jmriusers] Associating an init script with a panel file?
Date: Friday, May 16, 2025 11:25 AM

I have a panel file
()
that I have written an init script (it just initializes the internal sensors
to a sane set of states).

Is there some way to run this script when the panel file is loaded?

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
-- Linux Administration Services
heller@... -- Webhosting Services







JMRI 5.11.5 OBlock File corruption

 

After running Version 5.10 I upgraded to 5.11.5 to access New Decoder incusions.
All was well until I needed to make some changes to OBlocks.
On accessing the Oblock table I eiher saw nothing in the table or scrolling I was met with scramled lines.
On returning to Ver 5.10 was was back as should be (less the Decoder Definitions)
If anyone has a fix , please e-Mail me direct . waldenjohn@... Many Thanks
John W


Associating an init script with a panel file?

 

I have a panel file
()
that I have written an init script (it just initializes the internal sensors
to a sane set of states).

Is there some way to run this script when the panel file is loaded?

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
-- Linux Administration Services
heller@... -- Webhosting Services


Re: What’s the optimum blocks in a fiddle/storage yard

 

Thanks all, good thoughts. Im stayiung for a short week in the Hamptons Virginia, In October. Any good railroad shops in that area I should try and look at.
Im visiting from the UK, perhaps I better bring a case load of railway gear with me if the tarrifs are still on!


Re: Audio Icon on Web Panel - Java

 

And you should run it from PanelPro.

Daniel

On 2025-05-16 16:19, danielb987 wrote:

Vinny,

Sorry for late reply. If it's a Jython script, use ".py" extension.

.js is for JavaScript.

Daniel


On 2025-05-14 21:26, Vinny DeRobertis via groups.io wrote:
Dave S. & Daniel B.
I just picked-up where we left off on DEC 5 2024. We had a thread going and Daniel provided Java code.
Based on Dave's comments on the code I believe I would be left with what's shown in the attached snip.
I saved it as .js but that didn't work when I ran it from Panel Pro.
NY&HV_RR_Yard_Scenes is the name of my panel andHarbor is the ID of the Audio Icon.
What file extension should I use, .java? Will it run from Panel Pro or from Command line?
--

Many thanks in advance!

Vinny DeRobertis ~ Apex, NC
New York & Hudson Valley RR

Windows 7 Pro / Java 11 / JMRI v5.10
Command Station: Digikeijs DR5000.
Booster: Digikeijs DR5033
(4) Samsung A7 10.4" Tablets
Fully Kiosk/Engine Driver v2.37.187
DCC/DMX Gateway: Pricom LLS.
LocoNet Input Modules: Digikeijs DR4088LN
DCC Output Modules:
Digikeijs DR4018 / Yamorc YD8116.
Sensors: Model Train Technology: DETECTOR-HO.
Turnout Motors: MTB MP1


Re: Audio Icon on Web Panel - Java

 

Vinny,

Sorry for late reply. If it's a Jython script, use ".py" extension.

.js is for JavaScript.

Daniel


On 2025-05-14 21:26, Vinny DeRobertis via groups.io wrote:

Dave S. & Daniel B.
I just picked-up where we left off on DEC 5 2024. We had a thread going and Daniel provided Java code.
Based on Dave's comments on the code I believe I would be left with what's shown in the attached snip.
I saved it as .js but that didn't work when I ran it from Panel Pro.
NY&HV_RR_Yard_Scenes is the name of my panel andHarbor is the ID of the Audio Icon.
What file extension should I use, .java? Will it run from Panel Pro or from Command line?
--

Many thanks in advance!

Vinny DeRobertis ~ Apex, NC
New York & Hudson Valley RR

Windows 7 Pro / Java 11 / JMRI v5.10
Command Station: Digikeijs DR5000.
Booster: Digikeijs DR5033
(4) Samsung A7 10.4" Tablets
Fully Kiosk/Engine Driver v2.37.187
DCC/DMX Gateway: Pricom LLS.
LocoNet Input Modules: Digikeijs DR4088LN
DCC Output Modules:
Digikeijs DR4018 / Yamorc YD8116.
Sensors: Model Train Technology: DETECTOR-HO.
Turnout Motors: MTB MP1