开云体育

Jython script Error - obj has no attribute 'setIsForward'


 

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


 

...just realized that after this error, now I cannot control Turnouts from the CPE. this happened last night for the first time ever. I rebooted TWICE and got things working again and now it has happened again. Nothing else in the system console other than the setisforward error.


 

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


----- Original message -----
From: "Vinny DeRobertis via groups.io" <vinny.derobertis=[email protected]>
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:
  • 20250411_145955.jpg


 

Thanks for the speedy response Dave. Ok I'll add that but the throttle ID in the IM was 1111. Why is that invalid? It's not part of my roster but im using it or testing.