¿ªÔÆÌåÓý

Date

Locked 5.8 on Mac M3 OS 14.6.1 does not print block table #printing

 

Have not found any discussion in a search or in the Release notes.
?
Above configuration printing to a laser printer across the network. ?Get a printer error return and a single page with the first block entry ?(System name and User name columns only). ?This was working on 5.6 on the same hw/sw. ?Using Metal if that makes a difference.
?
Thanks,
Martin Booker


Locked Re: DAVID HUDSON'S RailModeller Pro .XML FILE to Panel Pro #railmodellerpro

 

David,

If you are really precise and steady with your mouse moves, you can select each circle.

Those are the layout editor control circles. ?They define the clickable area for selecting an object such as track segments, turnouts, anchor points, etc.

You can change the size of the control circle using "Options -> Turnout Options -> Set Turnout Circle Size". ?I normally use size 2. Here is your image using size 1.
Note: ?The circle size was originally just for turnouts. ?Later, the developer decided to use the turnout size the value for all control circles instead of having different sizes for each type of control circle.

Dave Sand


----- Original message -----
From: "BorderTerrier via groups.io" <davidhudson48=[email protected]>
Subject: Re: [jmriusers] DAVID HUDSON'S RailModeller Pro .XML FILE to Panel Pro #railmodellerpro
Date: Sunday, September 08, 2024 9:24 AM

Good afternoon Dave
I am not a coder, but have been able to identify what apprears to be an anomaly in
the transfer of data from RailModeller Pro to Panel Pro.?
I have looked at the three curved lines in the top left hand corner of the Panel Pro
version of the exported document.
I had expected the three circles to be the 'controls' for each of the three lines.
The three circles all control the central of the three lines, having no control over
the outermost and innermost lines.
At this stage, I have decided that if I am to use PanelPro successfully, I will start from scratch and bin the transfer facility from RailModeller.
If I can identify, what appears to be an anomaly, goodness knows what else lurks beneath the surface.?
David Hudson


Locked Re: DAVID HUDSON'S RailModeller Pro .XML FILE to Panel Pro #railmodellerpro

 

Good afternoon Dave
I am not a coder, but have been able to identify what apprears to be an anomaly in
the transfer of data from RailModeller Pro to Panel Pro.?
I have looked at the three curved lines in the top left hand corner of the Panel Pro
version of the exported document.
I had expected the three circles to be the 'controls' for each of the three lines.
The three circles all control the central of the three lines, having no control over
the outermost and innermost lines.
At this stage, I have decided that if I am to use PanelPro successfully, I will start from scratch and bin the transfer facility from RailModeller.
If I can identify, what appears to be an anomaly, goodness knows what else lurks beneath the surface.?
David Hudson


Locked Re: Precise position of trains and maneuvers automation

 

Thank you for this correction.

So, JMRI only try to detect the front of the train, to respect signals.

That mean I can, for my Bachelor work, modify JMRI to add the management
of the full length of the train.

It could benefit to more than just managing the maneuver. Like only
accelerate a train after it fully goes behind a speed limit signal. Or
check that a train stopped on a track before/after a turnout, let enough
space for trains on the other track.


"Dave Sand" <ds@...> writes:

Nags,

The phrase, "exited one block and entered a new block", is not true. The time to traverse a block is the elapsed time from the entry of a block to
the entry of the next block in the direction of travel. This eliminates any issues with train length or the presence of detectable wheel sets on
rolling stock.

Dave Sand

----- Original message -----
From: "Nags via groups.io" <snowy999@...>
To: [email protected]
Subject: Re: [jmriusers] Precise position of trains and maneuvers automation
Date: Saturday, September 07, 2024 4:58 PM

As far as I understand warrants, JMRI uses the entry into a block (oblock) as a reference point to determine what if any actions it needs to take.
It is unaware of anything within the block.

Therefore, when the block becomes occupied JMRI 'knows it has exited one block and entered a new block. This allows it to determine two
things:

* the trains performance - how long it took to traverse the previous block and whether it was too fast or slow requiring tuning of the
throttle/speed ratio.
* what the train needs to do next. On entering the block it knows the current speed, it knows the length of this block and upcoming paths and
blocks. It determines what if any actions are needed for any upcoming speed requirements e.g. a danger signal, it has the reference point to
calculate the distance to cover and then determine the throttle settings and timing for deceleration required to stop the train to avoid
passing the signal.


Locked Re: Precise position of trains and maneuvers automation

 

Thank you very much. Now, I understand way more how JMRI work.

I can't wait to have some free time after my bachelor work and try JMRI on my own layout.
It's bad that I didn't have more space for a bigger layout.



"Nags via groups.io" <snowy999@...> writes:

