¿ªÔÆÌåÓý

Date

Locked Re: PanelPro v. 4.12 Save & Re-Open error

 

Dave,

I open the throttle panel from the main PanelPro window. PanelPro / Panels / Open Panel¡­ / Documents / My JMRI / Throttle 072318. The file location for Throttle 072318 is in a new folder called My JMRI in my main Documents directory under my user name on the C drive.

?

I tried saving and opening a throttle in the default location My JMRI Railroad under my user name, but it gave the same error message. I open the Throttle from Panel Pro / Panels / Open Panel¡­

?
Thanks,

Patrick W.


Locked Re: I/R detectors

Jon Miller
 

¿ªÔÆÌåÓý

On 8/13/2018 8:50 AM, John wrote:
Don't think white is the best choice because of reflections

??? Agree.? In the photo below the IR detectors? work just fine. The wall/ceiling is at a greater angle and closer for these detectors then the one at the gates.?

??? In the photo below the IR detectors won't work.?

??? Also note IR floods I had previously installed for another test.? They are not on now but did turn them on once.? They totally flood the detectors and if I change high/low outputs they might work with just the detector part of the module. ? [this requires testing as cars on one track may block the detectors on the other track]

??? The glossy white paint was put on to see if above reflection would help, it didn't.

-- 
Jon Miller
For me time stopped in 1941
Digitrax  Chief/Zephyr systems, JMRI User
SPROG User
NMRA Life member #2623
Member SFRH&MS


Locked Re: I/R detectors

Jon Miller
 

¿ªÔÆÌåÓý

On 8/13/2018 8:50 AM, John wrote:
Don't think white is the best choice because of reflections

??? Agree.? In the photo below the IR detectors? work just fine. The wall/ceiling is at a greater angle and closer for these detectors then the one at the gates.?

??? In the photo below the IR detectors won't work.?

??? Also note IR floods I had previously installed for another test.? They are not on now but did turn them on once.? They totally flood the detectors and if I change high/low outputs they might work with just the detector part of the module. ? [this requires testing as cars on one track may block the detectors on the other track]

??? The glossy white paint was put on to see if above reflection would help, it didn't.

-- 
Jon Miller
For me time stopped in 1941
Digitrax  Chief/Zephyr systems, JMRI User
SPROG User
NMRA Life member #2623
Member SFRH&MS


Locked Re: EPrompt change

 

Wayne,

What's an EPrompt? I've never heard of one, either inside JMRI or outside of it, either.

I suspect that you will need to give us some context on your problem. And I wonder if your problem may be unrelated to JMRI...

Regards,
Billybob


Locked Re: engine runs by itself when connected to jmri and sprog

 

Set CV 29 bit 2 to zero NMRA DCC Only.

Mark P Stamm
Mark at Euphoriatt dot Com

Sent from my mobile device


Locked Re: I/R detectors

 

I used black as that was what was to hand...if you have a digital camera, you
should be able to see the IR beam, works for TV remotes too.

Don't think white is the best choice because of reflections, think about this,
why are cameras (film or digital) and their accessories black?

John

---------- Original Message ----------
From: Jon Miller <atsfus@...>
Date: August 13, 2018 at 10:20 AM


/On 8/13/2018 6:00 AM, John wrote://
/
/I use the "el cheapo" ones from eBay. I put short lengths of 1/4" heat
shrink tubing on both the emitter and receiver LEDs,/
??? I didn't realize the side reflections would be critical.? I'm going
to try the tubing. Question or thought, would white tubing work better
or worse than black tubing.? I think white would reflect upward where
black wouldn't reflect at all.? Also would black paint work the same?

?? Problem I have is the house where the layout is located is away from
everything so ordering is the only choice I have.? Mail takes time.? In
a few days will be back in the bay area (CA) so can get materials but
then I'm not near the layout for testing.:-(

