Class OlcbClockControl

    • Constructor Summary

      Constructors 
      Constructor Description
      OlcbClockControl​(org.openlcb.OlcbInterface iface, org.openlcb.NodeID clockID, boolean isMaster)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canCorrectHardwareClock()
      Returns true if hardware clock accuracy can be corrected using the computer clock.
      boolean canSet12Or24HourClock()
      Returns true if hardware clock can be set to 12 or 24 hour display from JMRI software.
      void dispose()  
      java.lang.String getHardwareClockName()
      Get name of hardware clock.
      double getRate()
      Default implementation returns the rate of the internal clock.
      java.util.Date getTime()
      Default implementation returns InstanceM default jmri.Timebase getTime().
      void initializeHardwareClock​(double rate, java.util.Date now, boolean getTime)
      Default implementation is to ignore this request.
      boolean requiresIntegerRate()
      Default implementation returns false.
      void setRate​(double newRate)
      For the default implementation, setRate is ignored.
      void setTime​(java.util.Date now)
      For the default implementation, set time is ignored.
      void startHardwareClock​(java.util.Date now)
      Default implementation is to call SetTime to now.
      void stopHardwareClock()
      Default implementation is to ignore.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OlcbClockControl

        public OlcbClockControl​(org.openlcb.OlcbInterface iface,
                                org.openlcb.NodeID clockID,
                                boolean isMaster)
    • Method Detail

      • getRate

        public double getRate()
        Description copied from class: DefaultClockControl
        Default implementation returns the rate of the internal clock. Get the rate of the Fast Clock.

        The rate is a number that multiplies the wall clock. For example, a rate of 4 specifies that the fast clock runs 4 times faster than the wall clock.

        Specified by:
        getRate in interface ClockControl
        Overrides:
        getRate in class DefaultClockControl
        Returns:
        Fast Clock rate.
      • setRate

        public void setRate​(double newRate)
        Description copied from class: DefaultClockControl
        For the default implementation, setRate is ignored. Set the rate of the Fast Clock.

        The rate is a number that multiplies the wall clock time For example, a rate of 4 specifies that the fast clock runs 4 times faster than the wall clock.

        Specified by:
        setRate in interface ClockControl
        Overrides:
        setRate in class DefaultClockControl
        Parameters:
        newRate - the new rate
      • initializeHardwareClock

        public void initializeHardwareClock​(double rate,
                                            java.util.Date now,
                                            boolean getTime)
        Description copied from class: DefaultClockControl
        Default implementation is to ignore this request. Initialize the hardware fast clock Note: When the hardware clock control receives this, it should initialize those clock settings that are available on the hardware clock. This method is used when the fast clock is started, and when time source, synchronize, or correct options are changed. If rate is 0.0, the hardware clock should be initialized "stopped", and the current rate saved for when the clock is restarted. If getTime is "true" the time from the hardware clock should be used in place of the supplied time if possible.
        Specified by:
        initializeHardwareClock in interface ClockControl
        Overrides:
        initializeHardwareClock in class DefaultClockControl
        Parameters:
        rate - the rate
        now - the time
        getTime - true if hardware clock should be used; false otherwise