Package jmri.jmrix.loconet
Class LnMeterInitTask
- java.lang.Object
-
- jmri.jmrix.loconet.LnMeterInitTask
-
public class LnMeterInitTask extends java.lang.Object
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 Modifier and Type Field Description (package private) boolean
_enabled
-
Constructor Summary
Constructors Constructor Description LnMeterInitTask(LnTrafficController tc, int interval)
Create a task to perform an initial query of LocoNet for devices which provide data for JMRI Meters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
disable()
Cancel the task (if it is not already canceled)void
dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.protected void
enable()
Enable the task to beginvoid
initTimer()
Initializes timer for send of meters query.
-
-
-
Field Detail
-
_enabled
boolean _enabled
-
-
Constructor Detail
-
LnMeterInitTask
public LnMeterInitTask(LnTrafficController tc, int interval)
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 Detail
-
enable
protected void enable()
Enable the task to begin
-
disable
protected void disable()
Cancel the task (if it is not already canceled)
-
initTimer
public void 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
public void dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.
-
-