¿ªÔÆÌåÓý

Date

Locked Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting

 

I have not been following this thread very closely but since my name was mentioned (no problem there) and since I am a big fan of layout control automation, let me at least chime in with a quick view of what I have done and am using.? The best way to get an initial feel for my use of JMRI and Dispatcher and Jython is to peruse my documentation for the layout:


Jay Janzen
St. Charles, Mo


Locked Re: Operations - Somewhat complex senario - would like help

 

Doc,

John needs his cars to move with a purpose, so that all cars on the barge have industry destinations.? The only way to do this is to use staging to generate final destinations for all of the cars sent to the barge.? This first train is only there to load the barge.

Dan


Locked Re: Operations - Somewhat complex senario - would like help

 

John

Staging tracks require all cars on the track leave as a single train so don't use staging tracks for storage, try yard tracks instead.

I think you are making it too hard on yourself.? You build a train from that yard that goes to the destinations that you want the cars to go to.? The first location on the route is the barge which has NO moves.? Put a comment on the barge that the crew that builds the train and gets it on the barge turns the train over to another crew that runs it from there.? You can use this method in reverse for trains returning to storage.

This is the same as building trans in the yard with a yard crew and then giving the train to a road crew.? One manifest does it all.

doc


Locked Re: Understanding script examples

 

¿ªÔÆÌåÓý

Jerry,

Look at jmri_bindings.py. ?The first part has the shortcuts for the common managers. ?The second part has common constants.

The Java documentation is at?. ?

The Java source is at?.


Dave Sand



On Aug 15, 2018, at 5:48 PM, JerryG via Groups.Io <jerryg2003@...> wrote:

There have been a number of posts about understanding script examples recently.? I¡¯m trying to work my way through some in order to modify and expand, but need some basic information.? I¡¯m sure this a pretty basic question, but are there lists of the available defined objects, and their methods, properties, and values?

For example, in these fragments from example scripts, various objects, methods, properties, and values are referenced but there are obviously many others that might be useful.? Is there a list somewhere of defined objects like ¡°sensors,¡± ¡°event,¡± and ¡°memory¡±?? Is there a list of defined methods like ¡°provideSensor,¡± ¡°getThrottle,¡± ¡°setisForward,¡± ¡°setValue,¡± etc. for each object?? Is there a list of defined properties like ¡°propertyName¡± for each object? Or values like ¡°currentReport¡±??

BackandForth.py:
? ? self.fwdSensor = sensors.provideSensor("513")
? ? self.throttle = self.getThrottle(14, False)
? ? self.throttle.setIsForward(True)

ReporterFormatter.py:
? ? if (event.propertyName == "currentReport") :
? ? ? self.report = event.newValue
? ? ? self.value = self.format(self.report)
? ? ? self.memory.setValue(self.value)

Thanks, Jerry

_________________________________



Locked Understanding script examples

 

¿ªÔÆÌåÓý

There have been a number of posts about understanding script examples recently.? I¡¯m trying to work my way through some in order to modify and expand, but need some basic information.? I¡¯m sure this a pretty basic question, but are there lists of the available defined objects, and their methods, properties, and values?


For example, in these fragments from example scripts, various objects, methods, properties, and values are referenced but there are obviously many others that might be useful.? Is there a list somewhere of defined objects like ¡°sensors,¡± ¡°event,¡± and ¡°memory¡±?? Is there a list of defined methods like ¡°provideSensor,¡± ¡°getThrottle,¡± ¡°setisForward,¡± ¡°setValue,¡± etc. for each object?? Is there a list of defined properties like ¡°propertyName¡± for each object? Or values like ¡°currentReport¡±??


BackandForth.py:

? ? self.fwdSensor = sensors.provideSensor("513")

? ? self.throttle = self.getThrottle(14, False)

? ? self.throttle.setIsForward(True)


ReporterFormatter.py:

? ? if (event.propertyName == "currentReport") :

? ? ? self.report = event.newValue

