¿ªÔÆÌåÓý

Date

Locked Re: JMRI starter tutorial

 

Thanks Paul. That is very useful.


Locked Re: Still Trying to write a script using Digitrax Sensors and NCE lights its

 

It looks like you¡¯ve confused two different structures. The AbstractAutomaton class (see the ¡°class¡± line below) uses methods called ¡°init¡± and ¡°handle¡±. The Siglet class uses the methods called defineIO and setOutput. So try changing the class line to

class Three_aspect(jmri.jmrit.automat.Siglet) :

For more:





Bob


On Nov 6, 2018, at 2:58 PM, Paul V via Groups.Io <vap2663@...> wrote:

I got the NCE lightits to work by addressing them 1 thru 3 and setting them up in the signalhead table and testing them on the table. I then use the script:

signals.getSignalHead("LH$1").setAppearance(RED) #red

Changing the color and it worked.

I then ran the code in the below and it does not work I am looking for suggestion as to what I am doing wrong. I am wondering if I would be better off defining the turnouts in the turnout table like I did for the signalheads.

If so I just need to monitor the sensors and need to command to do it. Any help is appreciated.
Thanks Paul

#Three_aspect Program to control a 3 aspect cascading signal system
#The idea is that if a train in a given block the block that it is in is
#green the one behind it is red, the next back is yellow, and the next back is dark.
#
# > > > >
# ls20 ls1 ls2 lsx
# >Train>
# ___________ ___________ ____________ ___________
# Green Red Yellow dark
#
#

import jarray
import jmri
import java

class Three_aspect(jmri.jmrit.automat.AbstractAutomaton) :

def defineIO(self):
#list of sensors
self.ds01 = sensors.provideSensor("1")
self.ds02 = sensors.provideSensor("2")
self.ds03 = sensors.provideSensor("3")
self.ds04 = sensors.provideSensor("4")
self.ds20 = sensors.provideSensor("20")
self.to01 = turnouts.provideTurnout("1")
self.to99 = turnouts.provideTurnout("99")

self.setInputs(jarray.array([self.ds01,self.ds02,self.ds03,self.ds04,self.ds20,self.to01,self.to99],jmri.NamedBean))

return

def setOutput(self):
#block 1
if self.ds01.knownState == ACTIVE :
signals.getSignalHead("LH$1").setAppearance(RED) #red
elif self.ds02.knownState == ACTIVE :
signals.getSignalHead("LH$1").setAppearance(YELLOW) #yellow
elif self.ds20.knownState == ACTIVE :
signals.getSignalHead("LH$1").setAppearance(GREEN) #green
else:
signals.getSignalHead("LH$1").setAppearance(DARK) #dark

#block 2
if selfto07.knownState == THROWN :
signals.getSignalHead("LH$2").setAppearance(RED) #if turnout 7 is thrown then red light else normal operation
elif self.ds02.knownState == ACTIVE :
signals.getSignalHead("LH$2").setAppearance(RED) #red
elif self.ds03.knownState == ACTIVE :
signals.getSignalHead("LH$2").setAppearance(YELLOW) #yellow
elif self.ds01.knownState == ACTIVE :
signals.getSignalHead("LH$2").setAppearance(GREEN) #green
else:
signals.getSignalHead("LH$2").setAppearance(DARK) #dark

#block 3
if self.to99.knownState == THROWN :
signals.getSignalHead("LH$3").setAppearance(RED) #hold point 1 If thrown Red light must get switchlist from dispatcher Else normal operation
elif self.to01.knownState == THROWN :
signals.getSignalHead("LH$3").setAppearance(RED) #If turnout 1 thrown then red light Else normal operation
elif self.ds03.knownState == ACTIVE :
signals.getSignalHead("LH$3").setAppearance(RED) #red
elif self.ds04.knownState == ACTIVE :
signals.getSignalHead("LH$3").setAppearance(YELLOW) #yellow
elif self.ds02knownState == ACTIVE :
signals.getSignalHead("LH$3").setAppearance(GREEN) #green
else:
signals.getSignalHead("LH$3").setAppearance(DARK) #dark