As far as I understand warrants, JMRI uses the entry into a block (oblock) as a reference point to determine what if any actions it needs to take.
It is unaware of anything within the block.

Therefore, when the block becomes occupied JMRI 'knows it has exited one block and entered a new block. This allows it to determine two
things:

* the trains performance - how long it took to traverse the previous block and whether it was too fast or slow requiring tuning of the
throttle/speed ratio.
* what the train needs to do next. On entering the block it knows the current speed, it knows the length of this block and upcoming paths and
blocks. It determines what if any actions are needed for any upcoming speed requirements e.g. a danger signal, it has the reference point to
calculate the distance to cover and then determine the throttle settings and timing for deceleration required to stop the train to avoid
passing the signal.


Locked Re: Precise position of trains and maneuvers automation

 

Hello Bob and Scott.

I have added the RPS system to my documentation of the state of the art.
Sadly, it did not exist anymore.


About using a sonic transmitter, I think the reliefs of the layout, the
buildings, other vehicles, etc, will give some problems with the reflection of the
sound. And inside the tunnel, it could not work.


"Bob Jacobsen" <rgj1927@...> writes:

I¡¯d be interested in hearing more about work with sonic GPS.

A while back, there was a commercial system called ¡°RPS¡± that did this.



It worked really well but the electronics was bulky and it had a large transmitter that was pretty ugly on top of the locomotive. It even had JMRI support:

Unfortunately, the owner passed. Somebody, I don¡¯t recall who, bought the system and was going to try to repackage the transmitter, but I don¡¯t think anything came of that.

Perhaps the time has come for this tech!

Bob

On Sep 7, 2024, at 4:04?PM, Scott Walton via groups.io <jscottwalton@...> wrote:

What about the railway GPS for model railroads (I think there¡¯s a
beta test of that now) using a sonic transmitter in the locomotive
and several receivers around the room. You can calculate the
position in 3-space from the transmission time to each receiver.
¡ª
Bob Jacobsen
rgj1927@...







Locked Re: Timed control of (servo actuated) uncoupler

 

¿ªÔÆÌåÓý


Within the panel, the simplest is to make the "sensor" a momentary action sensor, so it reverts to its original (off) state when the click is removed.? ?But this means the uncoupler being "on" isn't shown.??