? ? ? self.value = self.format(self.report)

? ? ? self.memory.setValue(self.value)


Thanks, Jerry


_________________________________


Locked Re: Inconsistent behaviour with the dispatcher

 

Some further testing: I deleted the profile of and reprofiled one of the locomotives as the previous profile apparently had anomalies. This has rectified the sudden deceleration issue, but not the inconsistent stopping point issue.

Now, with two trains on the circuit (with full resistance wheelsets and accurately measured block and train lengths, as well as stop by speed profile enabled), the reprofiled locomotive will stop with an accuracy of +/-5cm. Removing the other locomotive (and terminating its associated Active Train), the first locomotive will stop ~10cm short of its average 2 train stopping point. For reference, this is in a scale of 1:148.

I notice that there is very little documentation and are very few options about the relationship between the stopping point in a transit and the speed/length of the train: does anyone know how JMRI is intended/designed to work out when in the last section of a transit to stop a train? I notice that, if I disable "stop by speed profile", the train will stop dead somewhere in the middle of the section (but very shortly after the last carriage, which has resistance wheels, has left the preceding section).


Locked Re: Operations

 

Dan

Thanks for this help. Based on what you are telling me I should be able to alternate between configurations ie run one configuration for several sessions and then change to the other configuration. Does that sound feasible or sensible

Jerry


Locked Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting

 

Martin,

thank you for your reply: that is most interesting. That Railroad Museum certainly looks impressive. Do I understand that you did manage to get JMRI set up with the Dispatcher and/or AutoDispatcher for automatic running in the end? If so, I should be very interested to know what you were able to discover about AutoDispatcher. Did you use its timetable text parsing abilities? Did you have to extend the functionality of AutoDispatcher in the end? Does the AutoDisplatcher actually replace or duplicate any of the features of the Dispatcher (I had formerly assumed that it had not done so, but I realise that that assumption may not be correct).

It is interesting to note that you use both Traincontroller and JMRI, albeit not at the same time. May I ask - what do you find that Traincontroller can do that JMRI cannot do?

I will have to look into VirtualBox, although that does, of course, require a complete copy of windows and does not integrate as well as Wine.

Thank you again for your reply in any event - it is much aprpeciated.

James.


Locked Re: Operations

 

Hi Jerry,

Yes, you can create a second profile where you can experiment with the operations program.? Do the following steps:

1. Do a backup in your current profile from the "Settings" page.? You can put a comment in the "Settings" window so you can confirm that you got the right backup operation files later.
2. Create a new profile and activate it.
3. After starting the new profile, do a "Restore" found in the "Settings" window tools menu.? This will allow you to find the backup operation files from your previous profile.? Complete the restore once you select the correct backup set of files.

The program should restart and in the new profile you should find your operation files ready to play with.? Any modifications made by you will not change the original files.? I would also backup your operation files in the new profile so you can restore them if you do something you don't like.? Here's the help link that might be helpful to you:



Dan


Locked Re: Operations - Somewhat complex senario - would like help

 

John,

Set the number of cars requested out of staging in your route to 135 or more.? For the barge, you need 20 moves, 10 to put cars on the barge, and 10 to pull them off.? Set the number of cars
to return to staging to 135 or more.

Dan


Locked MQTT Connection in JMRI

 

I just noticed last night that there is now a MQTT connection type in JMRI. This is exciting. Especially for me, since I was planning on using MQTT connection in JMRI through a custom script. IT seems though that this connection type is still in development even though it is in a production release. From what I read it is only available in for turnouts right now. When I added the connection and went to turnouts it seems that it created another internal connection type for the MQTT connection.?

I was hoping if someone could share if this development is going to actively grow for this connection type to include sensors, lights, records, etc.? I think that in the connection type a username and password field should be included in case someone has username and password required on the MQTT server and also the ability to choice what the master topic will be.?

Again, I think that this is great for JMRI. Especially since, model railroads are using Arduino based boards such as the ESP8266 and ESP32 which are commonly used with MQTT.?

