Keyboard Shortcuts
Likes
- Jmriusers
- Messages
Search
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
This kind of operation might require thinking outside the blocks.
I¡¯ve had small parts in the work on two different non-blocked systems for locating model-railroad rolling stock. *) One was RPS (), which even had some JMRI support (). It used ultrasound transmitters attached to DCC decoders for location. It worked, but it required hardware on engines and cabooses, and at the time was too expensive to be popular. *) The other, more recent one used a couple of RPi¡¯s with high-def video cameras looking at the layout to locate trains. Stable alignment was achieved through a couple of IR LEDs (visible to the cameras, not to people) buried on the layout. It basically worked, even separating trains on adjacent tracks in yards (which can be tricky because of shadows), although getting good coverage would have required more cameras because of poor layout sight-lines. Then it went sideways as my collaborators wanted to use IR LEDs to uniquely identify engines: More engine-by-engine hardware, etc. Neither of those projects really worked out, but either method might work with some real attention. Or there might be even better ideas! Bob On Aug 19, 2018, at 10:26 AM, Spuds McCat <spudsmccat@...> wrote:-- Bob Jacobsen rgj1927@... |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
The problem with multiple trolleys in sane block, us how does the computer know where to stop each one, if it's all 1 block. Theoretically, you could have Railcom feed how many are in block, and stop with space for leading trains, but this requires all trolleys to have Railcom, and you're hoping everything stops the same way each time. Alternative 2 is many small blocks with hidden virtual signals, so it looks the same, but many many more detectors required Alternative 3 is use dcc car (or DC car website is broken now so can't check official name) which hacjs a decoder so each car/trolly has an IR led shining behind it, and an IR detector to the front, so it can detect what's in front if it and slow/stop without hitting. It uses the brightness to determine now close it is and slow/ stop as appropriate.?? Due to having multiple trains in 1 block, i strongly suspect it'd be incompatible with Jmri automation. On Sun, Aug 19, 2018, 08:44 Andy Reichert <andy_r@...> wrote: Life gets even more away from US freight operations when one considers |
Locked
transfer problems
¿ªÔÆÌåÓýI am trying to transfer files from one computer to another.? Originally used DropBox between 3 computers, but found too easy to scramble files.? For computer in train room I deleted dropbox app, I did a new install of version 14 having uninstalled the previous version ?(other computers still have 11) and then tried putting different files on a USB stick formatted NTFS from Win10. ? Didn¡¯t seem to matter if I transferred the 6 operation files, a saved backup, or the entire JMRI folder from another computer.? In each instance, Trains were stripped of route info and route info showed up as orphans with no comments nor location data. ? What am I doing wrong?? Shouldn¡¯t be that hard.? Also have original dropbox files on computer ?that I tried putting in the JMRI folder with same problem. ? Gary Ray |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
The following is an important point.
On Aug 19, 2018, at 7:01 AM, whmvd <vandoornw@...> wrote: Everything in JMRI is available to the hobby because (1) somebody wanted to do it, (2) did it, and (3) was willing to share it with others. There are 280 people on the acknowledgements page () who¡¯ve done that (and if we missed anybody, please let me know!) Together, they¡¯ve written almost three million lines of code, decoder and signal definitions, help text, etc that together are available to people who want to use them. (In the last month, 19 authors have pushed 293 changes: ) It¡¯s all been done incrementally, in fits and starts, with occasional blind alleys as part of multiple approaches. _That_ _approach_ _works_. It¡¯s great to have discussions about new features, new approaches, improved capabilities. That¡¯s often step (0) in getting new things done, because it¡¯s a key part of (1) somebody wanting to do it. Wide-ranging discussions often helps people get motivated about a longer-term goal. It¡¯s also important to (2) and (3) done. That¡¯s where sometimes things hang up with they start off too audacious. ¡°There¡¯s so much here, how can I even imagine getting it done?¡± can make things harder. ¡°There¡¯s s much more to do, how can I share this now?¡± can prevent other people getting involved to help make faster progress. So I encourage people with all the great ideas in this thread to make a gentle start by just turning even small starting parts into code. A bit of script here, an added method in a Java class there, and start to see how it comes together. You¡¯ll learn a lot, most likely get a better understanding of what you¡¯re trying to do, and possibly even find people to work with you on it. Bob -- Bob Jacobsen jacobsen@... +1-510-708-5988 AIM, Skype JacobsenRG |
Locked
Re: Script warning message in system console: what is wrong (invoked from invalid context)?
(left the original post for context)
The "self.getThrottle(self.number, long)¡± method should only be called from within init() or handle(). It¡¯s OK if handle() calls something that calls something that calls something that calls getThrottle(), but the start has to be in either init() or handle(). Java allows programs to work effectively in parallel using threads. When one thread is stalled waiting for something to happen, another can still run. For some (but not all) DCC systems, getThrottle() takes time because it has to negotiate with the command station. In that case, the thread that calls getThrottle will be stalled for a second or so; sometimes longer. If that¡¯s your AbstractAutomat thread, the one with init() and handle(), no big deal: They¡¯ll pick up where they left off eventually, and weren¡¯t doing anything in the meantime. However, there are other threads that are handling things like mouse clicks and cursor movements. You really don¡¯t want to stall those. So if you start on a mouse click, and end up a getThrottle which stalls, the entire interface is going to stall. Not good, though perhaps OK if it¡¯s fast and only occasional. That second case, stalling the wrong thread, is what the message warns of. You¡¯re doing getThrottle in your whenMyButtonClicked routine, which is called from a button. A better pattern would be to just save the address and do the .start() operation, then have init() (which is called on your thread after start()) do the getThrottle. But if it¡¯s not broke, maybe you don¡¯t have to fix it. Bob On Aug 18, 2018, at 11:26 PM, LMSFAN72 <andrew@...> wrote:-- Bob Jacobsen rgj1927@... |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
Life gets even more away from US freight operations when one considers trolley layouts, of which there a considerable and growing number in Europe. And a few modern prototype examples in the US.
As well as being timetable driven, the case of several trolleys from the same or different routes becoming temporarily lined up nose to tail at a street junction traffic light, or busy passenger stop is quite common. And that does not lend itself at all to the simple present/absent block detection that seems to be assumed in much of the JMRI postings. The driver centric model where the driver obeys signals and reacts to obstructions only as observed from the cab would seem to require a lot of autonomous processing capability in the car itself, rather than relying entirely on sensor inputs to a central control function. Andy On 8/19/2018 7:01 AM, whmvd wrote: Thank you for the insights into how you look at time-tabling! It confirms what I thought, which is that there are many different and valid ways to look at it, and a one-solutio-fits-all approach is never going to happen. Because apart from the differences in the way people might want the automation via timetables to work, there is also the complication of layouts being wired and divided in blocks and fitted with signalling in wildly differing ways. Add to that decoder programming that can be of serious impact to automation, and the spectrum becomes nearly endlessly wide. Bringing it *all* together is not, I think, feasible - and that is what makes a generic JMRI time-table solution almost a non-starter. I'd love to be wrong, though. --- This email has been checked for viruses by AVG. |
Locked
Re: L1USB Ethernet Adapter Error ? Help
Paul, ? Have put my panel in the Files area for you to look at. I guess that what you are really saying is that if the system recovers and doesn't grind to a holt its OK.? I will add the remaining logix and put it to the test!?
Many thanks, Alan? |
Locked
Digitrax ditch light settings
I would like to have the ditch lights be on going forward and be able to flash when F2 is pressed.
Currently they always flash going forward. Function mapping has F1 both checked and F2 is unchecked. Lights have them as Right or Left Ditch light and On forward with Function on. Thanks, ILH |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
Thank you for the insights into how you look at time-tabling! It confirms what I thought, which is that there are many different and valid ways to look at it, and a one-solutio-fits-all approach is never going to happen. Because apart from the differences in the way people might want the automation via timetables to work, there is also the complication of layouts being wired and divided in blocks and fitted with signalling in wildly differing ways. Add to that decoder programming that can be of serious impact to automation, and the spectrum becomes nearly endlessly wide. Bringing it *all* together is not, I think, feasible - and that is what makes a generic JMRI time-table solution almost a non-starter. I'd love to be wrong, though. My own thoughts would go along the lines of- All blocks need detection. - Signalling must be complete (virtual signals if nothing else). At the moment, I haven't even got my layout yet. But I plan to build it in a way that will allow me to work on this time-table project. Don't know if I can finish it this century, of course... On 19 August 2018 at 12:19, jamespetts via Groups.Io <jamespetts@...> wrote: Unless I have missed something in this thread, the impression that I am getting is that timetables are not a built-in function of JMRI at all (with the possible exception of the schedules in Operations, but this seems to be aimed specifically and exclusively at U. S. style freight operations). It appears (unless I have missed something important, in which case I should be very grateful if someone could bring this to my attention, as obtaining this information was one of the main purposes of me starting this discussion) that it is necessary for anyone wishing to use JMRI with timetables to code this entire functionality from scratch using Jython scripts. |
Locked
Re: L1USB Ethernet Adapter Error ? Help
Alan,
On Aug 19, 2018, at 6:26 AM, Alan Gibbs <buggydriver17@...> wrote:I don¡¯t think there is anything wrong there. It is really hard to eliminate all possible sources of interference and data corruption which is why we implement the automatic recovery process for communication errors. I have factory reset the adapter and set up a small table with 5 logix's which control signals, which are disabled at start up. After opening the program and operating a few turnouts from the layout diagram the are no errors on the console. Enable the 5 logix and return to the console shows:-JMRI is doing what it is supposed to do here. It is recovering when the interface detects an error. Send me a copy of the panel file and I will see if there is anything in the panel that could be contributing to the number of repeated messages you are seeing. I suspect that operating that turnout generates a disproportionately large number of XPressNet messages when the logix is enabled. I look forward to your response but wonder if I'd be better off using a USB adapter ?Perhaps, but unless the recovery is impacting performance, you aren¡¯t going to see any difference. I have found the Ethernet interface is generally the most reliable interface to Lenz systems, especially with Windows machines. Paul |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
Unless I have missed something in this thread, the impression that I am getting is that timetables are not a built-in function of JMRI at all (with the possible exception of the schedules in Operations, but this seems to be aimed specifically and exclusively at U. S. style freight operations). It appears (unless I have missed something important, in which case I should be very grateful if someone could bring this to my attention, as obtaining this information was one of the main purposes of me starting this discussion) that it is necessary for anyone wishing to use JMRI with timetables to code this entire functionality from scratch using Jython scripts.
Somebody already appears to have done this with a script called "AutoDispatcher 2", which is available from the JMRI script examples download page. Unfortunately, no documentation of any sort appears to be available for this, so the only way of using this would be to read the code and try to infer how it works from that. "AutoDispatcher 2" is quite an extensive script and amounts to a substantial piece of code in and of itself. It includes a large amount of code for parsing timetables in a text format (no documentation is given as to what this format is, but one could, if one were willing to spend a considerable amount of time, infer this from reading the code). Unless I am missing something (and please let me know if I am), it seems that what would be needed for timetable operation is a script that could do at least all of the following things:
These are just the essentials. Much more complex logic (interacting with many of the elements above, making each of those elements considerably more complex) would be needed if one were to want to have optional partial manual intervention for either signalling/dispatching or driving (and, if for both, doubly complex), or if one were to want to have a means of automated shunting on the layout (in which case a whole abstraction layer representing individual unpowered vehicles and logic for coupling/uncoupling them and keeping track of whether they are actually coupled/uncoupled on the layout would be necessary, as well as a way of integrating that abstraction layer with all of the logic above). Unless I have missed something (in which case, I should be extremely grateful for the details), JMRI, whilst clearly very capable in many respects, does not have any of the above features (or functionally equivalent features) built-in, and these would need to be coded in a script to allow for timetabled functionality to be set up on any given layout by just entering data rather than writing code. What I understand that most people who want automatic operation with JMRI do is, rather than write general code of the above sort and then implement it in JMRI with data in the form of a timetable which can easily be changed, instead write a procedural script specific to both layout and timetable. So, for example, instead of writing a text/XML/etc. file with a diagram of movements identified by layout data and then setting times for each workings of that diagram in the same way, they might write a script with a whole sequence of very specific commands as to what should happen in JMRI and on the layout (e.g., move train no. 15 from block A to block C at internal time 1515h; when train no. 15 has reached block C, move train no. 19 from block D to block E, etc.), which would require re-programming the script if any changes were to be made to the timetable or layout and would probably require the layout to be in a very specific starting state as regards the position of rolling stock for it to work. (I do not know for sure how these scripts actually work because I have not seen one, but I am inferring how they are likely to work from discussion on this topic and elsewhere). These procedural scripts are easier to code individually than the logic necessary for generalised timetabled operations as described above, but lots of people coding lots of procedural scripts like this takes vastly more time collectively than somebody writing the general logic described above once and for all, and then everybody else using what has already been written by just adding data for their own layouts (and possibly enhancing the script and sharing the enhanced script if any deficiencies are found). If "AutoDispatcher 2" were better documented, it might well be possible to use this as a starting point, but, without documentation, it would require almost as much effort to work out what it does and how it does it as to code this in the first place, which effort may then turn out to be wasted if it transpires that this script is not robust or flexible enough. Providing for this sort of functionality in a script seems to me to be sub-optimal: ideally, timetable capabilities would be a core part of the program itself. Indeed, this is what OperationsPro appears to be intending to do, but, from what I can discern, it is very narrowly focussed on the types of operations for which it is designed. Because of this, I have not looked in detail at is capabilities. For my own part, because I do not consider that, for my purposes, a procedural approach would be workable (owing to the complexity of the layouts and timetables that I am wanting to run, which would make a procedural system unmaintainable and lacking in robustness; it would work much better in a simpler case), and because of the amount of work that would be involved in coding (and, more importantly debugging) general purpose timetable logic as described above, I am currently leaning towards using Traincontroller for my own layouts. When I was first looking into this topic, there were quite a few people who were recommending Traincontroller over JMRI for the sort of timetabled operations that I was interested in and stating in quite general terms that it would take more work to achieve this in JMRI. I should have found it very useful then to have known the specifics that I set out above, as "more work" can mean a lot of different things. It turns out that "more work" means writing timetabling capabilities more or less from scratch. I do not mean by any of this to be unkind to the dedicated people who write and maintain JMRI in their spare time for free. I develop open source software in my spare time myself (Simutrans-Extended, in case anyone is interested, as it is somewhat relevant to peoples' interests here), and I know that lack of coding resources holds back a myriad desirable features. Clearly, JMRI is good software and is suitable and very useful for a whole range of things. However, unless I am missing something, it seems at present as though having robust generalised timetabling requires writing in a script code in amount and complexity comparable to an entire non-trivial software application, which is a bit much for someone who simply wants to get a layout or two going, even someone who develops (a fork of) a C++ open source game in his spare time. |
Locked
Re: Flashing panel icons - bug or feature
Hi Petr
Earlier versions of Java (up to 1.6) did not have very good facilities for rotating images, so the JMRI code is not able to rotate animated .gifs while retaining the animation (what you get is quite random unfortunately ranging from the front image to blank). The currently used Java version (1.8) does have some improved image rotating capability - but it requires someone with suitable knowledge and time to re-write the JMRI rotation code to use the features in the newer Java versions. Some signal systems have alternative non-animated graphics which can be used instead when the images are rotated. Suzie x |
Locked
Re: L1USB Ethernet Adapter Error ? Help
Paul,
? ? ? ? ? The adapter and PC are both ethernet connected to a tp-link10/100 desktop switch by short cables, the switch is connected to the router by a good quality ethernet cable about 40 mtrs long. ? I can't see anything wrong here. Also I disconnected all other ethernet connections on the router but this has no effect on the errors. I have factory reset the adapter and set up a small table with 5 logix's which control signals, which are disabled at start up.? After opening the program and operating a few turnouts from the layout diagram the are no errors on the console. ? Enable the 5 logix? and return to the console shows:- audio.JoalAudioFactory ? ? ? ? ? ? ? ? ? ? INFO - Initialised ¡¡¡ jmrix.AbstractMRTrafficController ?? ERROR - Automatic recovery from error message..... I then operated a turnout (twice) which is in a logix and got 9 errors ! Repeating this causes errors about 40% of the time so the errors build up rapidly on the console. I look forward to your response but wonder if I'd be better off using a USB adapter ? Regards, Alan |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
Hi all, I'm hugely interested in mixing timetables with manual operation of trains, and I'm sure to go that way eventually. (small detail: I'll need a layout first).On 18 August 2018 at 23:38, Dave Sand <ds@...> wrote: James, |
Locked
Script warning message in system console: what is wrong (invoked from invalid context)?
Hi
I have put together a script that shuttles a selected loco back and forth between 2 sensors a selectable number of times. The script opens a window panel to select a loco from a drop down box populated from my roster and allows the user to enter the number of back and forth (I called them loops). The window is designed to stay open so another loco can be selected when the first has finished. The window can then be closed with it's own button. The script executes fine but I have noticed when I run the console that I get a warring message: automat.AbrstractAutomaton ? ?WARN - getThrottle invoked from invalid context I wonder what is causing the message, and how I might improve the code to avoid it. Outline of my code below: import java
import javax.swing
import jarray
import jmri
?
class Test_Track_Shuttle(jmri.jmrit.automat.AbstractAutomaton) :
?
? ? def init(self):
? ? ? ? self.status.text = "Initiating"
?
? ? ? ? # set up sensor numbers
? ? ? ? # fwdSensor is reached when loco is running forward
?
? ? ? ? # set up sensor numbers
? ? ? ? # fwdSensor is reached when loco is running forward
? ? ? ? self.fwdSensor = sensors.provideSensor("RH")
? ? ? ? self.revSensor = sensors.provideSensor("LH")
? ? ? ? # get loco address.
? ? ? ? print ("getting throttle")
? ? ? ? self.status.text = "Getting throttle"
?
? ? ? ? return
?
? ? def handle(self):
? ? ? ??
? ? ? ? print ("Inside handle(self)")
? ? ? ? if self.loopCnt.text == "":
? ? ? ? ? ? Xmax = 1
? ? ? ? else:
? ? ? ? ? ? Xmax = int(self.loopCnt.text) ? ?
? ? ? ? x = 1
? ? ? ? while x <= Xmax:
? ? ? ? ? ? loops = str(Xmax - x + 1)
? ? ? ? ? ? print(" ".join(["Shuttle Cycles Remaining:", loops]))
? ? ? ? ? ? # set loco to forward
? ? ? ? ? ? print ("Set Loco Forward")
? ? ? ? ? ? self.throttle.setIsForward(True)
?
? ? ? ? ? ? # wait 1 second for layout to catch up, then set speed
? ? ? ? ? ? self.waitMsec(1000) ? ? ? ? ? ? ? ??
? ? ? ? ? ? print ("Set Speed")
? ? ? ? ? ? self.throttle.setSpeedSetting(0.3)
?
? ? ? ? ? ? # wait for sensor in forward direction to trigger, then stop
? ? ? ? ? ? print ("Wait for Forward Sensor")
? ? ? ? ? ? self.waitSensorActive(self.fwdSensor)
? ? ? ? ? ? print ("Set Speed Stop")
? ? ? ? ? ? self.throttle.setSpeedSetting(0)
?
? ? ? ? ? ? # delay for a time (remember loco could still be moving
? ? ? ? ? ? # due to simulated or actual inertia). Time is in milliseconds
? ? ? ? ? ? print ("wait 20 seconds")
? ? ? ? ? ? self.waitMsec(20000) ? ? ? ? ?# wait for 20 seconds
?
? ? ? ? ? ? # turn on whistle, set direction to reverse, set speed
? ? ? ? ? ? self.throttle.setF3(True) ? ? # turn on whistle
? ? ## ? ? ? ?self.waitMsec(1000) ? ? ? ? ? # wait for 1 seconds
## ? ? ? ? ? ?self.throttle.setF3(False) ? ?# turn off whistle
? ? ## ? ? ? ?self.waitMsec(1000) ? ? ? ? ? # wait for 1 second
?
? ? ? ? ? ? print ("Set Loco Reverse")
? ? ? ? ? ? self.throttle.setIsForward(False)
? ? ? ? ? ? self.waitMsec(1000) ? ? ? ? ? ? ? ? # wait 1 second for Xpressnet to catch up
? ? ? ? ? ? print ("Set Speed")
? ? ? ? ? ? self.throttle.setSpeedSetting(0.3)
?
? ? ? ? ? ? # wait for sensor in reverse direction to trigger
? ? ? ? ? ? print ("Wait for Reverse Sensor")
? ? ? ? ? ? self.waitSensorActive(self.revSensor)
? ? ? ? ? ? print ("Set Speed Stop")
? ? ? ? ? ? self.throttle.setSpeedSetting(0)
?
? ? ? ? ? ? # delay for a time (remember loco could still be moving
? ? ? ? ? ? # due to simulated or actual inertia). Time is in milliseconds
? ? ? ? ? ? print ("wait 20 seconds")
? ? ? ? ? ? self.waitMsec(20000) ? ? ? ? ?# wait for 20 seconds
?
? ? ? ? ? ? # turn on whistle, set direction to forward, set speed
? ? ? ? ? ? self.throttle.setF3(True) ? ? # turn on whistle
? ? ## ? ? ? ?self.waitMsec(1000) ? ? ? ? ? # wait for 1 seconds
## ? ? ? ? ? ?self.throttle.setF3(False) ? ?# turn off whistle
? ? ## ? ? ? ?self.waitMsec(1000) ? ? ? ? ? # wait for 1 second
?
? ? ? ? ? ? # and continue around again
? ? ? ? ? ? x = x+1
? ? ? ? # release when done ? ? ? ? ? ? ? ??
## ? ? ? ?self.throttle.release()
## ? ? ? ?self.throttle = None
? ? ? ? #re-enable button
? ? ? ? self.startButton.enabled = True
? ? ? ? print ("End")
? ? ? ? return 0 # handle() is called repeatedly until it returns false.
?
?
?
? ? def doClose(self, event):
? ? ? ? print("Close")
? ? ? ? # **** close command here ****
? ? ? ? self.f.setVisible(False)
? ? ? ? self.f.dispose()
? ? ? ? self.stop()
?
? ? def setup(self):
? ? ? ? print ("Setup")
? ? ? ? global theDCCAddress
? ? ? ? self.f = javax.swing.JFrame("Barn Loop Automated Control",preferredSize = (600,280))
? ? ? ? self.f.contentPane.setLayout(javax.swing.BoxLayout(self.f.contentPane,javax.swing.BoxLayout.Y_AXIS))
? ? ? ? self.f.setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE)
? ? ? ? self.f.setLocationRelativeTo(None)
? ? ? ? relButton = javax.swing.JButton("CLOSE WINDOW")
? ? ? ? relButton.actionPerformed = self.doClose
? ? ? ??
? ? ? ? # top explanatory panel, text only
? ? ? ? temppanel0 = javax.swing.JPanel()
? ? ? ? temppanel0.add(javax.swing.JLabel("<html>Select your locomotive from the roster, or type in the address in the box.<br> Then press start button.</html>"))
? ? ? ? temppanel0.add(relButton)
?
? ? ? ? # second panel has a label, then drop box and text field.?
? ? ? ? temppanel1 = javax.swing.JPanel()
? ? ? ? temppanel1.add(javax.swing.JLabel("Locomotive "))
? ? ? ? temppanel2 = javax.swing.JPanel()
? ? ? ? temppanel2.add(javax.swing.JLabel("Number of Shuttles "))
?
? ? ? ? # create the drop-box from the roster,?
? ? ? ? ? ? ? ? # getEntriesWithAttributeKeyValue(String key, String value)?
? ? ? ? self.roster = jmri.jmrit.roster.Roster.getDefault()
? ? ? ? self.box = jmri.jmrit.roster.swing.GlobalRosterEntryComboBox()
? ? ? ? self.box.itemStateChanged = self.rosterBoxChange
?
? ? ? ? # create the text field
? ? ? ? self.address = javax.swing.JTextField(5)
? ? ? ? # create field for loop count
? ? ? ? self.loopCnt = javax.swing.JTextField(5)
?
? ? ? ? # Read the first entry from the roster drop box and write its DccAddress to the address box.
? ? ? ? entry = self.roster.entryFromTitle(self.box.getSelectedItem())
? ? ? ? if( entry != None ) :
? ? ? ? ? ? theDccAddress = entry.getDccAddress()
? ? ? ? ? ? self.address.text = theDccAddress
?
? ? ? ? # create the start button to perform actions.
? ? ? ? self.startButton = javax.swing.JButton("Start")
? ? ? ? self.startButton.actionPerformed = self.whenMyButtonClicked
?
? ? ? ? # add the drop-box, address field, and start button to the panel
? ? ? ? temppanel1.add(self.box)
? ? ? ? temppanel1.add(self.address)
? ? ? ? temppanel1.add(self.startButton)
? ? ? ? temppanel2.add(self.loopCnt)
? ? ? ??
? ? ? ? # Create a status line
? ? ? ? self.status = javax.swing.JLabel("Waiting for Locomotive")
?
? ? ? ? # Put contents in frame and display ??
? ? ? ? self.f.contentPane.add(temppanel0)
? ? ? ? self.f.contentPane.add(temppanel1)
? ? ? ? self.f.contentPane.add(temppanel2)
? ? ? ? self.f.contentPane.add(self.status)
? ? ? ??
?
? ? ? ? self.f.pack()
? ? ? ? self.f.show()
## ? ? ? ?self.start()
? ? ? ? return
? ??
? ? def whenMyButtonClicked(self,event) :
? ? ? ? if (self.number > 127) :
? ? ? ? ? ? long = True
? ? ? ? else :
? ? ? ? ? ? long = False
? ? ? ? self.throttle = self.getThrottle(self.number, long)
? ? ? ? if (self.throttle == None) :
? ? ? ? ? ? print ("Couldn't assign throttle!")
? ? ? ? ? ? self.status.text = "no throttle"
? ? ? ??
? ? ? ??
? ? ? ? self.start()
? ? ? ? # we leave the button off
? ? ? ? self.startButton.enabled = False
? ? ? ? return
?
? ? ? ? # routine to show the panel, starting the whole process ? ??
? ? def rosterBoxChange(self, event) :
? ? ? ? ? ? entry = self.box.getSelectedItem()
? ? ? ? ? ? if isinstance(entry, jmri.jmrit.roster.RosterEntry):
? ? ? ? ? ? ? ? theDccAddress = entry.getDccAddress()
? ? ? ? ? ? ? ? # print theDccAddress
? ? ? ? ? ? ? ? self.address.text = theDccAddress
? ? ? ? ? ? else:
? ? ? ? ? ? ? ? self.address.text = ""
? ? ? ? ? ? ? ? theDccAddress = 3
? ? ? ? ? ? try:
? ? ? ? ? ? ? ? self.number = int(self.address.text)
? ? ? ? ? ? except ValueError:
? ? ? ? ? ? ? ? self.number = 3
? ? ? ? ? ? print (self.number)
?
? ? ? ? ? ? return 0
?
?
?
a = Test_Track_Shuttle()
a.setName("Test Track Shuttle")
a.setup()
|
Locked
Re: OperationsPro and ¡°wait¡±
My apologies for not signing the above entry. ?Hit ¡°send¡± to toon.
Phil |
Locked
Re: Engine Driver - what type of consisting is it doing
¿ªÔÆÌåÓýR ¨C my understanding of Engine Driver (ED) consisting starting with version 2.18 is as follows: ? ED creates and controls consists using a process similar to NMRA Basic Consisting but with one critical difference. Like Basic Consisting, commands for F0 (lights), bell and horn/whistle are normally sent only to the lead locomotive. Unlike Basic Consisting, all other functions are sent to all locomotives in the consist. Unchecking ¡°Selective Lead Unit Sound?¡± in the Throttle Control Preferences will result in bell and horn/whistle commands also being sent to all locomotives in the consist and checking ¡°Control Consist lights on long click¡± in the Select Loco Preferences will allow F0 to be sent to selected locos in a consist. NOTE: Function labels containing ¡°bell¡± and ¡°horn¡± or ¡°whistle¡± must be defined in the lead locomotive¡¯s JMRI roster for Selective Lead Unit Sound to work properly. ? ED consists are formed completely within ED, so they will not show up in the command station. ? Mark Granville |
Locked
Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting
James,
toggle quoted message
Show quoted text
The NX sensors are internal sensors. They are used to setup routes. Take a look at the demo at /g/jmriusers/files/ProblemsBeingWorkedOn/dsand/NX%20Demo.xml The icons with > or < are the NX icons. The arrows indicated which direction the icon supports. There is some support for Logix and script access. Dave Sand On Aug 18, 2018, at 3:51 PM, jamespetts via Groups.Io <jamespetts@...> wrote: |