return
Three_aspect().start()




--
Bob Jacobsen
rgj1927@...


Locked Re: JMRI starter tutorial

 

Try this link. It is a power point presentation on using OperationsPro
www.bhamrails.info/Model_Railroading/New Layout/Operations/JMRI Ops.
Paul D


Locked Re: JMRI starter tutorial

 

Thanks Gerald. I browsed through this and seems something I can learn from.
Are you aware of something similar for Operations?


Locked Re: JMRI starter tutorial

 

¿ªÔÆÌåÓý

Paul

Two months ago a? gave a clinic on Decoder Pro. This was a "Hands On" Clinic where those attending were in "paired" with a friend for the clinic. The clinic took 4 hours - 2 in the morning then a break for 1 hour for refreshments then another 2 hours. Each pair had a system set up on the table so they could try things out as the clinic progressed.

For this clinic I put together some notes - with plenty of explanations. Those who attend (20 of them) had either a Sprog or an NCE system, with a laptop - all Windows. As I knew everyone in the clinic, their layouts, and roughly the skills the notes were 'tailored' to suit.

I have put the notes (20 pages) on the web for anyone to download and read. The notes were written in Australian but should translate easy enough to American or English.

May or may not be of help.

Gerry

On 7/11/2018 1:45 pm, Paul Davidson wrote:
I cannot answer all your questions but I was in same boat when I started learning JMRI earlier this year with no one locally to help me. I could read the guide but it left me with a million questions. I eventually found numerous tutorials on line that provided "how to" example. That got me over the hump in my learning curve. Do a google search for JMRI tutorials and several will show up. My biggest problem with almost all I found was that they were built using older versions of JMRI thus the screens did not match very well with the latest versions. However, they still were very valuable.
I have a Digitrax layout thus I use Loconet. When not connected to my layout, I use the "Loconet Simulator" to play with my JMRI files.
Paul D
-- 
Gerry Hopkins MMR #177 FNMRA
Great Northern Downunder




NMRA Australasian Region
Contest & AP Chairman
Web Administrator




Virus-free.


Locked Re: JMRI starter tutorial

 

Is there a way to attach a screenshot to a post?
I was trying to build a train and it gave this error "Train requires 1 locos, could not pick up at departure(Cassette) or set out at (Cassette)


Locked Re: Copy panel

 

Thanks for that. Looks like our webmaster removed the page completely since registrations closed last week, but didn't provide an explanatory page or redirect.

He may have told members at club meeting yesterday but I was in hospital undergoing surgery.

I'll remove the link from my signature and chew his ear...

I don't think I'd downloaded the Program either... But I'll be there answering questions all weekend.
--
Dave in Australia

On 7 Nov 2018, at 1:47 PM, Paul Davidson <pdavidson@...> wrote:

Dave,
The New England Convention 2018 link does not work.


Locked Re: JMRI starter tutorial

 

Thanks Paul.
I searched and came across this tutorial that I am going through.


I currently see this error that I am trying to figure out.



Locked Re: Copy panel

 

Dave,
The New England Convention 2018 link does not work.
Paul D


Locked Re: JMRI starter tutorial

 

I cannot answer all your questions but I was in same boat when I started learning JMRI earlier this year with no one locally to help me. I could read the guide but it left me with a million questions. I eventually found numerous tutorials on line that provided "how to" example. That got me over the hump in my learning curve. Do a google search for JMRI tutorials and several will show up. My biggest problem with almost all I found was that they were built using older versions of JMRI thus the screens did not match very well with the latest versions. However, they still were very valuable.
I have a Digitrax layout thus I use Loconet. When not connected to my layout, I use the "Loconet Simulator" to play with my JMRI files.
Paul D


Locked Re: BD20 block detection

 