Chris?


Locked Genesis OEM TSU2

 

Hi, i am trying to help a friend, over the phone!, with his Athearn Genesis F45 with TSU2. The basic problem is this engine is not listed in the choices when reading the loc with decoder pro. The F45 and FP45 are listed in the TSU1 but some of the CV's have been changed with different options in the TSU2. ?I was using GP38-2 as a stand in but this became problematical also. Is there any chance that the F45 could be added to the list? ?Thanks to Michael Mosher I could get the new file on the WOWV3and 4 diesel, download and install into the current version of decoder pro. Thanks Again, Rick.


Locked Re: Operations - Somewhat complex senario - would like help

 

¿ªÔÆÌåÓý

John

A train departing Staging must pull all the cars on the track.? Your train has a route that calls for 10 pick ups at Staging. The departure track has 135. So, for your number of pick ups 1 through 10 cars on the track will work.

Train will depart staging (Storage), there are 1 tracks?

? Staging track (Storage ) has 0 loco(s) and 135 cars?
? Staging track (Storage ) has more cars (135) than requested by train's route (10)?
? ? Staging track (Storage ) cannot service train (S to B to S)?

Jim



Locked Re: Scripts

 

I appreciate your patience with an outsider like me.

In one way or another, we are all outsiders from time to time. Certainly I am an outsider when it comes to understanding the documentation of RailCom or any of the other implementations of the collection of DCC transmitter-receiver pairs that are collectively called Reporters in the JMRI context. Also, there is much more of the JMRI software that I don't understand, than there is of the PanelPro sections that I do have a working grasp of.

I feel that I could make such a use of AutomatonExample and its refinement, but your example seemed to me too long and complicated at first sight to do this.

Your original post referenced both "AutomatonExample.py" and "BackAndForth.py" and I took those as the beginning of a common vocabulary. No software code of more than a few lines has ever made sense to me "at first sight" and I used to teach Computer Science back when that was an embryonic field of study.

So, let me start from scratch. There is a single loco I want to move back and forth between two blocks. No other train can touch its route. The only intrusion can occur in either of the terminal blocks that can accommodate another train, but physically these blocks are long enough to cause any collision.

A single loco automatically trundles back and forth between locations named D and G perhaps going through locations E and F. Other trains can intrude at either or both D and G but cannot go into E or into F. Someone is controlling each of those other trains and watching to prevent a collision with the automatically controlled train. Is this an over simplification? Or did you also want the automatically controlled train to wait at E if D is occupied?

A RailCom current sensing detector is attached to each of these terminal blocks.

In the simplification, "each of these terminal blocks" means locations D and G? JMRI uses "blocks" with a subtly different meaning and often someone on this list will interchange Sensor for Block when there is a one-to-one correlation.
Also, I am no longer convinced that each RailCom Sensor is the same as each RailCom Reporter as I was when working on this script a few days ago. Is there a one-to-one Sensor to Reporter matching as I inferred from the JMRI help webpages at that time?

Can your example handle this situation? If so, I am going to make a more thorough effort to grasp it. You may facilitate my effort by pointing out part of the script where the sensor reporter, also referred to by Paul in the second of this series of posts, is used to trigger the change of movement of my train ignoring, however, whether or not another train enters, stays or leaves there.

The portion of the script that is intended to do what you describe is only sketched at this stage since I remain ignorant of the workings of RailCom. In particular, some of the documentation that I have found uses the apparent interchange of the words "Sensor" and "Detector" and "Reporter" as if they have the same meaning in this context.

Starting at line # 168 with the text:

	def AreWeThereYet ( self, fpSensor ) :
		temP_Int = 0
		while not ( temP_Int == self.LocoAddress ) :
			self.waitSensorActive( fpSensor )
			...

an endless loop of wait until the Sensor identified as "fpSensor" changes to ACTIVE and the DCC loco number matches.

Since the method named "AreWeThereYet()" is called for each direction the train is moving and is supplied with the predetermined destination Sensor for that direction, only one effort is needed to debug the RailCom portion of the script. The intention was that once the Sensor becomes ACTIVE, the code could determine what the loco DCC address was and change the value of "temP_Int" to that address. IF that DCC address matches the value of "self.LocoAddress" then the condition requested at line # 170 becomes True and we then stop the automatically controlled locomotive and return to the calling procedure to continue.

That section contains numerous links to JMRI documentation webpages but is largely based on wishful thinking and perhaps even dead end misunderstanding. After looking at "ReporterFormatter.py" that Paul identified, it is now likely that what is happening in the while -- loop is waiting for the wrong information.

If you are serious about understanding the syntax and indentation rules that drive Python programmers crazy, it is important to get a good editor that understands most of the rules of the language. My favorite is NotePad++ that is free and I discovered at a long time ago. There are a lot of other good choices available. When I was in the software business, we used to claim it was easier to start a war by claiming one editor was best than any other way.

If this is beginning to help, we can discuss what would be next. It was my hope that some RailCom or Reporter experts would have pointed out what you needed to know in this area and let them proceed. The example scripts that refer to Reporters do not yet make much connection to what I can find in the help webpages.

Cliff


Locked Operations

 

I am interested in trying out a new operating scheme.However I want to do this without disturbing my current program. Does the program allow for a way for this to be accomplished

Jerry Hampton?


Locked Re: Operations - Somewhat complex senario - would like help

 

Guessing I have something wrong in the set up of staging?

Build Report for train (S to B to S) built on 8/15/18 1:36 PM?
?JMRI version 4.13.2+R8a2b21d?
? Build report detail level: Normal?
? ?Build report detail level: Detailed?
? ? Build report detail level: Very Detailed?
? ? Router build report level: Very Detailed?
?
? ?Train Build Options:?
? ?Build option is set to aggressive?
? ?Perform 2 passes?
? ?Make departure track available after train is built?
? ?
? ?Staging build options:?
? ?Make departure track available after train is built?
? ?Allow cars to return to staging?
? ?
? ?Car routing options:?
? ?Car routing via yards is enabled?
? ?Car routing through staging is enabled?
? ?
? ?Specific build options for train (S to B to S):?
? ?Allow cars to return to staging?
? ?Allow local moves if car has a custom load or FD?
? ?Allow cars to travel from origin to terminal?
?
? Train (S to B to S) route (StBtS):?
? 6r1 Staging (Storage) request 10 pick ups, maximum train length 10,000 feet?
? 6r2 Location (Charleston Barge) requests 10 moves, maximum train length 10,000 feet?
? 6r3 Staging (Storage) requests 10 set outs?
?Route (StBtS) requests 15 cars and 30 moves?
?
?Train requirements:?
?Train does not require any locomotives?
?
??
?Train terminates into staging at (Storage), there are 1 tracks?
?Train will return to staging (Storage) reuse departure track?
??
?Train will depart staging (Storage), there are 1 tracks?
? Staging track (Storage ) has 0 loco(s) and 135 cars?
? Staging track (Storage ) has more cars (135) than requested by train's route (10)?
? ? Staging track (Storage ) cannot service train (S to B to S)?
?
?Train requirements:?
?Train does not require any locomotives?
?
?Could not find a departure staging track at Storage that meets the train requirements?
?Build failed for train (S to B to S)?


John Crellin
Bradenton, FL


Locked Re: Full timetable automation - AutoDispatcher 2 - abstraction - documentation - scripting

 

Hi,
We use both JRMI and Traincontroller at the museum on a Win 10 i3 box (not at the same time).?

JMRI seems to be better at 'undertanding' the various Digitrax pieces (DCS240, lots of boosters, BDL's, DS64's, throttles, etc.) presumably because of the long development history with this product line.? By that I mean real time 'fixing' of detection issues, initialization, getting loco info from DecoderPro, consisting on the fly, product installation, monitoring Loconet, etc.)? The table driven interface makes for easy access to most items.? We are moving to more modern products from RR-Cirkits and their setup is also easier.

