Vinny,
You are not checking to see if the throttle is valid.
if self.throttle is not None:
? ? self.throttle.setIsForward(True)
else:
? ? print 'Unable to get throttle for {}'.format(TrainsBreakInLocoIDNum)
? ? # do whatever to handle the error
Dave Sand
toggle quoted message
Show quoted text
----- Original message -----
Subject: [jmriusers] Jython script Error - obj has no attribute 'setIsForward'
Date: Friday, April 11, 2025 2:05 PM
Team, attached snip of script where the error is occurring. Funny thing is that it works fine 90% of the time.
--
Many thanks in advance!
Vinny DeRobertis ~ Apex, NC
New York & Hudson Valley RR
Windows 7 Pro / Java 11 / JMRI v5.10
Command Station: Digikeijs DR5000.
Booster: Digikeijs DR5033
(4) Samsung A7 10.4" Tablets
Fully Kiosk/Engine Driver v2.37.187
DCC/DMX Gateway: Pricom LLS.
LocoNet Input Modules: Digikeijs DR4088LN
DCC Output Modules:
Digikeijs DR4018 / Yamorc YD8116.
Sensors: Model Train Technology: DETECTOR-HO.
Turnout Motors: MTB MP1
Attachments: