Keyboard Shortcuts
Likes
- Jmriusers
- Messages
Search
Locked
Re: jmri_bindings.py
#scripting
Thanks Dave.?
unfortunately I also use this function so that I can have a dynamic name which gets in the way. Is there a way to? have testRoute1 as a string, something like route=eval("testRoute1()") ? ? ? ? def importClass(self,className):
? ? ? ? ? self.name=className
? ? ? ? ? self.components = self.name.split('.')
? ? ? ? ? self.module = __import__(self.components[0])
? ? ? ? ? for self.component in self.components[1:]:
? ? ? ? ? ? ?self.module=getattr(self.module, self.component)
? ? ? ? ? return self.module
? ? ? #---------------------------------------------------------------------------------------------------------
? ? ? # set the route for this driver
? ? ? #---------------------------------------------------------------------------------------------------------
? ? ? def setRoute(self,route,throttle):
? ? ? ? ? self.route_name="automationRoutes."+route
? ? ? ? ? print("setting route to "+self.route_name)
? ? ? ? ? self.route=self.importClass(self.route_name)
? ? ? ? ? self.route_instance=self.route
? ? ? ? ? self.route_instance.throttle=throttle
? ? ? ? ? return self.route_instance()
? |
Locked
Re: calling dispatched from script
Steve
Just updated from version 4.16 to 4.18 and the problem with "one of my dispatch routes in that when I initially set it up the active train is WAITING" has dissapeared. Someone must have been busy... I still have the problem that befor running dispatcher on a route all the signals are working correctly and change when I move points. After I run dispatcher on the route, the initial signal freezes to red. I then cannot run dispatcher from that siding again. I will update to the latest test release and see if that does anything... Bill Bill |
Hi all, I am new at this so you know. I¡¯m running my pi with the image from Steve Todd. I would like to print my roster but there doesn¡¯t seem to be a simple add printer function like windows. Did some searching and found I need to install CUPS to the pi which I did. To configure and add the printer you have to goto the LocalHost:631 which is browser based using Chrome. All works fine until I try to add the printer in my network. The CUPS page asked for the username and password. I don¡¯t know what this refers to. Any help is appreciated. Thanks in advance. Steve M
|
Locked
Re: Changing Car Type
#operationspro
Gentlemen
I am going to go ahead and set up a schedule.I still do not fully understand the Random Feature I want to schedule the one car every 3 months. I therefore set Random at 5 does this sound plausible. Jerry |
Locked
Re: calling dispatched from script
Hi Steve I managed to get the x-over working. Thanks a lot for your comments, it gave me the impetus to try something else. I had originally two physical detection blocks which I had OR¡¯ed together to form a virtual block. I rewrote it so both physical blocks were used by the x-over, and it seemed to work ¨C after some trials and tribulations. Things I had to do: 1)????? Add extra track to 2 of the branches of the x-over with the same block value as the x-over to enable the dispatcher routes to be constructed 2)????? Add extra track to the base of 2 of the points to get the signals and/or dispatcher to work properly 3)????? I had to insert a dummy extra block on the end of one siding. There is a restriction that the dispatch route has to have two or more sections. I had the requirement that the route should include the siding section and another section consisting of two blocks. If the restriction stated a.?????? The transit should have 1 or more sections b.?????? The dispatch route should allow a transit with 1 section if the ¡®Train in selected transit¡¯ is not ticked. Then I could have created my dispatch route without adding a dummy extra siding block. Putting the dummy block meant that the transit could include the siding. ? Problems 1)????? When I move from siding 3 to siding 4, 4 to siding 3, then attempt to move from siding 3 to 4 again the signal is red leaving the siding and the train is WAITING. I change the signal by clicking on it and the train starts moving. 2)????? I still have a problem with one of my dispatch routes in that when I initially set it up the active train is WAITING. I thought that waiting meant that the signal was against the train, but it isn¡¯t. Maybe you can give me some pointers on how to solve this problem, maybe setting some breakpoints in the code. Things that would be nice 1)????? Change dispatcher so that I could stop using extra blocks on the end of sidings. I did try adding an extra section by putting an extra block on one of the Y¡¯s of a point, but that screwed up the signals. 2)????? To know when to add extra blocks to make dispatcher work. I think a general rule is that when a point has a different block sensor to the previous track, then add an extra block, but I wold like that confirmed. It would be nice not to have to put the extra block in. 3)????? To have helpful diagnostics when the dispatch is waiting, or at least to have a crib list of things to check. I am a bit stuck there. Bill |
Locked
Re: jmri_bindings.py
#scripting
James, By importing your module you lose the global variables. An alternate approach is to load the module instead of import and modify the route line. import jmri execfile(jmri.util.FileUtil.getExternalFilename("preference:routes.py")) route=testRoute1() route.setTurnoutSensor("ISTS-1",ACTIVE) Dave Sand ----- Original message ----- From: James Anderson <james_anderson_999@...> Subject: Re: [jmriusers] jmri_bindings.py Date: Monday, January 06, 2020 7:56 AM Sorry to come back on this again. I have a small script? import routes route=routes.testRoute1() route.setTurnoutSensor("ISTS-1",ACTIVE) and on disk I have this module called routes shown at the bottom of this note.? If i use self.sensor=sensors.provideSensor(self.turnoutSensorName) I get?NameError: global name 'sensors' is not defined but it works with jmri.InstanceManager.getDefault(jmri.SensorManager).provideSensor(self.turnoutSensorName)? Is there something else I should be loading? ?import jmri ?class automationRoutesBaseClass(jmri.jmrit.automat.AbstractAutomaton) : ? ? def init(self): ? ? ? ? return ? ? def handle(self): ? ? ? ?return 0 ? ? def setTurnoutSensor(self,turnoutSensorName,state): ? ? ? ? self.turnoutSensorName=turnoutSensorName ? ? ? ? self.turnoutState=state #? ? ? self.sensor=jmri.InstanceManager.getDefault(jmri.SensorManager).provideSensor(self.turnoutSensorName) ? ? ? ? self.sensor=sensors.provideSensor(self.turnoutSensorName) ? ? ? ? if self.sensor !=None : ? ? ? ? ? ?self.sensor.setState(self.turnoutState) ? ? ? ? else: ? ? ? ? ? print("error unable to obtain sensor object for "+str(self.turnoutSensorName)) ? ? ? ? return ?#----------------------------------------------------------------------------------- ?# Class? :? define a route. Inherits methods from automationRoutesBaseClass ?#----------------------------------------------------------------------------------- ?class testRoute1(automationRoutesBaseClass) : ? ? def init(self): ? ? ? ? return ? ? def handle(self): ? ? ? ? return ? ? def __init__(self,routeDescription=None,routeName=""): ? ? ? ? self.routeDescription=routeDescription ? ? ? ? self.routeName=routeName ? ? ? ? automationRoutesBaseClass.__init__(self) ? ? ? ? return ? |
Thinking a little more - there isn't enough information in Signal Mask Aspects to know what heads exist or the order of heads either left to right or top to bottom - which is what is needed to allow the different aspects to be related to routes..
So the Aspects need to qualified by some sort of Route information to be linkable to turnouts and other signals automatically.? We would need different aspects for each indication on each route anyway - it is just that is in human text and so not useful. One could have an attribute that says which route counting from left to right the aspect shows with ones to the left of the main as negative and right positive (straight on as zero - the default). That would also be useful in the Group situation as then the route displays of matrix/stencil and feathers might be automate-able as well.? Adam |
Locked
Re: jmri_bindings.py
#scripting
Sorry to come back on this again.
I have a small script? import routes
route=routes.testRoute1()
route.setTurnoutSensor("ISTS-1",ACTIVE) and on disk I have this module called routes shown at the bottom of this note.? If i use self.sensor=sensors.provideSensor(self.turnoutSensorName) I get?NameError: global name 'sensors' is not defined but it works with jmri.InstanceManager.getDefault(jmri.SensorManager).provideSensor(self.turnoutSensorName)? Is there something else I should be loading? ?import jmri
?class automationRoutesBaseClass(jmri.jmrit.automat.AbstractAutomaton) :
? ? def init(self):
? ? ? ? return
? ? def handle(self):
? ? ? ?return 0
? ? def setTurnoutSensor(self,turnoutSensorName,state):
? ? ? ? self.turnoutSensorName=turnoutSensorName
? ? ? ? self.turnoutState=state
#? ? ? self.sensor=jmri.InstanceManager.getDefault(jmri.SensorManager).provideSensor(self.turnoutSensorName)
? ? ? ? self.sensor=sensors.provideSensor(self.turnoutSensorName)
? ? ? ? if self.sensor !=None :
? ? ? ? ? ?self.sensor.setState(self.turnoutState)
? ? ? ? else:
? ? ? ? ? print("error unable to obtain sensor object for "+str(self.turnoutSensorName))
? ? ? ? return
?#-----------------------------------------------------------------------------------
?# Class? :? define a route. Inherits methods from automationRoutesBaseClass
?#-----------------------------------------------------------------------------------
?class testRoute1(automationRoutesBaseClass) :
? ? def init(self):
? ? ? ? return
? ? def handle(self):
? ? ? ? return
? ? def __init__(self,routeDescription=None,routeName=""):
? ? ? ? self.routeDescription=routeDescription
? ? ? ? self.routeName=routeName
? ? ? ? automationRoutesBaseClass.__init__(self)
? ? ? ? return
?
|
Locked
Re: Test version 4.19.1 of JMRI/DecoderPro is available for download
¿ªÔÆÌåÓýSteve I have just installed a WOW? - clicked on the throttle - and as you found ---no sound functions or light functions when using the Sprog 3 - BUT - on the mainline using the command station works like a charm. I was using Ver 4.19.1 I reinstalled Ver 4.17.8 and now all works as it should. When I go back to the train room I will install Ver 4.18 and see how that goes. I will also check some other decoders - Tsunami 2 Model Railroading is Fun !!!!!! Gerry On 6/01/2020 1:00 pm, Steve Magee via
Groups.Io wrote:
I think I have found one bug. Home system is old Dell running Windows 10, no problems previously. DCC is NCE Power Pro. -- Gerry Hopkins MMR #177 FNMRA Great Northern Downunder NMRA Australasian Region Contest & AP Chairman Web Administrator |
Locked
Re: Eliminate local moves
Frank,
Unless you're using custom loads and / or schedules the default is not to allow local moves.? However, if you are using them, then in the Edit Train window, under tools, select Train Build Options.? And in that window deselect "Allow local moves if car has a custom load or Final Destination". Dan |
Locked
Re: Test version 4.19.1 of JMRI/DecoderPro is available for download
Steve,
On 6 Jan 2020, at 1:00 PM, Steve Magee via Groups.Io <sjmagee@...> wrote:Thanks for your report. Yes it has already been reported. A fix has been merged into master and will be in 4.19.2. Dave in Australia |
Locked
Re: Webserver not showing all the tracks of panelpro editor
#webserver
The R type letter was used by both Routes and Reporters. ?O is the new type letter for rOutes. Dave Sand ----- Original message ----- From: SwissChris <chris@...> Subject: Re: [jmriusers] Webserver not showing all the tracks of panelpro editor #webserver Date: Sunday, January 05, 2020 7:53 PM Thanks George and Steve. I've installed the update and now have the full display on webserver. 1 Minor question though. Routes numbering has changed from IR** to IO** which led to 70 error messages, but the converted panel loaded OK. I did lose the User name to one route, but have worked out what that was and have re-saved the layout xml file with a different name. Thanks again until I hit the next problem which will probably be getting my head around Dispatcher. |
Locked
Re: Webserver not showing all the tracks of panelpro editor
#webserver
please note a change. The turntable bridge is reacting strangely between Panel editor and Webserver see images 2 & 3w here?/g/jmriusers/album?id=237090
|
Locked
Re: Test version 4.19.1 of JMRI/DecoderPro is available for download
I think I have found one bug. Home system is old Dell running Windows 10, no problems previously. DCC is NCE Power Pro.
Problem when opening new throttle: when new throttle is opened from Actions, loco is controllable for speed and direction, but no function buttons work. Has this been reported already? Steve Magee On30 Lumber Mountain RR Newcastle NSW Aust |
Locked
Re: Webserver not showing all the tracks of panelpro editor
#webserver
Thanks George and Steve. I've installed the update and now have the full display on webserver. 1 Minor question though. Routes numbering has changed from IR** to IO** which led to 70 error messages, but the converted panel loaded OK. I did lose the User name to one route, but have worked out what that was and have re-saved the layout xml file with a different name. Thanks again until I hit the next problem which will probably be getting my head around Dispatcher.
|
Locked
Re: WiThrottle - control panels
#paneleditor
#withrottle
Brian created issue 7866??for this. Thanks, Brian.
|