--
Jon Miller
For me time stopped in 1941
Digitrax Chief/Zephyr systems, JMRI User
SPROG User
NMRA Life member #2623
Member SFRH&MS




Locked Re: I/R detectors

Jon Miller
 

¿ªÔÆÌåÓý

On 8/12/2018 6:31 PM, Greg Komar wrote:
I¡¯ve got three times the amount of IR aimed at the detector, with the same current level (and heat) as one emitter. Maybe it¡¯ll work in a reflective environment like you¡¯re using

Greg,

??? Have some heavily cropped pictures so you can see what I'm working with.? You might be able to see the photo cells and IR sensors in the track.? You can also see the IR floods I had previously installed.? The picture of the gates was a blue wall and I painted gloss white to see if the reflection worked better, it didn't.

??? What's interesting is that the right IR sensor/s work just fine and the ones for the gates don't.? Geodesic domes can have some problems.

-- 
Jon Miller
For me time stopped in 1941
Digitrax  Chief/Zephyr systems, JMRI User
SPROG User
NMRA Life member #2623
Member SFRH&MS


Locked Re: I/R detectors

Jon Miller
 

¿ªÔÆÌåÓý

On 8/13/2018 6:00 AM, John wrote:
I use the "el cheapo" ones from eBay. I put short lengths of 1/4" heat shrink
tubing on both the emitter and receiver LEDs,

??? I didn't realize the side reflections would be critical.? I'm going to try the tubing.? Question or thought, would white tubing work better or worse than black tubing.? I think white would reflect upward where black wouldn't reflect at all.? Also would black paint work the same?

?? Problem I have is the house where the layout is located is away from everything so ordering is the only choice I have.? Mail takes time.? In a few days will be back in the bay area (CA) so can get materials but then I'm not near the layout for testing.:-(

-- 
Jon Miller
For me time stopped in 1941
Digitrax  Chief/Zephyr systems, JMRI User
SPROG User
NMRA Life member #2623
Member SFRH&MS


Locked Re: Using Python to select a function by name rather than F number

 

Thank you Bob, that's really helpful


Locked Re: Multiple turnouts on one address using functions?

 

Dave,

I did my initial changes directly in the Script Entry and attempted to save to the default location.

I downloaded and installed Notepad++ and will give it a shot.

As I noted in another message, it will be a slow process. I'll try not to ask questions until I'm sure I can't work around any problems I run into. It's harder getting back into this than I expected, so I'm going to have to throw more time into it.

Thanks again.

Don


Locked Re: Multiple turnouts on one address using functions?

 

Cliff,

Thanks for the idea.?

Per notes - 1. Probably not going to be a problem. Circumstances required me to tear down my big layout, sell most of my stuff and rebuild to a smaller (ironically in a larger scale) layout. 15 turnouts and 6 locos total. Available slots shouldn't be a problem for now.
? ? ? ? ? ? ? ? ? ?2. This shouldn't be an immediate problem except the possiblity of a turnout being switched by the throttle and JMRI not knowing because of lack of feedback. Right now the throttle is the only way I can work it, so I'll leave addressing that until the rest of it is up and running. Currently using a spare 7 inch Kindle running Engine Driver as a throttle. Keep two open - one controlling loco(s) and the other for turnouts. It's working, but cumbersome. I recently aquired a cast off? 6 inch, which fits better in the hand, but the difference in screen space is a problem. Don't even want to talk about the fun getting updates to Engine Driver on them. Amazon is very slow to post updates to APPS. Fortunately, Steve is good about having them on his website and I'm well versed in the procedure to get them on the Kindle.

This is going to be a slow precedure as the time I can play with my train is limited, which in turn is divided between getting the layout looking like something and messing with the electronics. Not knowing what to do first is a terrible problem, huh?
Thanks for the suggestions and I'll keep slogging away.

Don


Locked Re: Using Python to select a function by name rather than F number

 

If you have the RosterEntry for your locomotive (call it ¡°re¡±) then you can get the label for a particular function with e.g.