¿ªÔÆÌåÓý

Make sure you don't have your Tables set to load at Startup, nor Show Cabs when changing the NCE USB's cab address.
Either of these loading at startup will prevent you using the Configure USB command before the NCE USB locks up.

--?
Dave in Australia

The New England Convention 2018

On 7 Nov 2018, at 1:19 AM, Dave Heap <dgheap@...> wrote:

On 7 Nov 2018, at 12:35 AM, Ken Cameron <kcameron@...> wrote:

1. Install the new chip. Confirm things still work ok. You should see the
7.3.0 in the console log. Keep JMRI running.
2. Change the connection preference to say you have the 7.3.* and the baud
rate change for 19,200. Save and exit JMRI.
3. Install the jumpers (all) on the USB. Cycle power.
4. Confirm this is now working. Should id as 7.3.7, and no AA command
timeouts.


You may get other command timeouts (and a stuck Cab Bus LED). if the address already stored in the NCE USB Cab ID Is invalid.

If so, unplug/replug the Cab Bus cable and give the command below before the LED gets stuck on again.

(Both the AA Return Version and B1 Set Cab ID commands are processed in the USB and not sent to the command station.)

5. Use the USB Cab Id command to set it to 10. This gets it out of the range
useable for throttles.
6. Restart JMRI, confirm still working, Show Cabs should work and show USB
as 10.


Dave


Locked Re: Copy panel

 

¿ªÔÆÌåÓý

For more understanding of this topic, see:
<>
For a sharing example, see:
<>

--?
Dave in Australia

The New England Convention 2018

On 7 Nov 2018, at 10:57 AM, Ken Cameron <kcameron@...> wrote:

You can copy the whole profile directory from one computer to another. Then
update the connections to simulator.


Locked Re: Adding new "info" field to the Cars and Loco tab in OpsPro

 

Dan,
Either the values field or the comments field would work for me. I am looking for a field where I can put in multiple lines rather than a single string of text. I would hope that it would show up as multiple lines when I use the export feature even if they remained as a single field.
Paul D


Locked Re: Using tools in Panel Pro

 

Clay,

There was an issue with that older version that would 'on some specific
systems' take a very long time for the tables to open. It was related to an
issue with the audio libraries. But to open the tables, that would trigger
it.

Just update and you should be fine.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.com
www.syracusemodelrr.org


Locked Re: Still Trying to write a script using Digitrax Sensors and NCE lights its

 

Paul,

The easiest way to learn how to use scripts in JMRI is to start with the discussion found at and work with the simplest examples provided with the distribution downloaded and installed on your computer.

Often an example script will provide a simple starting point for your problem. Provide lots of print statements or learn how to use the

import org.apache.log4j

to put log statements in the JMRI System Console. Make small changes and when some incremental progress is made, save the file with a new name. Do that early and often.

A significant rule when using AbstractAutomation is that you must supply at least the two functions named init() and handle() to at least get some kind of output. After cleaning up some of the indents of your text and inserting a few obviously wild guesses the following code produces some error messages, most noticeably a missing function definition.

Without a better understanding of your system and what problem you are really trying to solve, all that I can do from here is to throw the ball back into your court.

Cliff in Baja SoCal

#Three_aspect  Program to control a 3 aspect cascading signal system
#The idea is that if a train in a given block the block that it is in is
#green the one behind it is red, the next back is yellow, and the next back is dark.
#
#        >           >            >            >
#       ls20        ls1          ls2          lsx
#     >Train>
#  ___________ ___________ ____________ ___________
#      Green       Red         Yellow       dark
#
#

import jarray
import jmri
import java

class Three_aspect(jmri.jmrit.automat.AbstractAutomaton) :

#    init() overloads the "User-provided initialization routine"
#    that is inherited from AbstractAutomaton
    def init(self):
        print "starting the initialization"
        self.defineIO()
        return
# END OF init()
##############################

