开云体育

Re: Script output delayed #scripting


 

Sorry, my mistake. ?It show be newValue, not newState.

??????? if event.getNewValue() == ACTIVE:

Dave Sand


----- Original message -----
From: "Canadian Locomotive Logistics via groups.io" <CanadianLocomotiveLogistics=[email protected]>
Subject: Re: [jmriusers] Script output delayed #scripting
Date: Sunday, March 30, 2025 2:00 AM

I had issue with trying to use the activate..
Some how it actually stop the sensor to go active.
?
?
#######################################################################################################################
#
# Listen for changes to an occupancy sensor. ?When a change occurs, create and run the signal logic.
#
# Use INACTIVE for the sensor becoming inactive. Later
#
#
class SensorListener(java.beans.PropertyChangeListener):
? ? def propertyChange(self, event):
? ? ? ? if event.getNewState() == ACTIVE:
? ? ? ? ? ? SignalLogic().start()

#######################################################################################################################
#?
# I remored the follwo code and replaced it with the above, to better control the activation cose from the sensor.
#
# class SensorListener(java.beans.PropertyChangeListener):
#? ? ?def propertyChange(self, event):
#? ? ? ? ? ?SignalLogic().start()
#######################################################################################################################
#
# Get a sensor
#

Join [email protected] to automatically receive all group messages.