re.getFunctionLabel(12)

You could write a loop over 0 to 28 to pull all the names and make a map from names to numbers.

Bob

On Aug 13, 2018, at 9:08 AM, LMSFAN72 <andrew@...> wrote:

Hi

I have no idea if this is actually possible, but,...

I would like to be able to write a script that uses a function's name to turn on a function of my running locomotive rather than the F numbers. This is because I want to be able to select a loco from my roster via a dropdown box and then automate the running of that on my layout. I can use sensors and speeds generically to achieve that but I have many different decoders in the locos so the functions are not very similar. What is similar, however, is the function label that I have used (e.g. "Headlight"). Can anyone suggest a way/some scripting to do this? Maybe there a way to read the labels associated with a throttle's function and then use that to set the function?
--
Bob Jacobsen
rgj1927@...


Locked Using Python to select a function by name rather than F number

 

Hi

I have no idea if this is actually possible, but,...

I would like to be able to write a script that uses a function's name to turn on a function of my running locomotive rather than the F numbers. This is because I want to be able to select a loco from my roster via a dropdown box and then automate the running of that on my layout. I can use sensors and speeds generically to achieve that but I have many different decoders in the locos so the functions are not very similar. What is similar, however, is the function label that I have used (e.g. "Headlight"). Can anyone suggest a way/some scripting to do this? Maybe there a way to read the labels associated with a throttle's function and then use that to set the function?

Many Thanks

Andrew


Locked Re: I/R detectors

 

I use the "el cheapo" ones from eBay. I put short lengths of 1/4" heat shrink
tubing on both the emitter and receiver LEDs, I don't shrink the tubing.
These trigger a relay which cuts power to staging tracks, power is returned when
the turnout is thrown for that track.

John

---------- Original Message ----------
From: Dave Pallant <dave@...>
Date: August 13, 2018 at 4:24 AM


We use a lot of cheap IR emitter/detectors on our club layouts and find that
they can seem a little insensitive if merely mounted looking up between the
sleepers through a hole. The problem seems to be reflection from the
environment around the sensor even when the train is not above the sensor.
With the cheaper sensors there is a light path from emitter to detector and if
mounted up through a hole there can be reflection from the sides of the hole
short cutting the IR path. When the sensor sensitivity is turned up you just
see more of the emitter and so the detector saturates.

We got around this problem by putting a short black tube onto the emitter and
detector so the only light the detector could see was off of the trains. We
used short lengths of black heatshrink about 5mm diameter (5mm led and
detector) and 8mm long and we could then turn up the sensitivity so the sensor
only triggered when a train went over. You can also use rubber sleeving of
about 5mm or whatever diameter your lens are. The detectors seem to detect any
stock that runs over them so all materials and all colours.

Dave



Locked New file uploaded to [email protected]

[email protected] Notification
 

Hello,

This email message is a notification to let you know that a file has been uploaded to the Files area of the [email protected] group.

File: tcs-wow.zip

Uploaded By: Michael Mosher

Description:
add quill checkboxes to diesel sound set 3 & 4.

You can access this file at the URL:
/g/jmriusers/files/Decoder%20files/TCS%20decoders/tcs-wow.zip

Cheers,
The Groups.io Team


Locked Re: Trying to write a script to based on LocoSelectorDropBox.py and BackandForthTimed.py to enable a loco to be selected for a back and forth run rather than hard-coded

 

A little update. I have now got this working (to a degree!). I rebooted and seems to have cleared some things. It seemed it also didn't like the delay functions. Replacing those with a straight number, and changing the print (delay)/1000 to print (delay/1000) has got ?it working, so I am learning!


Locked Re: I/R detectors

 

I use IR LEDs L-934F3BT . For H0 scale I use two LEDs in series with a set current of 30 mA. One phototransistor L-932P3BT.
I resolve the issue with reflection by the software.
Circuit Description

