Marshall,
toggle quoted message
Show quoted text
Thanks. ? I don't want the route state to change at startup, ?but yes I could set the sensor states based on the turnout positions. ?This would require duplicating the route logic in the script. ? However it looks like Kevin has fixed the route state initialization, ?so the issue is resolved.? Regards,? Robin <div>-------- Original message --------</div><div>From: "Marshall readingrr2103@... [jmriusers]" <jmriusers@...> </div><div>Date:06/06/2014 1:25 PM (GMT-08:00) </div><div>To: jmriusers@... </div><div>Subject: Re: [jmriusers] initial state of routes is shown as Unknown? </div><div>
</div> From: mailto:jmriusers@... Sent: Thursday, June 05, 2014 4:31 PM To: jmriusers@... Subject: [jmriusers] initial state of routes is shown as Unknown? Robin, At the club on the staging yard panel, I use sensors to trigger a route. The route would be entering or exiting each track in the yard. So clicking on track 4 enter sensor, for example, triggers a route which throws switch for track 4, closes all other switches and sets all their sensors to INACTIVE. To initialize the panel when loaded, I use the following script. Maybe it will work for you. __________________________________________________________ (don’t put this line in the script file) # Script to set all turnouts on a panel to the "CLOSED" state. # It uses the entries in the Turnout Table created by Panel Pro # The wait time is currently set to 0.5 seconds. class setStartup(jmri.jmrit.automat.AbstractAutomaton) : def init(self): return def handle(self): sensorList = ["ISSTG4IN","ISSTG1OUT","ISWI"] for sensorName in sensorList: sensors.provideSensor(sensorName).setState(ACTIVE) return False # all done, don't repeat again setStartup().start() # create one of these, and start it running __________________________________________________________ (don’t put this line in the script file) If you want the initial state to “inactive” substitute INACTIVE (case matters) sensorList is a list of the sensors you want to set to a state. Marshall Phoenix Hi. I have a series of Routes, and each one has its own Internal Sensor assigned to “Enter Sensor that Activates when Route Turnouts are correctly aligned”. Each route contains a single Loconet turnout, and the turnout table shows that each Turnout has a known state – either open or closed. However the Sensor associated with each Route is in state Unknown. If I Set a Route then the associated Sensor will change to Active. If I manually set the turnout in a Route, as I watch the Sensor table the associated Route sensor will change from Unknown to Inactive very briefly and then show Active. Perhaps there is a timing issue at start up between evaluation of the Route Sensors and completion of the Loconet interrogation sequence that determines the state of the turnouts, or perhaps it is something else. If any case, is there a workaround script that I could run that would cause the state of the Route Sensors to properly initialize? Thanks. Robin Robin Becker San Diego, CA <> [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] |