If not happy with this visually, and want a visual representation of the uncoupler staying "on" for a period of time, then this(*) should work:??
a)? ?use the momentary sensor icon, and edit it's "level" to a high number in the panel.? ?Then, change the sensor icon to be a transparent square (ie. invisible).? But an invisible icon can still be clicked to cause an action.? ?
b)? ?place the light on the panel, on a level lower than the sensor, and visually underneath the transparent icon.? Set that to have no click action (so it only displays, doesn't respond to click).??

You may find it easier to construct the above in stages, and the final step is to make the two elements overlap each other in the same place.??

?
(* I can think of other ways of achieving the same ).?


- Nigel



------ Original Message ------
From "James Parker" <jwparker@...>
Date 08/09/2024 10:36:04
Subject [jmriusers] Timed control of (servo actuated) uncoupler

I am trying to implement a timed control of an uncoupler, which is actuated by a servo (the servo moves a permanent magnet so it is either near to the track or distant from the track).? The JMRI documentation says that 'lights' are specifically designed for uncouplers, but Im struggling to get the combination of lights/sensors to do what I want.
?
What I want is
1. to push a 'button' (sensor?) on my layout panel to activate the uncoupler (light)
2. for the uncoupler (light) to stay on for a period of time then switch off
3. for the colour of the button (sensor?) to change when I first push it, and then to change back when the uncoupler (light) switches off after the programmed period of time (so the button colour at all times reflects the state of the uncoupler)
?
I can get (1) to work using a sensor which controls the light.? I can get( 2) to work by setting the light controller type to timed on and setting the on duration accordingly.? What I cant do is to get the button(sensor) colour to change back when the uncoupler (light) switches off.
?
Can anyone tell me what I am missing?
?
?


Locked Timed control of (servo actuated) uncoupler

 

I am trying to implement a timed control of an uncoupler, which is actuated by a servo (the servo moves a permanent magnet so it is either near to the track or distant from the track).? The JMRI documentation says that 'lights' are specifically designed for uncouplers, but Im struggling to get the combination of lights/sensors to do what I want.
?
What I want is
1. to push a 'button' (sensor?) on my layout panel to activate the uncoupler (light)
2. for the uncoupler (light) to stay on for a period of time then switch off
3. for the colour of the button (sensor?) to change when I first push it, and then to change back when the uncoupler (light) switches off after the programmed period of time (so the button colour at all times reflects the state of the uncoupler)
?
I can get (1) to work using a sensor which controls the light.? I can get( 2) to work by setting the light controller type to timed on and setting the on duration accordingly.? What I cant do is to get the button(sensor) colour to change back when the uncoupler (light) switches off.
?
Can anyone tell me what I am missing?
?
?


Locked Re: Actually getting Raildriver working (on windows) How to Calibrate??? #raildriver

 

So it had nothing to do with the calibration after all.
I had updated and downgraded JMRI versions so many times over the course of a decade on this hard drive that JMRI was getting confused and throwing errors looking for files that weren't there until it crashed.
So a clean install and removing the 4 to 5 file locations that had been created over the years worked.
?
A 32 bit compatible JMRI version and Java seems to do the trick.
Further experimentation may reveal which version is the highest for that.
?
?
?


Locked Re: MQTT high volume issues - some progress #mqtt

 

Thanks all? - this is a fairly minor issue for me and it seems that nobody else is experiencing it so please prioritise it accordingly!
?
The only other thing I've noticed, that I can add if it helps - and again it's a very, very minor issue that I've worked around -
?
I have a couple of Windows applications that are running some automation and monitoring for me. As part of what they do, they very regularly 'allocate' blocks within JMRI. For each block they want to allocate, they send a small json payload to the json server, for a single block, containing a string value for the 'value' field, to indicate allocation. Additionally, they send an MQTT publish which JMRI / LogixNG pick up, and that takes care of setting the alternate block colour on the panel. Sometimes there are multi block sections, so 5-6 blocks can be processed pretty much at the same time, resulting in 5-6 json POSTs and 5-6 MQTT publishes.
?
For the POSTs, they all worked every time. But MQTT didn't. If, say 6 blocks needed to be allocated,. they would all get their value, but, say only 4 would get their alternate colour set. It's like it doesn't cope with multiple messages at the same time. I could see the MQTT publishes were successful, but couldn't see anything in the JMRI logs, it was like they just got completely missed. I switched to queueing up the MQTT publishes in the app and sending them maybe 200ms apart, and that worked flawlessly.
?
This was before I upgraded JMRI to the new version that handled more concurrent messages, but still, even when I was experiencing the issue it was when I was debugging software without the actual layout being powered up, so it was max 10 publishes at the same time.
?
I think a way of recreating this - and I'll get onto this today, is to just write a 'for' loop, send multiple messages to MQTT on a subject that JMRI is subscribed to, and see how many it takes before some start getting missed. I'll report back if I find anything useful.
?
Chris


Locked Re: Parse Error: Reporter (Which I don't need) #reporters

 

I know I was working on blocks, entering their lengths for later running trains automatically via Dispatcher.?
?
I probably used the Reporters tab trying to get the panel to display its contents showing which train was parked in which staging block.? I can't remember what I did exactly but it wasn't getting the results I expected, so I gave up on it and moved on to entering lengths for other blocks.
?
Did I just make this a major project?


Locked Re: Getting throttle settings with LogixNG #logixng

 

Jos,

The final answer to your original post is yes, you can use LogixNG get the speed of a Dispatcher auto train.

Here is a LogixNG Module that takes a train name and returns the train speed if found. ?If not found, it returns -2.0.

Dave Sand



Locked Re: Parse Error: Reporter (Which I don't need) #reporters

 

Bill,

To remove the reporters content edit the "Layout.xml" file. ?This is done while JMRI is NOT running.

This is a collapsed view but you want to delete the "reporters" entity and its contents. ?That includes the initial tag and the end tag.

There is a possibility that you might have created references to a reporter item. ?This is most likely to occur from the Blocks table. ?If so, things get more complicated.

Dave Sand


----- Original message -----
From: sontrak <sontrak@...>
Subject: Re: [jmriusers] Parse Error: Reporter (Which I don't need)
Date: Saturday, September 07, 2024 7:16 PM

I poorly stated I was trying to Load Table Content and Panels.? When I try that, I get the error message above.
?
I'm reasonably conversant with editing XML files in that I've done some machine language programming on USAF Flight Simulators (F-4E, C-141, C-5A).
?
If you can direct me to open the correct file, find the line, and how to edit it, I think I can follow those directions.? I:m not conversant with Java to be able to develop my own code.? In my 80s, I think its too late to learn that.? I've been retired 35 years from doing this stuff, but I still understand how to do it.
?
Thanks for the response,? it gives me some hope.
?
Bill B
?


Locked Re: Getting throttle settings with LogixNG #logixng

 

¿ªÔÆÌåÓý

I agree.

Daniel

On 2024-09-08 02:53, Steve_G wrote:

I would prefer to limit the public attributes as it cramps our style when evolving the product.? the setting attributes should be strictly limited as dispatcher is intended to be in total control.?
Steve G.
?


Locked Re: Getting throttle settings with LogixNG #logixng

 

I would prefer to limit the public attributes as it cramps our style when evolving the product.? the setting attributes should be strictly limited as dispatcher is intended to be in total control.?
Steve G.
?


Locked Re: Getting throttle settings with LogixNG #logixng

 

No, I was looking for a test item.?

----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Saturday, September 07, 2024 7:25 PM

Dave,

Do you want me to create a PR to make the method public? I didn't do that because I wasn't sure if there was more methods you want to be public as well.

Daniel

On 2024-09-07 18:31, Dave Sand wrote:
Daniel,

Thank you for identifying my oversight.

I have confirmed that calling the public getActiveTrainsList() method works as expected. ?It creates a LogixNG array of active train objects.

The goal is to create a module that takes the train name and returns the current speed. ?This can be used instead of calling a Jython script.

Dave Sand


----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Saturday, September 07, 2024 11:04 AM

Dave,

The method DispatcherFrame.getSignalTypeString() is protected. And since LogixNG is executing Java methods from a different package, it's not possible for LogixNG to access that method.

I'm surprised Jython can do it. It seems that Jython in some way circumvent Java protected status.

The solution is to change the method getSignalTypeString() to public. Maybe other methods in that class should be made public as well?

Daniel

On 2024-09-07 17:18, Dave Sand wrote:
Daniel,

Here is the LogixNG:

LogixNG: Dispatcher Manager Test
??? ConditionalNG: Dispatcher Manager
??????? ! A
??????????? Many
?????????????? ::: Local variable "mgr", init to None ""
?????????????? ::: Local variable "sigtype", init to String ""
??????????????? ! A1
??????????????????? Digital Formula: mgr = InstanceManager.getDefault("jmri.jmrit.dispatcher.DispatcherFrame")
??????????????????????? ?* E1
????????????????????????????
??????????????? ! A2
??????????????????? Log local variables
??????????????? ! A3
??????????????????? Digital Formula: value = mgr.getSignalTypeString()
??????????????????????? ?* E1
????????????????????????????
??????????????? ! A4
??????????????????? Log local variables

An error occurs during the execute of the LogixNG:

I selected the About option.

Here is the system console:

10:04:36,264 apps.util.Log4JUtil?????????????????? INFO? - * JMRI log ** [main]
10:04:36,269 apps.util.Log4JUtil?????????????????? INFO? - This log is stored in file: /Users/das/Library/Preferences/JMRI/log/session.log [main]
10:04:36,270 apps.util.Log4JUtil?????????????????? INFO? - This log is appended to file: /Users/das/Library/Preferences/JMRI/log/messages.log [main]
10:04:36,275 apps.Apps???????????????????????????? INFO? - PanelPro version 5.8+Rbc21ce2ce7 starts under Java 17.0.11 on Mac OS X aarch64 v14.6.1 at Sat Sep 07 10:04:36 CDT 2024 [main]
10:04:38,759 apps.Apps???????????????????????????? INFO? - Starting with profile Dispatcher.3ccc2fc9 [main]
10:04:38,802 jmri.util.node.NodeIdentity?????????? INFO? - Using aea674cb-bb05-467f-be01-3844e010f99f as the JMRI storage identity for profile id 3ccc2fc9 [AWT-EventQueue-0]
10:04:38,824 jmri.jmrix.ConnectionConfigManager??? INFO? - No local configuration found. [main]
10:04:38,932 jmri.jmrix.loconet.LnPacketizer?????? INFO? - lnPacketizer Started [main]
10:04:38,933 i.jmrix.loconet.hexfile.LnHexFilePort INFO? - LocoNet Simulator Started [LocoNet HexFileFrame]
10:04:39,029 jmri.jmrit.roster.Roster????????????? INFO? - Reading roster file with rootFromName(/Users/das/JMRI/_Profiles/) [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path program: is /Applications/JMRI/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path preference: is /Users/das/JMRI/_Profiles/Dispatcher.jmri/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path profile: is /Users/das/JMRI/_Profiles/Dispatcher.jmri/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path settings: is /Users/das/Library/Preferences/JMRI/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path home: is /Users/das/ [main]
10:04:39,208 jmri.util.FileUtilSupport???????????? INFO? - File path scripts: is /Users/das/JMRI/_Profiles/Dispatcher.jmri/ [main]
10:04:39,631 apps.PanelPro.PanelPro??????????????? INFO? - Main initialization done [main]
10:04:44,142 jmri.configurexml.LoadXmlConfigAction INFO? - Loading selected file: /Users/das/JMRI/_Profiles/ [AWT-EventQueue-0]
10:04:45,138 t.display.layoutEditor.BlockValueFile INFO? - 4 of 4 block values restored. Rule=RESTOREONLYIFALLOCCUPIED, Power=OFF [AWT-EventQueue-0]
10:05:07,501 jmri.jmrit.audio.JoalAudioFactory???? INFO? - Initialised JOAL using OpenAL: vendor - OpenAL Community version - 1.1 ALSOFT 1.23.1 [Listed Table Generation]
10:06:10,519 rit.logixng.actions.LogLocalVariables WARN? - Log local variables: [JMRI LogixNGThread]
10:06:10,520 rit.logixng.actions.LogLocalVariables WARN? -???? Name: sigtype, Value: , java.lang.String [JMRI LogixNGThread]
10:06:10,520 rit.logixng.actions.LogLocalVariables WARN? -???? Name: mgr, Value: jmri.jmrit.dispatcher.DispatcherFrame[frame0,564,261,954x512,invalid,layout=java.awt.BorderLayout,title=Dispatcher,resizable,normal,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,28,954x484,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true], jmri.jmrit.dispatcher.DispatcherFrame [JMRI LogixNGThread]
10:06:10,525 rit.logixng.actions.LogLocalVariables WARN? - Log local variables done [JMRI LogixNGThread]
10:06:14,747 g.implementation.DefaultConditionalNG WARN? - ConditionalNG IQC:AUTO:0001 was aborted during execute: jmri.jmrit.logixng.util.parser.CannotCallMethodException: Can not call method getSignalTypeString() on object jmri.jmrit.dispatcher.DispatcherFrame[frame0,564,261,954x512,invalid,layout=java.awt.BorderLayout,title=Dispatcher,resizable,normal,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,28,954x484,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] [JMRI LogixNGThread]
jmri.jmrit.logixng.util.parser.CannotCallMethodException: Can not call method getSignalTypeString() on object jmri.jmrit.dispatcher.DispatcherFrame[frame0,564,261,954x512,invalid,layout=java.awt.BorderLayout,title=Dispatcher,resizable,normal,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,28,954x484,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
at jmri.jmrit.logixng.util.parser.ExpressionNodeMethod.calculate(ExpressionNodeMethod.java:173) ~[jmri.jar:?]
at jmri.jmrit.logixng.util.parser.ExpressionNodeComplex.calculate(ExpressionNodeComplex.java:24) ~[jmri.jar:?]
at jmri.jmrit.logixng.util.parser.ExpressionNodeAssignmentOperator.calculate(ExpressionNodeAssignmentOperator.java:234) ~[jmri.jar:?]
at jmri.jmrit.logixng.actions.DigitalFormula.execute(DigitalFormula.java:145) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultMaleDigitalActionSocket.execute(DefaultMaleDigitalActionSocket.java:45) ~[jmri.jar:?]
at jmri.jmrit.logixng.tools.debugger.DebuggerMaleDigitalActionSocket.execute(DebuggerMaleDigitalActionSocket.java:35) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultFemaleDigitalActionSocket.execute(DefaultFemaleDigitalActionSocket.java:37) ~[jmri.jar:?]
at jmri.jmrit.logixng.actions.DigitalMany.execute(DigitalMany.java:116) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultMaleDigitalActionSocket.execute(DefaultMaleDigitalActionSocket.java:45) ~[jmri.jar:?]
at jmri.jmrit.logixng.tools.debugger.DebuggerMaleDigitalActionSocket.execute(DebuggerMaleDigitalActionSocket.java:35) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultFemaleDigitalActionSocket.execute(DefaultFemaleDigitalActionSocket.java:37) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultConditionalNG.internalExecute(DefaultConditionalNG.java:173) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultConditionalNG$ExecuteTask.run(DefaultConditionalNG.java:216) ~[jmri.jar:?]
at jmri.jmrit.logixng.util.LogixNG_Thread.lambda$new$0(LogixNG_Thread.java:148) ~[jmri.jar:?]
at java.lang.Thread.run(Thread.java:840) [?:?]

Doing a Jython print of the result of jmri.InstanceManager.getDefault(..) returns the same content, but Jython is still able to resolve the method calls.

Dave Sand



----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Saturday, September 07, 2024 3:34 AM

Dave,

> For Dispatcher, the DispatcherFrame class is both the Dispatcher manager and the main JmriJFrame.? The "InstanceManager" function returns the JFrame, not the object.

Can you explain this?

Create a ConditionalNG that calls the InstanceManager to get the instance of DispatcherFrame and put it in a local variable. Then use LogLocalVariables with show class name. What class name do you get?

Daniel

On 2024-09-06 16:43, Dave Sand wrote:
Daniel,

It could be done using LogixNG except for one problem.

The "InstanceManager" function normally returns a manager object, for example using a formula such as:

mgr = InstanceManager.getDefault("jmri.Sensor")

where "mgr" is a local variable. ?For Dispatcher, the DispatcherFrame class is both the Dispatcher manager and the main JmriJFrame. ?The "InstanceManager" function returns the JFrame, not the object.

Dave Sand


----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Friday, September 06, 2024 9:07 AM

Jos,

No, not currently. But you can use a Jython script to do that. Hopefully someone else will join in and give you an example on a Jython script for it.

Daniel

On 2024-09-06 15:11, Jos Smeele wrote:
Is there a way that I can query an active throttle with LogixNG and, for instance, store the current speed in a local variable with LogixNG?
I want to get the current train speed with LogixNG when Dispatcher is executing Transits.
I've learned that Memory variables can be queried with: memories.getMemory(<memory name>) so is there something similar for throttle data?
Thanks,
Jos





Locked Re: Getting throttle settings with LogixNG #logixng

 

¿ªÔÆÌåÓý

Dave,

Do you want me to create a PR to make the method public? I didn't do that because I wasn't sure if there was more methods you want to be public as well.

Daniel

On 2024-09-07 18:31, Dave Sand wrote:

Daniel,

Thank you for identifying my oversight.

I have confirmed that calling the public getActiveTrainsList() method works as expected. ?It creates a LogixNG array of active train objects.

The goal is to create a module that takes the train name and returns the current speed. ?This can be used instead of calling a Jython script.

Dave Sand


----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Saturday, September 07, 2024 11:04 AM

Dave,

The method DispatcherFrame.getSignalTypeString() is protected. And since LogixNG is executing Java methods from a different package, it's not possible for LogixNG to access that method.

I'm surprised Jython can do it. It seems that Jython in some way circumvent Java protected status.

The solution is to change the method getSignalTypeString() to public. Maybe other methods in that class should be made public as well?

Daniel

On 2024-09-07 17:18, Dave Sand wrote:
Daniel,

Here is the LogixNG:

LogixNG: Dispatcher Manager Test
??? ConditionalNG: Dispatcher Manager
??????? ! A
??????????? Many
?????????????? ::: Local variable "mgr", init to None ""
?????????????? ::: Local variable "sigtype", init to String ""
??????????????? ! A1
??????????????????? Digital Formula: mgr = InstanceManager.getDefault("jmri.jmrit.dispatcher.DispatcherFrame")
??????????????????????? ?* E1
????????????????????????????
??????????????? ! A2
??????????????????? Log local variables
??????????????? ! A3
??????????????????? Digital Formula: value = mgr.getSignalTypeString()
??????????????????????? ?* E1
????????????????????????????
??????????????? ! A4
??????????????????? Log local variables

An error occurs during the execute of the LogixNG:

I selected the About option.

Here is the system console:

10:04:36,264 apps.util.Log4JUtil?????????????????? INFO? - * JMRI log ** [main]
10:04:36,269 apps.util.Log4JUtil?????????????????? INFO? - This log is stored in file: /Users/das/Library/Preferences/JMRI/log/session.log [main]
10:04:36,270 apps.util.Log4JUtil?????????????????? INFO? - This log is appended to file: /Users/das/Library/Preferences/JMRI/log/messages.log [main]
10:04:36,275 apps.Apps???????????????????????????? INFO? - PanelPro version 5.8+Rbc21ce2ce7 starts under Java 17.0.11 on Mac OS X aarch64 v14.6.1 at Sat Sep 07 10:04:36 CDT 2024 [main]
10:04:38,759 apps.Apps???????????????????????????? INFO? - Starting with profile Dispatcher.3ccc2fc9 [main]
10:04:38,802 jmri.util.node.NodeIdentity?????????? INFO? - Using aea674cb-bb05-467f-be01-3844e010f99f as the JMRI storage identity for profile id 3ccc2fc9 [AWT-EventQueue-0]
10:04:38,824 jmri.jmrix.ConnectionConfigManager??? INFO? - No local configuration found. [main]
10:04:38,932 jmri.jmrix.loconet.LnPacketizer?????? INFO? - lnPacketizer Started [main]
10:04:38,933 i.jmrix.loconet.hexfile.LnHexFilePort INFO? - LocoNet Simulator Started [LocoNet HexFileFrame]
10:04:39,029 jmri.jmrit.roster.Roster????????????? INFO? - Reading roster file with rootFromName(/Users/das/JMRI/_Profiles/) [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path program: is /Applications/JMRI/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path preference: is /Users/das/JMRI/_Profiles/Dispatcher.jmri/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path profile: is /Users/das/JMRI/_Profiles/Dispatcher.jmri/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path settings: is /Users/das/Library/Preferences/JMRI/ [main]
10:04:39,207 jmri.util.FileUtilSupport???????????? INFO? - File path home: is /Users/das/ [main]
10:04:39,208 jmri.util.FileUtilSupport???????????? INFO? - File path scripts: is /Users/das/JMRI/_Profiles/Dispatcher.jmri/ [main]
10:04:39,631 apps.PanelPro.PanelPro??????????????? INFO? - Main initialization done [main]
10:04:44,142 jmri.configurexml.LoadXmlConfigAction INFO? - Loading selected file: /Users/das/JMRI/_Profiles/ [AWT-EventQueue-0]
10:04:45,138 t.display.layoutEditor.BlockValueFile INFO? - 4 of 4 block values restored. Rule=RESTOREONLYIFALLOCCUPIED, Power=OFF [AWT-EventQueue-0]
10:05:07,501 jmri.jmrit.audio.JoalAudioFactory???? INFO? - Initialised JOAL using OpenAL: vendor - OpenAL Community version - 1.1 ALSOFT 1.23.1 [Listed Table Generation]
10:06:10,519 rit.logixng.actions.LogLocalVariables WARN? - Log local variables: [JMRI LogixNGThread]
10:06:10,520 rit.logixng.actions.LogLocalVariables WARN? -???? Name: sigtype, Value: , java.lang.String [JMRI LogixNGThread]
10:06:10,520 rit.logixng.actions.LogLocalVariables WARN? -???? Name: mgr, Value: jmri.jmrit.dispatcher.DispatcherFrame[frame0,564,261,954x512,invalid,layout=java.awt.BorderLayout,title=Dispatcher,resizable,normal,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,28,954x484,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true], jmri.jmrit.dispatcher.DispatcherFrame [JMRI LogixNGThread]
10:06:10,525 rit.logixng.actions.LogLocalVariables WARN? - Log local variables done [JMRI LogixNGThread]
10:06:14,747 g.implementation.DefaultConditionalNG WARN? - ConditionalNG IQC:AUTO:0001 was aborted during execute: jmri.jmrit.logixng.util.parser.CannotCallMethodException: Can not call method getSignalTypeString() on object jmri.jmrit.dispatcher.DispatcherFrame[frame0,564,261,954x512,invalid,layout=java.awt.BorderLayout,title=Dispatcher,resizable,normal,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,28,954x484,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] [JMRI LogixNGThread]
jmri.jmrit.logixng.util.parser.CannotCallMethodException: Can not call method getSignalTypeString() on object jmri.jmrit.dispatcher.DispatcherFrame[frame0,564,261,954x512,invalid,layout=java.awt.BorderLayout,title=Dispatcher,resizable,normal,defaultCloseOperation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,28,954x484,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
at jmri.jmrit.logixng.util.parser.ExpressionNodeMethod.calculate(ExpressionNodeMethod.java:173) ~[jmri.jar:?]
at jmri.jmrit.logixng.util.parser.ExpressionNodeComplex.calculate(ExpressionNodeComplex.java:24) ~[jmri.jar:?]
at jmri.jmrit.logixng.util.parser.ExpressionNodeAssignmentOperator.calculate(ExpressionNodeAssignmentOperator.java:234) ~[jmri.jar:?]
at jmri.jmrit.logixng.actions.DigitalFormula.execute(DigitalFormula.java:145) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultMaleDigitalActionSocket.execute(DefaultMaleDigitalActionSocket.java:45) ~[jmri.jar:?]
at jmri.jmrit.logixng.tools.debugger.DebuggerMaleDigitalActionSocket.execute(DebuggerMaleDigitalActionSocket.java:35) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultFemaleDigitalActionSocket.execute(DefaultFemaleDigitalActionSocket.java:37) ~[jmri.jar:?]
at jmri.jmrit.logixng.actions.DigitalMany.execute(DigitalMany.java:116) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultMaleDigitalActionSocket.execute(DefaultMaleDigitalActionSocket.java:45) ~[jmri.jar:?]
at jmri.jmrit.logixng.tools.debugger.DebuggerMaleDigitalActionSocket.execute(DebuggerMaleDigitalActionSocket.java:35) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultFemaleDigitalActionSocket.execute(DefaultFemaleDigitalActionSocket.java:37) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultConditionalNG.internalExecute(DefaultConditionalNG.java:173) ~[jmri.jar:?]
at jmri.jmrit.logixng.implementation.DefaultConditionalNG$ExecuteTask.run(DefaultConditionalNG.java:216) ~[jmri.jar:?]
at jmri.jmrit.logixng.util.LogixNG_Thread.lambda$new$0(LogixNG_Thread.java:148) ~[jmri.jar:?]
at java.lang.Thread.run(Thread.java:840) [?:?]

Doing a Jython print of the result of jmri.InstanceManager.getDefault(..) returns the same content, but Jython is still able to resolve the method calls.

Dave Sand



----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Saturday, September 07, 2024 3:34 AM

Dave,

> For Dispatcher, the DispatcherFrame class is both the Dispatcher manager and the main JmriJFrame.? The "InstanceManager" function returns the JFrame, not the object.

Can you explain this?

Create a ConditionalNG that calls the InstanceManager to get the instance of DispatcherFrame and put it in a local variable. Then use LogLocalVariables with show class name. What class name do you get?

Daniel

On 2024-09-06 16:43, Dave Sand wrote:
Daniel,

It could be done using LogixNG except for one problem.

The "InstanceManager" function normally returns a manager object, for example using a formula such as:

mgr = InstanceManager.getDefault("jmri.Sensor")

where "mgr" is a local variable. ?For Dispatcher, the DispatcherFrame class is both the Dispatcher manager and the main JmriJFrame. ?The "InstanceManager" function returns the JFrame, not the object.

Dave Sand


----- Original message -----
From: danielb987 <jmri@...>
Subject: Re: [jmriusers] Getting throttle settings with LogixNG
Date: Friday, September 06, 2024 9:07 AM

Jos,

No, not currently. But you can use a Jython script to do that. Hopefully someone else will join in and give you an example on a Jython script for it.

Daniel

On 2024-09-06 15:11, Jos Smeele wrote:
Is there a way that I can query an active throttle with LogixNG and, for instance, store the current speed in a local variable with LogixNG?
I want to get the current train speed with LogixNG when Dispatcher is executing Transits.
I've learned that Memory variables can be queried with: memories.getMemory(<memory name>) so is there something similar for throttle data?
Thanks,
Jos




Locked Re: Parse Error: Reporter (Which I don't need) #reporters

 

I poorly stated I was trying to Load Table Content and Panels.? When I try that, I get the error message above.
?
I'm reasonably conversant with editing XML files in that I've done some machine language programming on USAF Flight Simulators (F-4E, C-141, C-5A).
?
If you can direct me to open the correct file, find the line, and how to edit it, I think I can follow those directions.? I:m not conversant with Java to be able to develop my own code.? In my 80s, I think its too late to learn that.? I've been retired 35 years from doing this stuff, but I still understand how to do it.
?
Thanks for the response,? it gives me some hope.
?
Bill B
?


Locked Re: Precise position of trains and maneuvers automation

 

Nags,

The phrase, "exited one block and entered a new block", is not true. ?The time to traverse a block is the elapsed time from the entry of a block to the entry of the next block in the direction of travel. ?This eliminates any issues with train length or the presence of detectable wheel sets on rolling stock.

Dave Sand

----- Original message -----
From: "Nags via groups.io" <snowy999=[email protected]>
Subject: Re: [jmriusers] Precise position of trains and maneuvers automation
Date: Saturday, September 07, 2024 4:58 PM

As far as I understand warrants, JMRI uses the entry into a block (oblock) as a reference point to determine what if any actions it needs to take. It is unaware of anything within the block.
?
Therefore, when the block becomes occupied JMRI 'knows it has exited one block and entered a new block. This allows it to determine two things:
  • the trains performance - how long it took to traverse the previous block and whether it was too fast or slow requiring tuning of the throttle/speed ratio.
  • what the train needs to do next. On entering the block it knows the current speed, it knows the length of this block and upcoming paths and blocks. It determines what if any actions are needed for any upcoming speed requirements e.g. a danger signal, it has the reference point to calculate the distance to cover and then determine the throttle settings and timing for deceleration required to stop the train to avoid passing the signal.
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.8 DecoderPro/Warrants/CPE/SML/LogixNG
Windows 10


Locked Re: Parse Error: Reporter (Which I don't need) #reporters

 

Bill,

What do you mean by "load all files"? ?There is only one file that contains table content and panels. ?There are separate files for operations, and the roster, but the main PanelPro content with tables and panels is in one file.

How good are you at editing xml?

Dave Sand


----- Original message -----
From: sontrak <sontrak@...>
Subject: [jmriusers] Parse Error: Reporter (Which I don't need)
Date: Saturday, September 07, 2024 4:12 PM

I was experimenting with reporters just to see what they do, then abandoned that to go on to something I elt was more impotant at my stage of panel development.? Saved the files and shut down? for the night.? Today I can't Load? all files but ge this error message.
?
Parse error
while parsing file /C:/Users/Tra, ins/JMRI/My_JMRI_ Railroad.jmri/Layout.xml
Exception: org.jdom2.input.JDOMParseException: Error on line 2215: cvc-complex-type.2.4.a: Invalid content was found starting with element reporter. One of [systemName, path)' is expected
See for more information.
Skip message for this session only?
OK
?
Can someone help me erase the offending enrty, or otherwise clear the problem?
?
Thanks so much for participating in this group and helping us who get in trouble.? Without you guys, I would not be able to set up and run JMRI.
Bill B