Petr


Locked Re: Layout editor and block numbering problems

 

Hi George,

I'm happy to write up the 1st issue on GitHub, but I can't see PR #5639 and don't want to duplicate what you've done. ?
Is this the "Block Name" combobox in the editor panel?
Yes - The problem I was describing here is not what happens if you leave the combobox blank. ?It's what happens if you select a block by its 'IBx:y' format system name as autogenerated. ?Instead of getting the block you've selected when you create the layout editor component, you get a new block with an IBn system name and a user name of IB1:3 or whatever.
?I'd prefer that autogenerated names pick the next (numerically) available names; for example: If I input IB3 and autogenerate three more they'd be IB4, IB5 and IB6.
This seems sensible to me. ?It would mean that the system names generated by this method are the same as would be generated if you assign a user block name to track segment using the context menu as described by Dave above.

Regards

Paul


Locked Re: Trying to write a script to based on LocoSelectorDropBox.py and BackandForthTimed.py to enable a loco to be selected for a back and forth run rather than hard-coded

 

Hi, so I got around to trying this having first tried to work out what it was doing. The piece that I could not understand was how the throttle selection entered in the box gets passed to the throttle. I commented out sensors to start with as I haven't set them up yet and just wanted to understand what is happening. My IDE only deals with Python 3.6 so I updated the print statements to functions.

I then added additional self.status.text display lines and print comments to help me debug. My code is below. However, I cannot get past the selection box. I enter the number and press start and nothing else happens - I get my print messages in the script output box (code highlighted in BOLD but nothing else happens). Any help appreciated!