#    handle() overloads the "User-provided main routine"
#    that is inherited from AbstractAutomaton
    def handle(self):
        print "xxx"
        self.setOutput()
        return True    # return False to terminate the thread
# END OF handle()
##############################


    def defineIO(self):
        #list of sensors
        self.ds01 = sensors.provideSensor("1")
        self.ds02 = sensors.provideSensor("2")
        self.ds03 = sensors.provideSensor("3")
        self.ds04 = sensors.provideSensor("4")
        self.ds20 = sensors.provideSensor("20")
        self.to01 = turnouts.provideTurnout("1")
        self.to99 = turnouts.provideTurnout("99")

        self.setInputs(jarray.array([self.ds01,self.ds02,self.ds03,self.ds04,self.ds20,self.to01,self.to99],jmri.NamedBean))

        return
   
    def setOutput(self):
        #block 1
        if self.ds01.knownState == ACTIVE :
            signals.getSignalHead("LH$1").setAppearance(RED)  #red
        elif self.ds02.knownState == ACTIVE :
            signals.getSignalHead("LH$1").setAppearance(YELLOW)  #yellow
        elif self.ds20.knownState == ACTIVE :
            signals.getSignalHead("LH$1").setAppearance(GREEN) #green
        else:
            signals.getSignalHead("LH$1").setAppearance(DARK)  #dark

        #block 2
        if self.to07.knownState == THROWN :
            signals.getSignalHead("LH$2").setAppearance(RED) #if turnout 7 is thrown then red light else normal operation
        elif self.ds02.knownState == ACTIVE :
            signals.getSignalHead("LH$2").setAppearance(RED) #red
        elif self.ds03.knownState == ACTIVE :
            signals.getSignalHead("LH$2").setAppearance(YELLOW) #yellow
        elif self.ds01.knownState == ACTIVE :
            signals.getSignalHead("LH$2").setAppearance(GREEN) #green
        else:
            signals.getSignalHead("LH$2").setAppearance(DARK) #dark

        #block 3
        if self.to99.knownState == THROWN :
            signals.getSignalHead("LH$3").setAppearance(RED) #hold point 1 If thrown Red light must get switchlist from dispatcher Else normal operation
        elif self.to01.knownState == THROWN :
            signals.getSignalHead("LH$3").setAppearance(RED) #If turnout 1 thrown then red light Else normal operation
        elif self.ds03.knownState == ACTIVE :
            signals.getSignalHead("LH$3").setAppearance(RED) #red
        elif self.ds04.knownState == ACTIVE :
            signals.getSignalHead("LH$3").setAppearance(YELLOW) #yellow
        elif self.ds02.knownState == ACTIVE :
            signals.getSignalHead("LH$3").setAppearance(GREEN) #green
        else:
            signals.getSignalHead("LH$3").setAppearance(DARK) #dark

        return

Three_aspect().start()


Locked JMRI starter tutorial

 

Is there a starter tutorial that I can follow step by step to understand JMRI.
Currently, I do not have a command controller that I connect to. Hence, I would like to use a simulator, if possible.
Also, I understand that SoundPro can be used to play sounds even if the locomotive does not support sound.
Is it possible to test this also in offline mode?


Locked Re: Copy panel

 

You can copy the whole profile directory from one computer to another. Then
update the connections to simulator.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.com
www.syracusemodelrr.org


Locked Still Trying to write a script using Digitrax Sensors and NCE lights its

 

I got the NCE lightits to work by addressing them 1 thru 3 and setting them up in the signalhead table and testing them on the table.? I then use the script:

signals.getSignalHead("LH$1").setAppearance(RED)? #red

Changing the color and it worked.

I then ran the code in the below and it does not work I am looking for suggestion as to what I am doing wrong.? I am wondering if I would be better off defining the turnouts in the turnout table like I did for the signalheads.?

If so I just need to monitor the sensors and need to command to do it.? Any help is appreciated.
Thanks Paul

