Keyboard Shortcuts
Likes
- Jmriusers
- Messages
Search
Re: How do I import openpyxl?
Dave,
?
Thanks. I'd like to avoid using a cvs file because I use the spreadsheet to maintain my car fleet as well as in the Jython script.
?
Robert,
?
I tried the path.append statement but it didn't work. My file structure is:
/Applications/JMRI 5.10/openpyxl315/openpyxl.
-
"openpyxl" is just a file. There is no "openpyxl.py" script. Inside the openpyxl file is an "__init__.py" script and other files including /workbook with another "__init__.py" inside.
-
I tried these small scripts:
import os
import sys sys.path.append("/Applications/JMRI 5.10/openpyxl315/openpyxl") - and
import os
import sys sys.path.append("/Applications/JMRI 5.10/openpyxl315/openpyxl/__init__.py") -
I ran them outside of jmri in BBedit and inside jmri using the script menu. But as I said, they didn't work when I ran my script which included the lines:
import os
import sys import time import openpyxl - sys console says "ImportError: No module named openpyxl" -
How should the path.amend statement read, and should I run it from the jmri script menu or from Bbedit or from the Terminal?
?
Thanks again to both of you.
Nick |
Re: VSD dont work
#vsdecoder
Angel,
toggle quoted message
Show quoted text
I recommend to look at an existing and working VSD file, like EMD_645_Turbo.vsd. To the initial part of the config.xml file: The value "diesel" is not a good choice for a profile name. Profile names must be unique. Take "EMD_645" for example. The error remains as long as you do not change the following line in your config.xml file: <sound name="ENGINE" type="SD70"> "SD70" is not valid, use "diesel3" instead. Klaus Am 22.05.2025 um 04:56 schrieb Angel Mora via groups.io: Hello again. I did it, but the result is the same. I still get that prompt. That's the initial part of the code. I wonder if you see anything wrong that you could tell me about? Thank you very much. |
Re: Trying to replicate 3-way LogixNG code
#logixng
John, If you have any LogixNG already created, loading an additional file with LogixNG does not work. I have created an export file which only has the LogixNG with modified system names to prevent conflicts. ?There are no other table entries or panels. ?Load this after loading your regular file. Dave Sand ----- Original message ----- From: "John Bauchiero via groups.io" <john4dhmr=[email protected]> Subject: [jmriusers] Trying to replicate 3-way LogixNG code Date: Wednesday, May 21, 2025 8:14 PM Dave Sand, I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.? Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.? Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.? ? John ?Bauchiero -?NCE PH-Pro & PowerCab, Pi4, DCC-EX - JMRI 5.11.6 - Java 17.0.12 |
Re: VSD dont work
#vsdecoder
Hello again. I did it, but the result is the same. I still get that prompt. That's the initial part of the code. I wonder if you see anything wrong that you could tell me about? Thank you very much.
?
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/xml/XSLT/vsdecoder-config.xsl"?>? <vsdecoder-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://jmri.org/xml/schema/vsdecoder/vsdecoder-config.xsd"> ? <!-- SD70ACE Prime Mover -->
? <!-- Used on many EMD Diesels 1975-present --> ? <!-- Examples: ? * SD70, SD70M, SD70ACE, SD70MAC (16-cylinder) --> ? <profile name="diesel">
? ? <!-- generic bell borrowed from the sd70ace -->
? ? <sound-event name="BELL" label="Bell-EMD 8475495 Steel Bell 049 End.wav" buttontype="TOGGLE"> ? ? ? <trigger name="BELL_BUTTON_STOP" type="BUTTON"> ? ? <event-name>BUTTON</event-name> ? ? <target-name>BELL</target-name> ? ? <match>false</match> ? ? <action>STOP</action> ? ? ? </trigger> |
Re: Edit dialog boxes do not open with full width
Ken,
?
Attached are a couple of traces. They are really traces of the same activity but I noticed something interesting. Process was:
?
You'll notice in the log that I put a blank line between steps 5 and 6 and also between steps 7 and 8 just for clarity.
?
I looked over the log and noticed references to screens 3 and 5. That reminded me that I'm running three desktops on the system. So, effectively, 6 monitors, so 3 and 5 would make sense. Seemed promising....maybe the OS is fetching screen sizes for screens that are not displayed and therefore zero? The trace named "JMRI_Trace_3_Desktops.txt" was captured running in this configuration.
?
To test the question of whether 3 desktops were the problem, I deleted desktops 2 and 3 and reran JMRI. Oddly, the log still showed references to screens 3 and 5. So, I rebooted the system and tried again. This time the log showed references to screen 1 and 2. You can see that in the other trace ("JMRI_Trace_1_Desktop.txt").
?
That's it for now. BTW, I also run desktops on the older system and did not have any problems.
?
Vince JMRI_Trace_3_Desktops.txt
JMRI_Trace_3_Desktops.txt
JMRI_Trace_1_Desktop.txt
JMRI_Trace_1_Desktop.txt
|
Re: Looking for ideas to mirror SE8C signals between two panels
On 5/21/2025 8:40 PM, cengel_74 via groups.io wrote:
So the question is, is there a way to resolve this issue or do I just need to manually load the script after the panel until we get to the point of loading the panel in the startupYes, you will just need to manually load the script. |
Trying to replicate 3-way LogixNG code
#logixng
¿ªÔÆÌåÓýDave Sand, I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.? Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.? Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.? ? John ?Bauchiero -?NCE PH-Pro & PowerCab, Pi4, DCC-EX - JMRI 5.11.6 - Java 17.0.12 |
Re: Looking for ideas to mirror SE8C signals between two panels
This script worked in my?manual testing so now I need to test it on the real layout. However I'm pretty sure I know the answer to this stupid question but I'm going to ask it anyway.? We typically load up PanelPro and then manually load the panel that we are going to load since we are actively working on it and have many versions, backups etc.? It appears that if I put this script into the startup it causes issues which I suppose makes sense because the signal heads haven't been defined yet : 19:33:14,574 ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [AWT-EventQueue-0] org.python.core.PyException: AttributeError: 'NoneType' object has no attribute 'setAppearance' at org.python.core.Py.AttributeError(Py.java:176) ~[jython-standalone-2.7.4.jar:2.7.4] at org.python.core.PyObject.noAttributeError(PyObject.java:965) ~[jython-standalone-2.7.4.jar:2.7.4] at org.python.core.PyObject.__getattr__(PyObject.java:959) ~[jython-standalone-2.7.4.jar:2.7.4] at org.python.pycode._pyx0.propertyChange$3(<script>:42) ~[?:?] at org.python.pycode._pyx0.call_function(<script>) ~[?:?] So the question is, is there a way to resolve this issue or do I just need to manually load the script after the panel until we get to the point of loading the panel in the startup? On Mon, May 19, 2025 at 10:10?AM cengel_74 via <chrisengel=[email protected]> wrote:
--
?Chris |
Re: Edit dialog boxes do not open with full width
¿ªÔÆÌåÓýVince, ? Here is a clue. jmri.util.JmriJFrame ? If you set that to TRACE level, it will show more of how it is figuring out size stuff. Might not get you an answer but worth a shot. ? Debug->Display/Edit Log Categories At the bottom scroll box, go down the list to: jmri.util.JmriJFrame then pick TRACE in the ¡®New level for above category¡¯ pull down. ? I¡¯m suspecting that something is saying the screen is way smaller and that confuses everything. ? -Ken Cameron, Member JMRI Dev Team
? ? |
Re: Starting with JMRI sensor reading and signal output: help request
Hi Eric,
?
I have just started going down the rabbit hole of JMRI. I created a track plan in Anyrail and created all my Sections, making sure everything was connected.
?
i followed the instructions given by Steve Todd at . I also set up my JMRI system using a Raspberry Pi, using Steve¡¯s instructions and downloads. See https://mstevetodd.com/jmri-raspberrypi-access-point.
I discovered that, if I wanted to move forward with JMRI, the best solution for me was to go with C/MRI nodes. So I selected my JMRI system as C/MRI and when i imported the AnyRail plan, i was able to create correctly named sensors for both my turnouts and blocks. In theory I should be able to move forward now to set up all my C/MRI nodes and sensors (using Arduinos with turnout controls and block sensors all controlled from the Raspberry Pi 4b running JMRI) and have the ability to use my JMRI layout panel displays to show block occupancy status, switch turnouts from the panel, and eventually follow the progress of my trains around the layout.?
This approach also gives me a built in WiFi access point with the ability to use my phone as a loco controller, and use either (or both) tablets (e.g. old iPads) or a touch monitor attached directly to the Raspberry Pi, to display the layout panel and control my turnouts, create routes and generally have fun playing with my trains.
?
There are lots of YouTube videos about how to do all of this, and a lot of helpful information is referenced on the JMRI website. |
Re: Edit dialog boxes do not open with full width
Thanks, Ken. It sure does appear to act as you suggested. Here's a potentially interesting data point. Since I'm lucky enough to have two Macs both running 5.10 but on different platforms, I tried a simple A/B test. On my Studio (current, new machine - acting weirdly), I started up JMRI and opted to create a new profile called "foo". After clicking OK, it opens up the preferences window as well as the startup PanelPro dialog. Both are "skinny" (see the original post below). Without doing anything else, I went into the profile folder and "vi"ed the user-interface.xml file. Then I went to the iMac (older but working system) and did the same thing. Here are the two xml files:
?
First, the .xml file from the new, misbehaving system:
?
<?xml version="1.0" encoding="UTF-8"?> <auxiliary-configuration xmlns="http://www.netbeans.org/ns/auxiliary-configuration/1"> ? ? <classPreferences xmlns="http://jmri.org/xml/schema/auxiliary-configuration/class-preferences-4-3-5.xsd"> ? ? ? ? ? ?(deleted - they're identical between the two files ? ? </classPreferences> ? ? <windowDetails xmlns="http://jmri.org/xml/schema/auxiliary-configuration/window-details-4-3-5.xsd"> ? ? ? ? <window xmlns="" class="apps.gui3.tabbedpreferences.TabbedPreferencesFrame:Preferences" height="1440.0" locX="-654.0" locY="0.0" width="80.0"/> ? ? ? ? <window xmlns="" class="PanelPro" height="237.0" locX="48.0" locY="583.0" width="80.0"/> ? ? ? ? <window xmlns="" class="jmri.jmrit.roster.Roster"/> ? ? </windowDetails> </auxiliary-configuration> ? Now, the .xml file from the old, working system: <?xml version="1.0" encoding="UTF-8"?> <auxiliary-configuration xmlns="http://www.netbeans.org/ns/auxiliary-configuration/1"> ? ? <classPreferences xmlns="http://jmri.org/xml/schema/auxiliary-configuration/class-preferences-4-3-5.xsd"> ? ? ? ? ? ? ? (again deleted - same as new file) ? ? </classPreferences> ? ? <windowDetails xmlns="http://jmri.org/xml/schema/auxiliary-configuration/window-details-4-3-5.xsd"> ? ? ? ? <window xmlns="" class="jmri.jmrit.roster.Roster"/> ? ? ? ? <window xmlns="" class="apps.gui3.tabbedpreferences.TabbedPreferencesFrame:Preferences" height="1440.0" locX="147.0" locY="0.0" width="1018.0"/> ? ? ? ? <window xmlns="" class="PanelPro" height="237.0" locX="1025.0" locY="601.0" width="510.0"/> ? ? </windowDetails> </auxiliary-configuration> ? Notice that in the first, incorrect file, the width for both the Preferences window and the opening PanelPro window tags is "80.0". For the working system, the Preferences window width is set to "1018.0" and the width for the PanelPro window is "510.0". On both systems, the width in the .xml file appear to correctly match the windows that appear on the screen. In fact, it looks like all "skinny" windows are 80 [pixels] wide. (When they open, I line them up with each other to check it out.) Not sure where that 80 comes from. One random thought I had was that 80 is frequently the default width (in characters, not pixels) of a terminal window (24x80). Maybe just a meaningless coincidence, but it did come to mind. Maybe another thing worth noting is the locX property in the "bad" file. The Preferences? window tag has a locX property of -654.0 and the PanelPro has a locX of 48.0. On the screen, the PanelPro pane is on my main monitor. The Preference pane is painted on the secondary monitor. I have the Mac configured so that the main monitor is on the right side of my desk and the secondary is on the left. This then looks as though the coordinate system is based on the main monitor and the negative locX for the Preferences panel reflects the fact that it is to the left of the main monitor (whose left screen edge would represent x = 0). A couple of other things that come to mind. The new system (with the problem) is a Mac Studio with two monitors. The old, working system is an iMac with a 5K display. Prior to getting the Studio, I used this same Thunderbolt monitor (located on the left as it is now with the new system). I don't remember ever having "skinny window" problems with that system. Perhaps there is a difference between how Apple reports screen geometries between a headless system. with two monitors and an all-in-one computer with one monitor. The iMac now has no second monitor. So, any tests I run at this point will not be an exact apples-to-apples comparison (no pun intended...although I like it? :-0 ) And, as we appear to be seeing now, even the new system (Studio) works with only one monitor attached. Please feel free if there are some tests you would like to see run. I am eager to help if I can. Vince |
Re: LogixNG some help requested
#logixng
Erik, Which URL? ?They work for me. For track 3, T2 has to be closed in order to reach T3. ?T2 thrown is used to access track 2. ?Note: ?T1 is a right hand turnout. ?T2 and T3 are left hand turnouts. Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested #logixng Date: Wednesday, May 21, 2025 4:00 PM The url's at the bottom are not valid, and I am lost with the table: for example, for route three should T1, T2 and T3 not be thrown/thrown/closed? |
Re: LogixNG some help requested
#logixng
The url's at the bottom are not valid, and I am lost with the table: for example, for route three should T1, T2 and T3 not be thrown/thrown/closed? |
LogixNG POM
#logixng
I am using the POM function in LogixNG.
Currently setting a CV = to an IM value.
Works good.
Now I'd like to ADD an IM value to the CV.
In the snip I started out trying to just add a constant (50) but that didn't work.
I think I need to use the Formula tab but not sure of the syntax.?
--
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: How do I import openpyxl?
If openpyxl.py is *NOT* in the "standard" Python dist library
(under Linux that would be /usr/lib/python3/dist-packages/), you will have to add its path to sys.path: import os import sys sys.path.append("/path/to/the/directory/containing/openpyxl.py") At Wed, 21 May 2025 13:08:12 -0700 "Nick Brownsberger via groups.io" <nbrownsbe@...> wrote: -- Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364 Deepwoods Software -- Custom Software Services -- Linux Administration Services heller@... -- Webhosting Services |
Re: How do I import openpyxl?
Nick, I don't have an answer, but it might be lot easier to export the spreadsheet as a CSV file. ?There are several Jython scripts that work with CSV files that could provide useful examples. Dave Sand ----- Original message ----- From: "Nick Brownsberger via groups.io" <nbrownsbe=[email protected]> Subject: [jmriusers] How do I import openpyxl? Date: Wednesday, May 21, 2025 3:08 PM I want to run a Jython script inside of ?jmri so I can manipulate turnouts, etc. However, the script doesn't recognize openpyxl when I try to import it. I need openpyxl to access an Excel spreadsheet. How do I import openpyxl? ? Thanks in advance, Nick |
Re: LogixNG some help requested
#logixng
Erik, Look at the example at? This combines LogixNG with a bit of Java code. Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested #logixng Date: Wednesday, May 21, 2025 12:21 PM Great! The more I delve into these LogixNG programming the more sophisticated it reveals to be. |