Class 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 begin
      void initTimer()
      Initializes timer for send of meters query.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 query
        interval - - 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.