Package jmri.jmrix.loconet
Class LnMeterInitTask
java.lang.Object
jmri.jmrix.loconet.LnMeterInitTask
Provides for LocoNet "Meters" discovery query at connection start-up.
This class specifically deals with issues sometimes seen
at JMRI LocoNet connection start-up.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLnMeterInitTask(LnTrafficController tc, int interval) Create a task to perform an initial query of LocoNet for devices which provide data for JMRI Meters. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddisable()Cancel the task (if it is not already canceled)voiddispose()Remove references to and from this object, so that it can eventually be garbage-collected.protected voidenable()Enable the task to beginvoidInitializes timer for send of meters query.
-
Field Details
-
_enabled
boolean _enabled
-
-
Constructor Details
-
LnMeterInitTask
Create a task to perform an initial query of LocoNet for devices which provide data for JMRI Meters.- Parameters:
tc- Traffic Controller used when sending queryinterval- - delay between checks of connection's readiness
-
-
Method Details
-
enable
Enable the task to begin -
disable
Cancel the task (if it is not already canceled) -
initTimer
Initializes timer for send of meters query. Cancels any existing task. Checks delay and exits if delay is negative. Establishes a new task only if delay is greater than 0. -
dispose
Remove references to and from this object, so that it can eventually be garbage-collected.
-