#Three_aspect? Program to control a 3 aspect cascading signal system
#The idea is that if a train in a given block the block that it is in is
#green the one behind it is red, the next back is yellow, and the next back is dark.
#
#??????? >?????????? >??????????? >??????????? >
#?????? ls20??????? ls1????????? ls2????????? lsx
#???? >Train>
#? ___________ ___________ ____________ ___________
#????? Green?????? Red???????? Yellow?????? dark
#
#

import jarray
import jmri
import java

class Three_aspect(jmri.jmrit.automat.AbstractAutomaton) :

??? def defineIO(self):
??? ??? #list of sensors
??? ??? self.ds01 = sensors.provideSensor("1")
??? ??? self.ds02 = sensors.provideSensor("2")
??? ??? self.ds03 = sensors.provideSensor("3")
??? ??? self.ds04 = sensors.provideSensor("4")
?????????????????????????????????? self.ds20 = sensors.provideSensor("20")
?????????????????????????????????? self.to01 = turnouts.provideTurnout("1")
?????????????????????????????????? self.to99 = turnouts.provideTurnout("99")

??? ??????? self.setInputs(jarray.array([self.ds01,self.ds02,self.ds03,self.ds04,self.ds20,self.to01,self.to99],jmri.NamedBean))

??? ??? return
???
??? def setOutput(self):
??? ??? #block 1
??? ??? if self.ds01.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$1").setAppearance(RED)? #red
??? ??? elif self.ds02.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$1").setAppearance(YELLOW)? #yellow
??? ??? elif self.ds20.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$1").setAppearance(GREEN) #green
??? ??? else:
??? ??? ??? signals.getSignalHead("LH$1").setAppearance(DARK)? #dark

??? ??? #block 2
??????????????? if self.to07.knownState == THROWN :
???????????????????????? signals.getSignalHead("LH$2").setAppearance(RED) #if turnout 7 is thrown then red light else normal operation
??? ??? elif self.ds02.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$2").setAppearance(RED) #red
??? ??? elif self.ds03.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$2").setAppearance(YELLOW) #yellow
??? ??? elif self.ds01.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$2").setAppearance(GREEN) #green
??? ??? else:
??? ??? ??? signals.getSignalHead("LH$2").setAppearance(DARK) #dark

??? ??? #block 3
??????????????? if self.to99.knownState == THROWN :
?????????????????????? signals.getSignalHead("LH$3").setAppearance(RED) #hold point 1 If thrown Red light must get switchlist from dispatcher Else normal operation
??????????????? elif self.to01.knownState == THROWN :
??????????????????????? signals.getSignalHead("LH$3").setAppearance(RED) #If turnout 1 thrown then red light Else normal operation
??? ??? elif self.ds03.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$3").setAppearance(RED) #red
??? ??? elif self.ds04.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$3").setAppearance(YELLOW) #yellow
??? ??? elif self.ds02.knownState == ACTIVE :
??? ??? ??? signals.getSignalHead("LH$3").setAppearance(GREEN) #green
??? ??? else:
??? ??? ??? signals.getSignalHead("LH$3").setAppearance(DARK) #dark

??? ??? return
Three_aspect().start()

??

???????


Locked Using tools in Panel Pro

 

When I open Panel Pro, go to tools, then tables, and try to select either turnouts or sensors so that I can add them, nothing opens up. I haven't done this in a while and wonder if something has changed since I last did this. Running version 4.10 on a Windows 10 PC. Thanks in advance.
Clay Smith
Hopkinsville KY


Locked Re: Copy panel

 

Many thanks Ken, can I also copy the file over to another computer?

Best regards
Stewart

On 6 Nov 2018, at 20:50, Ken Cameron <kcameron@...> wrote:

Yes.

For offline work, almost all connections support an option for "simulator".
Setup a profile using those for your connections. Then it will work. Many
setup two profiles on the same computer to let them work on panels without
the layout powered up by using the simulator connection.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.com
www.syracusemodelrr.org