But we use the layout editor components more as a 'magnetic board' to move markers defining trains (e.g. "<SP5007" - a train moving West on the layout) to the designated Train Order locations/instructions given by the dispatcher (human) to engineers and let the subsequent tracking show progress.? JMRI Web services and WiFi throttle components are much easier to use than in TC in that I can also provide a simple alternative layout 'screen' to engineers in the gallery showing occupied blocks and 'pseudo signals' for their perusal. (the 5k square foot layout is not walk around.)? We also deploy virtual panels in yards to set ladders, etc.? It requires a dispatcher to be more involved/savvy.? I have tried AutoDispatcher and Dispatcher to automate train running but have not been able to get to a JMRI presentation so the various slides available from the files section without notes (and the questions that might have been answered) has made a steep learning curve for me to implement.? This also makes it not the software of choice for people 'learning' to dispatch.

TC requires a great deal of setup (e.g. getting the locos (400+) and trains into the database and any rules about train operations). ?? But it is very easy to route/transit with a drag and drop method from one destination to another and TC takes care of all conflicts.? We can have up to 10-15 trains running during an Open House.? TC also simplifies the 'issue' of incorporating turnouts in layout blocks/sections (there are over 100 on the mainline) in that they do not matter as they are only route paths.? I still have trouble getting the 3 double slips on my home layout to function in JMRI automation and complex CP's (3/4 crossovers) at the museum are a signaling and routing 'challenge' (using either SSL or Signal Masts).? Note that no 'scripting' is necessary.? What you should expect out of a $$$ product.

[Note: I am a long time Linux user and would prefer it as the OS.? Virtual Box or some other app is better for Windows emulation, especially TC.? I have had success at home with Parallels on a Mac.? Wine just does not work well.]

My 2 cents worth,

Martin Booker, Superintendent, Pasadena Model Railroad Museum
www.pmrrc.org


Locked Large Scale Bachmann Thomas DCC Sound Decoder

 

Hello-

Recently I purchased a Large Scale Bachmann Thomas & Friends DCC Sound Decoder. JMRI did recognize the decoder as being from Soundtraxx, but did not supply a specific decoder model to go with it. I chose the OEM Bachmann EZ Command 2 function decoder. Things seems to be working fine. It's reading and writing to the decoder just fine. At this time I'm just testing the decoder. Once I get it installed into Thomas I'll play around more with acceleration/deceleration, speed tables, etc. I know not all of the available CV's for the Thomas decoder show up on JMRI under the OEM Bachmand EZ decoder, but the big thing for me is being able to do accel/decel and speed tables. Some of the few CV's left to program for the Thomas decoder are easy enough the old fashion way using the throttle. But I'm left wondering if it's possible to add the?Large Scale Bachmann Thomas & Friends DCC Sound Decoder to the JMRI decoder selection roster?

Eric


Locked Re: Z21 and POM

 

Paul,


On Tue, Aug 14, 2018 at 06:38 PM, Paul Bender wrote:
I have the write in POM mode working correctly now. ?You can download a daily build of JMRI that includes the update here:
?
?
Paul
I downloaded build #2641 and I noted these problems:
1) Simple CV programmer: I have no error, CV is written correctly, but textbox "value" become 1 after each operation (I have "6" in the value textbox, I click "Write CV" button, CV is written but the textbox value become 1; if I re-read CV, I got 6). This is a bit confusing for me.
2) Editing 2 or more CVs on a sheet of a loco and pressing "Write changes on sheet" freeze the window after the second write operation and I have to close the window; is impossible to write 3 or more CVs. This occurs with all decoders (esu, zimo, lenz) I tested.

Moreno


Locked Re: RPi-JMRI image updated

 

I have uploaded a new version which fixes the issue with PiSPROG. The new file is dated August 14.
Please give it a go and advise.
--SteveT