Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Locked
Dispatcher Scripting support
#dispatcher
#scripting
Hi there,
?
I have been using JMRI for a while but for the first time I am stuck with something. I am running some scripts but I think it yet not possible to do the following :
I use a python script to automate the creation of active train in the dispatcher using : jmri.jmrit.dispatcher.DispatcherFrame createActiveTrain setStarted
I run my trains using auto allocate and release of sections, with auto allocation to next safe section. However in some cases I would like to be able to force some more allocation as it is possible using the dispatcher button bellow, I would like to do so in a script. I found out that ? and ? are not available (private) may be I miss something?
?
Best
?
|
Vdrien
I dont think its that simple.
The routines mentioned act on a transit to get the next section.
The allocate extra can allocate 1 section further, but auto trains cannot always use it and it doesnt always set the switchs.. Its designed for manual driving of the train and is limited to adding only one additional section.
The bext way way is to just create a new train from where you are with a new transit to get where you want to go, it has the advantage of being able to go anywhere.
Using a script simple terminate the train and create anew one.?
You can do the same thing with Transit Actions.
?
Look to see how its done in the "Dispatcher System" in the jython library.
?
Steve G.
? |
On Thu, Sep 26, 2024 at 02:49 PM, Steve_G wrote:
In the last transit step, "LoadTrainInfo" the next transit, then "Terminate" current transit after a 1.5 second delay.
The delay allows the next transit load get started.
--
Ken NYNH&H, Old Colony Division, Cape Cod Branch (1949-1959) Loconet * JMRI 5.9.3 * OSX,Win10,Ubuntu Blog: ?
Youtube:
|
Hi Steve, thanks for your reply and your time. Maybe I am not looking at the good routines.
I am running the trains manually, in most case autoallocating to next safe section is perfectly doing the job. But in some specific cases I really would be happy to allocate to the train one more section than the next safe section. I don't think this has something to do with starting a new train.
?
I can successfully manage it manually by clicking the "Allocate" button as shown in my previous message but given that I know the specific circumstance where I want to do so I would be happy to be able to automate those clicks on "Allocate". Any more thoughts?
? |
Do you want to allocate the next section early or do you want to add an extra section to the active train? Dave Sand ----- Original message ----- From: vdrien <adrien.virolleaud@...> Subject: Re: [jmriusers] Dispatcher Scripting support #dispatcher #scripting Date: Sunday, September 29, 2024 4:34 AM Hi Ken, Thanks for the answer I successfully create the next transit but my need is to be able to trigger some allocation in scripting. |
Hi Dave,
?
Yes I want to allocate the next section early exactly the same way it can be done with the user interface bellow but within a script.
?
The sequence would be : (1) The train enters a section, (2) the dispatchers auto allocates to next safe section, (3) the first next section to that safe section is requested and pending for dispatch, (works fine until there), (4) the script can if some custom conditions are met, allocate that next section. All this according to the transit, no need to add any section to it.
Thanks Adrien
|
Hi and thanks again for your reply. I found the Allocate Pass Safe Section, thanks you I did not know about it, I read the page about transit actions and could not find it, is It quite new?
?
Nothing seems to happen, from my understanding it is because the train in the transit is driven manually? If so I still have not found a way not to click on that Allocate button, sorry for being very specific.
|
Hi Steve,
Thanks for your reply, I have to admit it raised a lot of questions on my side. I have done some testing unfortunately in a simulator as I don't have access to my layout right now.
Anyway as I read in the documentation on actions there seem to be only executed for autotrains, so my manually driven active train is not concerned and don't get its section allocated.
(.)
?
Please find bellow a screen of the demo situation :
On section S12M entry, after 1 sec as in previous example it should allocate past next section. This doesn't happen.
As you can see I added a terminate train action on the next section entry (S13M) The active train entered the section but nothing happen.
I am quite convinced that actions are not useful in my case has it seems that the only "executeAction" is in jmri.jmrit.dispatcher.AutoTrainAction ?()
?
Sorry but I still looking on a way to automate my clicks on Allocate, would it be possible to have a public use of?
allocateNextRequestedForTrain
?
Many thanks,
?
Best
?
|
On Sun, Oct 6, 2024 at 02:25 PM, vdrien wrote:
Unfortunaetly that code bypasses the autoallocator and is not thread safe.? It was written for someone hitting the button, haveing a beer and comeing back and hitting another button. If I was to do anything I would disable it when the autoallocator was running. It requires the gui as it puts out messages about "Do you know what your doing?" ?
If you load up youre xml file to problem being worked on we might be able to see whats happening, the picture shows no technical details.
?
Steve G |
Right I misspoke earlier, transit actions only work against an automated train , they mostly need a throttle. Steve G. On Thu, 17 Oct 2024 at 09:16, Steve_G via <RailRodder22=[email protected]> wrote:
|
to navigate to use esc to dismiss