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
- Jmriusers
- Messages
Search
Locked
Re: How to terminate python script
¡°f¡± is the thing you need to keep. It¡¯s the JFrame object that you create in your setup(..) method. ¡°f¡± is a local variable now, you have to save it somehow. You can either put it in a global variable, or you can put it in the object you create by referring to it as ¡°self.f¡± everywhere, and the using a.f to refer to it.
Bob On Aug 14, 2018, at 3:13 PM, Fred Miller via Groups.Io <tractionfan@...> wrote:-- Bob Jacobsen rgj1927@... |
Locked
Re: Layout editor turnout control issue
Thanks Dave, some progress, but still not there! I set the turnouts to BSTURNOUT and I also tried BSOUTPUT. The feedback changed from unknown to inconsistent when clicked. I got the animation on the panel but it still only clicks the one way... Is it a DCC++ problem I wonder?
|
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
James,
Dispatcher already has the logic for working out how to allocate sections to trains. To it, a train follows a route of a series of sections. So when you tell it to start a train, it will work along allocating and releasing sections. -Ken Cameron, Member JMRI Dev Team www.jmri.org www.fingerlakeslivesteamers.org www.cnymod.com www.syracusemodelrr.org |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
Ken,
thank you for your reply. In very general terms, that is what I had already understdood to be the case. However, what I am not clear on is quite what abstraction capabilities are built in and what have to be scripted. Take transits, for instance. There is no way of permitting more than one train to be travelling the same transit at once, so I imagine that the way of acheiving something similar to this would be a higher level class (scripted) concatenating lots of very short transits. In this case, the whole abstraction for this, all the variables, the UI and the logic would have to be scripted, I presume, and then several layers more abstraction on top would also have to be scripted to deal with actual timetabled working - is this correct? I am finding it very difficult to get detailed information on what abstractions that JMRI is capable of internally and what needs to be done by way of scripting - and I think that I am correct in concluding that scripting is not really suitable for large-scale abstraction logic, although if somebody has achieved this successfully, please do let me know, as this would be most interesting to observe. It looks like "AutoDispatcher 2" is perhaps the closest that anyone has come to this, but I cannot find any documentation on its capabilities, so it is very difficult to understand what this is really able to do (and this is already a very substantial piece of software in itself). |
Locked
Re: How to terminate python script
Bob, thanks for the quick response.
However I am not quite sure I know how to establish a reference to the window. Below is a brief skeleton of my script.? Is "f" the window reference? class ThrottleA(jmri.jmrit.automat.AbstractAutomaton) : .... followed by a bunch of listener classes, e.g. ? class F0Listener(javax.swing.event.ChangeListener) : ?? ?def stateChanged(self,event) : ???... etc ?? ?def init(self): ??.... ????return ?? def relThrottle(self,event): ???? self.throttle.release() ??? ?print("Release") ? ??***>>>> here's where I would like to close the window ??? return .... followed by a bunch of other defs, then... ?? def setup(self): ??.... establish buttons, panels and the JFrame, e.g. ?? f = javax.swing.JFrame("CAB 41",preferredSize = (250,250)) ??.... layout the panels, e.g. ?? f.contentPane.add(self.panel1) ?? f.pack() ?? f.show() ?? self.start() ?? return a = ThrottleA() a.setName("ThrottleA Code") a.setup() Appreciate your help Fred Miller |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
James,
Some of what you want would be a script or user interface that in turn is driving Dispatcher. So the start and termination of the trains would be in the upper level and it treats all of Dispatcher as the lower level. -Ken Cameron, Member JMRI Dev Team www.jmri.org www.fingerlakeslivesteamers.org www.cnymod.com www.syracusemodelrr.org |
Locked
Re: NCE POWER PRO
Thank you for the help. I'm going buy another cable later. I now have both my computers up and running JMRI with Power Cab and Power Pro. Now to get them setup on One Drive for the roster info. It's great when things go the right way. When I retired they gave this HP Stream and I said that would be great to use on the layout?with JMRI and now I'm a happy railroader.
Bob |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
Thank you for your response - that is helpful. I do not think that a procedural system is really suitable for full timetable based automation of a large layout, as I need to be able to amend the timetable without having to reprogram (and debug) a script - for anything non-trivial, it is important that data be separated from code.
Is there no means of achieving timetabling in JMRI with a higher level of abstraction? |
Locked
Re: How to terminate python script
To close a window, you keep a reference to that window (i.e. called myFrame) and then do either:
myFrame.setVisible(False) myFrame.dispose() _or__ myFrame.dispatchEvent(java.awt.AWTEvent.WindowEvent(myFrame, java.awt.AWTEvent.WindowEvent.WINDOW_CLOSING)) (I haven¡¯t checked that these are exactly Jython syntax; they¡¯re copied from Java and adjusted) The first one is simpler, but doesn¡¯t __quite_ do exactly what the close button does. The second is exactly the same as clicking the button. Bob On Aug 14, 2018, at 12:53 PM, Fred Miller via Groups.Io <tractionfan@...> wrote:-- Bob Jacobsen rgj1927@... |
Locked
Re: XML code question: panel size
¿ªÔÆÌåÓýIn my panel's xml file, <LayoutEditor, what is the difference between? Those values are ignored because they're now stored per-machine (not per-layout). The "zoom to fit" re-calculates those values; You just need to re-save your layout and then use the Options menu, "Save Location and Size" item. |
Locked
Re: New file uploaded to [email protected] - tcs-wow.zip
On Tue, Aug 14, 2018 at 05:11 AM, Greg Komar wrote:
Greg, We don't go back and modify a releases. These changes will be applied in 4.13.3. If you wish to use the modified files you can download from the link provide and install the changes yourself following the instructions provided in the zip file. -- Peter Ulvestad JMRI Users Group Moderator - ( ) Tam Valley Group Moderator - ( ) Sprog-DCC Group Moderator - ( ) Edmonton Model Railroad Association - |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
James,
toggle quoted message
Show quoted text
YAAT is procedural oriented but flexible. As such, it is as you described. Set turnout, move at this speed, wait for something to change, etc. YAAT evolved while helping a guy in England automate trains without block detection. He uses IR detectors at the stations. The first part of the script has the documentation. The zip file has a demo panel and text files that I use for testing. The most complex one has two trains coming from branches to the main station and back again. It uses a sensor group to control which train has access to the shared mainline. I am working on version 1.7 which adds memory variables. This would the provide access to IMCURRENTTIME. That would still be procedural but would allow actions based on time. Dave Sand On Aug 14, 2018, at 12:17 PM, jamespetts via Groups.Io <jamespetts@...> wrote: |
Locked
Re: Scripts
Dear Paul,
Thank you for your reply. It is kind of you that you are going to look into the matter further. Can you get me a log of how the railcom detection messages are showing up from the Roco 10808 sections?Unfortunately I don't know how to get such a log.? There is a program called "Z21 Maintenance Tool" that can be used to make the Roco10808 emulate R-Bus and/or LocoNet and/or Lissy/Marco detection. Yours, ????????????? Gabor |
Locked
Re: Entering New Loco's in DEcoder Pro
??? I agree with you that decoders are becoming more sophisticated, but applying more (up to the safe limit)?voltage has been recommended by just about everyone who uses digital devices. I learned this as an auto tech, we couldn't get the express up feature on Mercedes without starting the car or using a battery charger. Car batteries are 12.5 volts but run at 14.5+. I have worked at many dealers where a battery charger had to be installed to do most reprogramming. Just my 2 cents.?????? Jim
|
Locked
Re: NCE POWER PRO
¿ªÔÆÌåÓýMany of us use an ESU cable (has a genuine FTDI chipset) for our Power Pro. Another one only costs ~$30 from an ESU dealer and doesn't need an M-F extender cable to fit. The?UN8-BE from RRCirKits is similar and also works well with the Power Pro. More economical than the Keyspan and work every bit as well. We use the ESU ones with an active 10metre USB extender as well at times. --? Dave in Australia The New England Convention 2018 On 15 Aug 2018, at 12:20 AM, Bob via Groups.Io <GMRC405@...> wrote:
AIU is set default not enable. |
Locked
Re: Inconsistent behaviour with the dispatcher
Thank you for that. I have now enabled this. With the debug level enabled, the output logging for a single train is now as follows:
2018-08-14 18:21:53,714 util.Log4JUtil??????????????????????? INFO? - * JMRI log ** [main]I hope that this assists. |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
David,
thank you for your response. I had heard of YAAT, but the description gave me the impression that it was really only a template for simple procedural scripts of the "set throttle on train no. 21 to 60%, then throw turnouts nos. 7 and 8" sort rather than a system using a higher level of abstraction. If this impression was incorrect, may I ask where I can find documentation on this and in particular its use in non-trivial instances of timetabled automation? James. |
Locked
How to terminate python script
I have a python script which runs a nice throttle.? It builds a window with necessary buttons, etc.? However I am trying to figure a way of closing the window (terminating the script) from within the script but in the same way as clicking on the?red title bar close button.? I have tried "exit()" but that closes down PanelPro altogether.? I have tried "f.dispose()" as?in one of the example scripts but?since I have my script in a Class, I am apparently not getting the f.dispose()?at the right level. within the code.? I wanted to execute it from a defined function called from a button click.?
|
Locked
Re: Scripts
¿ªÔÆÌåÓý
Can you get me a log of how the railcom detection messages are showing up from the Roco 10808 sections? I know how the railcom detector built into the Z21 command station provides information to us, but it looks like the Roco 10808 might report things in different ways based on how it is configured.
Railcom detection is provided via a reporter object. ?It is not quite the same as a sensor, though there is a sensor associated with it. The example script: Shows generally how to work with reporters in a script. ?This is a bit LocoNet specific in handling the reporter output. ?I may have an example that can be used with the railcom objects provided by the Z21 command station¡¯s internal railcom detector. Let me look into that later today. Paul |
to navigate to use esc to dismiss