# Based on script 'Back and Forth with mid stop'.
# Listens to sensors, running a locomotive back and
# forth between three towns, changing its direction when at end sensors.
#
# Author: ?Howard Watkins, January 2007.
# Part of the JMRI distribution
#
# Modified by Peter Ulvestad, June 2009
# Added Mid Station stop
#
# Modified by Peter Ulvestad, June 2017
# Modified for added sensors
#
# Modified by Peter Ulvestad, Jan 2018
# Updated comments
#
# The next line is maintained by CVS, please don't change it
# $Revision: 1.1 $
?
import jarray
import jmri
import javax.swing
?
class FireValleyAutoRun(jmri.jmrit.automat.AbstractAutomaton) :
?
# init() is called exactly once at the beginning to do
# any necessary configuration.
? ? def init(self):
? ? ? ? self.status.text = "Initiating"
?
? ? ? ? # set up sensor numbers
? ? ? ? # fwdSensor is reached when loco is running forward
?## ? ? ? self.edSensor = sensors.provideSensor("LS1240")
?## ? ? ? self.edslowSensor = sensors.provideSensor("LS1158")
?## ? ? ? self.crSensor = sensors.provideSensor("LS1539")
?## ? ? ? self.fvfwdSensor = sensors.provideSensor("LS1350")
?## ? ? ? self.fvrevSensor = sensors.provideSensor("LS1349")
?
? ? ? ? # get loco address.
? ? ? ? print ("getting throttle")
? ? ? ? self.status.text = "Getting throttle"
? ? ? ? number = int(self.address.text)
? ? ? ? print (number)
? ? ? ? self.status.text = number
? ? ? ? if (number > 127) :
? ? ? ? ? ? long = True
? ? ? ? else :
? ? ? ? ? ? long = False
? ? ? ? ? ? self.throttle = self.getThrottle(number, long)
? ? ? ? if (self.throttle == None) :
? ? ? ? ? ? print ("Couldn't assign throttle!")
? ? ? ? ? ? self.status.text = "no throttle"
? ? ? ? return
?
? ? def handle(self):
? ? ? ? # handle() is called repeatedly until it returns false.
? ? ? ? print ("Inside handle(self)")
?
?
? ? ? ? # set loco to forward
? ? ? ? self.status.text = "Setting Loco Forward"
? ? ? ? print (" ")
? ? ? ? print ("Setting Loco Forward")
? ? ? ? self.throttle.setIsForward(True)
? ? ? ? self.waitMsec(5000)
?
? ? ? ? # turn on headlight and blow horn
? ? ? ? self.throttle.setF0(True)
? ? ? ? self.waitMsec(1000)
? ? ? ? self.throttle.setF1(True)
? ? ? ? self.waitMsec(2000)
? ? ? ? self.throttle.setF1(False)
?
? ? ? ? # wait 1 second for layout to catch up, then set speed
? ? ? ? self.waitMsec(1000)
? ? ? ? self.status.text = "Setting Speed"
? ? ? ? self.throttle.setSpeedSetting(0.30)
? ? ? ? self.status.text = "Southward to Fire Valley"
? ? ? ? print (" ")
? ? ? ? print ("Southward to Fire Valley")
? ? ? ? self.waitMsec(15000)
? ? ? ? self.throttle.setSpeedSetting(0.95)
? ? ? ? self.waitMsec(15000)
? ? ? ? self.throttle.setSpeedSetting(0.70)
?
? ? ? ? # wait for Fire Valley reverse sensor, slow then stop when Fire Valley forward sensor is triggered.
? ## ? ? ?self.waitSensorActive(self.fvrevSensor)
? ? ? ? self.status.text = "Slowing for Fire Valley"
? ? ? ? print (" ")
? ? ? ? print ("Slowing for Fire Valley")
? ? ? ? print (" ")
? ? ? ? self.throttle.setSpeedSetting(0.40)
? ## ? ? ?self.waitSensorActive(self.fvfwdSensor)
? ? ? ? self.status.text = "Fire Valley"
? ? ? ? print ( "Fire Valley")
? ? ? ? self.throttle.setSpeedSetting(0)
? ? ? ? self.waitMsec(500)
? ? ? ? self.throttle.setSpeedSetting(-1)
? ? ? ? self.waitMsec(1000)
?
? ? ? ? # wait for timed Station stop using random timer then set speed
? ? ? ? delay = java.util.Random().nextInt(25000) +5000
? ? ? ? print(delay)/1000
? ? ? ? print ("second Station Stop")
? ? ? ? self.waitMsec(delay) # wait for 5 - 30 seconds
? ? ? ? self.status.text = "Setting Speed"
? ? ? ? self.throttle.setSpeedSetting(0.3)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.4)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.5)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.75)
?
? ? ? ? # wait for Edgewood slow sensor in forward direction to trigger, slow, then stop on Edgewood sensor.
? ? ? ? self.status.text = "Next Stop - Edgewood"
? ? ? ? print (" ")
? ? ? ? print ("Next Stop - Edgewood")
?## ? ? ? self.waitSensorActive(self.edslowSensor)
? ? ? ? print (" ")
? ? ? ? self.status.text = "Slowing for Edgewood Station"
? ? ? ? print ("Slowing for Edgewood Station")
? ? ? ? self.throttle.setSpeedSetting(0.6)
? ? ? ? self.waitMsec(4000)
? ? ? ? self.throttle.setSpeedSetting(0.5)
? ? ? ? self.waitMsec(4000)
? ? ? ? self.throttle.setSpeedSetting(0.4)
? ? ? ? self.waitMsec(4000)
? ? ? ? self.throttle.setSpeedSetting(0.3)
? ? ? ? self.waitSensorActive(self.edSensor)
? ? ? ? self.throttle.setSpeedSetting(0)
? ? ? ? self.waitMsec(200)
? ? ? ? self.throttle.setSpeedSetting(-1)
? ? ? ? self.waitMsec(2000)
? ? ? ? # turn off Headlight
? ? ? ? self.throttle.setF0(False)
? ? ? ? self.throttle.setIsForward(False)
?
? ? ? ? # wait for timed Station stop using random timer then set speed
? ? ? ? self.status.text = "Edgewood"
? ? ? ? print ("Edgewood")
? ? ? ? delay = java.util.Random().nextInt(115000) +5000
? ? ? ? print(delay)/1000
? ? ? ? print ("second Station Stop")
? ? ? ? self.waitMsec(delay) # wait for 5 - 120 seconds
? ? ? ? # turn on Headlight
? ? ? ? self.throttle.setF0(True)
? ? ? ? self.status.text = "Setting Loco Reverse"
? ? ? ? self.throttle.setIsForward(False)
? ? ? ? self.waitMsec(1000)
? ? ? ? self.throttle.setF0(True)
? ? ? ? self.waitMsec(1000)
? ? ? ? self.throttle.setF1(True)
? ? ? ? self.waitMsec(2000)
? ? ? ? self.throttle.setF1(False)
? ? ? ? self.waitMsec(1000)
? ? ? ? self.status.text = "Setting Speed"
? ? ? ? print (" ")
? ? ? ? print ( "Setting Speed")
? ? ? ? self.throttle.setSpeedSetting(0.50)
? ? ? ? self.waitMsec(2500)
? ? ? ? self.throttle.setSpeedSetting(0.95)
? ? ? ? self.waitMsec(10000)
? ? ? ? self.throttle.setSpeedSetting(0.75)
?
? ? ? ? # wait for Fire Valley forward sensor to trigger, slow, then stop on Fire Valley reverse sensor.
? ? ? ? self.status.text = "Northward to Fire Valley"
? ? ? ? print (" ")
? ? ? ? print ( "Northward to Fire Valley")
? ## ? ? ?self.waitSensorActive(self.fvfwdSensor)
? ? ? ? print (" ")
? ? ? ? self.status.text = "Slowing for Fire Valley Station"
? ? ? ? print ("Slowing for Fire Valley Station")
? ? ? ? self.throttle.setSpeedSetting(0.6)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.5)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.4)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.3)
? ## ? ? ?self.waitSensorActive(self.fvrevSensor)
? ? ? ? self.status.text = "Fire Valley"
? ? ? ? print (" ")
? ? ? ? print ( "Fire Valley")
? ? ? ? self.throttle.setSpeedSetting(0)
? ? ? ? self.waitMsec(200)
? ? ? ? self.throttle.setSpeedSetting(-1)
?
? ? ? ? # wait for timed Station stop using random timer then set speed
? ? ? ? delay = java.util.Random().nextInt(25000) +5000
? ? ? ? print(delay)/1000
? ? ? ? print ("second Station Stop")
? ? ? ? self.waitMsec(delay) # wait for 5 - 30 seconds
? ? ? ? self.status.text = "Setting Speed"
? ? ? ? print (" ")
? ? ? ? print ( "Setting Speed")
? ? ? ? self.throttle.setSpeedSetting(0.3)
? ? ? ? self.waitMsec(3000)
? ? ? ? self.throttle.setSpeedSetting(0.4)
? ? ? ? self.waitMsec(2000)
? ? ? ? self.throttle.setSpeedSetting(0.5)
? ? ? ? self.waitMsec(2000)
? ? ? ? self.throttle.setSpeedSetting(0.75)
? ? ? ? self.status.text = "Next Stop - Inonoaklin Creek"
? ? ? ? print (" ")
? ? ? ? print ("Next Stop - Inonoaklin Creek")
?
? ? ? ? # wait for Inonoaklin Creek to trigger
? ## ? ? ?self.waitSensorActive(self.crSensor)
? ? ? ? self.waitMsec(2000)
? ? ? ? self.throttle.setSpeedSetting(0)
? ? ? ? self.waitMsec(1000)
? ? ? ? self.throttle.setSpeedSetting(-1)
? ? ? ? self.waitMsec(1000)
? ? ? ? self.throttle.setIsForward(True)
? ? ? ? self.waitMsec(200)
? ? ? ? # turn off Headlight
? ? ? ? self.throttle.setF0(False)
? ? ? ? self.waitMsec(1000)
?
? ? ? ? # wait for timed Station stop using random timer then set speed
? ? ? ? self.status.text = "Inonoaklin Creek"
? ? ? ? print (" ")
? ? ? ? print ("Inonoaklin Creek")
? ? ? ? delay = java.util.Random().nextInt(115000) +5000
? ? ? ? print(delay)/1000
? ? ? ? print ("second Station Stop")
? ? ? ? self.waitMsec(delay) ? ? ? ?# wait for 5 - 120 seconds
?
? ? ? ? # and continue around again
? ? ? ? print (" ")
? ? ? ? return 1
? ? ? ? # To stop script, either kill the script in using the 'Thread Monitor'
? ? ? ? # or terminate JMRI.
? ? ? ? # Caution doing either so could leave loco running if not careful
?
? ? ? ? # Create Pane to enter Locomotive number
?
? ? ? ? # define what button does when clicked and attach that routine to the button
? ? def whenMyButtonClicked(self,event) :
? ? ? ? self.start()
? ? ? ? # we leave the button off
? ? ? ? self.startButton.enabled = False
?
? ? ? ? return
?
? ? ? ? # routine to show the panel, starting the whole process ? ??
? ? def setup(self):
? ? ? ? # create a frame to hold the button, set up for nice layout
? ? ? ? f = jmri.util.JmriJFrame("Lower Level Automation") ? ? ? # argument is the frames title
? ? ? ? f.contentPane.setLayout(javax.swing.BoxLayout(f.contentPane, javax.swing.BoxLayout.Y_AXIS))
?
? ? ? ? # create the text field
? ? ? ? self.address = javax.swing.JTextField(5) ? ?# sized to hold 5 characters, initially empty
?
? ? ? ? # put the text field on a line preceded by a label
? ? ? ? temppanel1 = javax.swing.JPanel()
? ? ? ? temppanel1.add(javax.swing.JLabel("Address"))
? ? ? ? temppanel1.add(self.address)
?
? ? ? ? # create the button
? ? ? ? self.startButton = javax.swing.JButton("Start")
? ? ? ? self.startButton.actionPerformed = self.whenMyButtonClicked
?
? ? ? ? self.status = javax.swing.JLabel("Enter address & click start")
?
? ? ? ? # Put contents in frame and display
? ? ? ? f.contentPane.add(temppanel1)
? ? ? ? temppanel2 = javax.swing.JPanel()
? ? ? ? temppanel2.add(self.startButton)
? ? ? ? f.contentPane.add(temppanel2)
? ? ? ? f.contentPane.add(self.status)
? ? ? ? f.pack()
? ? ? ? f.show()
?
? ? ? ? return 1
?
# create one of these
a = FireValleyAutoRun()
?
# set the name, as a example of configuring it
a.setName("FireValleyAutoRun")
?
# set the time between settings
# a.delay = 3
?
# and show the initial panel
a.setup()


Locked Re: I/R detectors

 

We use a lot of cheap IR emitter/detectors on our club layouts and find that they can seem a little insensitive if merely mounted looking up between the sleepers through a hole. The problem seems to be reflection from the environment around the sensor even when the train is not above the sensor. With the cheaper sensors there is a light path from emitter to detector and if mounted up through a hole there can be reflection from the sides of the hole short cutting the IR path. When the sensor sensitivity is turned up you just see more of the emitter and so the detector saturates.

We got around this problem by putting a short black tube onto the emitter and detector so the only light the detector could see was off of the trains. We used short lengths of black heatshrink about 5mm diameter (5mm led and detector) and 8mm long and we could then turn up the sensitivity so the sensor only triggered when a train went over. You can also use rubber sleeving of about 5mm or whatever diameter your lens are. The detectors seem to detect any stock that runs over them so all materials and all colours.

Dave