¿ªÔÆÌåÓý

Locked Re: Train Tracking #traintracking


 

Brian,

The script is designed to be started one time after the panel xml file has been loaded. Each time the sensor is set active, it looks for occupied blocks that have no assigned value which causes a prompt to enter a value.

It sounds like you have modified the script so that it no longer works as designed. If you upload it the group's ProblemsBeingWorkedOn folder I can check your version of the script.

Dave Sand

----- Original message -----
From: Brian & Cherry Clark <freyweslian@...>
To: [email protected]
Subject: Re: [jmriusers] Train Tracking
Date: Saturday, November 16, 2019 9:46 AM

Dave

Thanks for your advice.

I now have the script working ( having amended the original script I
have saved this as SetBlocksValue2.py) and am able to allocate trains
numbers from the .txt file.

However there is one minor issue, which is when I activate the panel
sensor (set as momentary) a box pops up saying 'SetBlockValue already
running'. Clicking the 'ok' button then alllows the block allocation to
proceed.

I am guessing that, as was suggested, that I need to stop the script
after every 'use' but, being entirely unfamiliar with scripts, have no
idea how to do this.

Can you help please? Does this need an additional conditional in the
existing logix and if so what is the format for this?

Thanks for your help. This really is a wonderful program.

Brian Clark

On 05/11/2019 15:28, Dave Sand wrote:
Brian,

You definitely want to use Notepad++ to make any changes to the script. I would also use it to create the text file.

The text file, Trains.txt, contains a list of train names. There is no format, just a list of names, one per line. The file is placed in the User Files Location. See Help >> Locations. Depending on the Notepad++ settings, it may start with a new document. If not, select File >> New.

The program merges the built in list with the contents of the text file. You can comment either by placing a # at the beginning of the appropriate lines in the LoadCBORows section of the program. I would delete the 1234 and 4321 rows and just use Trains.txt.

Dave Sand


----- Original message -----
From: Brian & Cherry Clark <freyweslian@...>
To: JMRI Users <[email protected]>
Subject: [jmriusers] Train Tracking
Date: Tuesday, November 05, 2019 6:42 AM

Hello Group

I have train tracking set up on my panel and this works ok.

However when contact is lost with a loco (dirty track) the block
contents are also lost.

Following previous advice from this group, I have set up an internal
sensor on my panel and linked this to a script to recover the information.

However the script I am trying to use (SetBlocksValue.py) is looking for
a .txt file which presumably has the relevant loco/train numbers in.

(I have verified that the sensor button works correctly by using
AllocateRosterEntryToBlock.py.)

I do not have such a file and understand that I need to create it.
However I know next to nothing about how to do this.

I tried to create such a file using Notepad to no avail. I have seen it
mentioned on the group before about usinng Notepad++ which I have
downloaded.

Where I think I am stuck is in the formatting of the data in the .txt file.

Is there some kind soul who can advise me, preferably in words of one
syllable, how to format the data I would be grateful.

We use train numbers so an example would be #32West or #671East.

Using Windows 10, JMRI 4.17.4, Java 1.8.231

Thanks in advance for assistance.

Brian Clark

Bedford UK






Join [email protected] to automatically receive all group messages.