Class DCCppClockControl

  • All Implemented Interfaces:
    java.util.EventListener, ClockControl, AbstractMRListener, DCCppListener

    public class DCCppClockControl
    extends DefaultClockControl
    implements DCCppListener
    Class providing Clock Control to the DCC-EX client. Does nothing unless "Synchronize Internal Fast Clock and DCC-EX Fast Clock" is enabled. If "Time Source" is "Internal Computer Clock", send any changes to Fast Clock Rate or Time to the command station. If "Time Source" is "DCC-EX Fast Clock", listen for incoming Time messages and set the Fast Clock from these. Ignores incoming Rate messages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHardwareClockName()
      Get name of hardware clock, shown in UI
      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.
      void message​(DCCppMessage msg)
      Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout.
      void message​(DCCppReply msg)
      Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.
      void notifyTimeout​(DCCppMessage msg)
      Member function invoked by an DCCppInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.
      boolean requiresIntegerRate()
      Prevent user entry of a fractional rate, since DCC-EX only supports integer rates
      void setRate()  
      void setRate​(double newRate)
      Send the new fastclock rate to CS if internal is master AND synchronize enabled send rate of zero if clock is not running Note: fastclock rate and time are in a single message
      void setTime()  
      void setTime​(java.util.Date newTimestamp)
      Send the new fast clock time to CS if internal is master AND synchronize enabled Note: fastclock rate and time are in a single message
      void startHardwareClock​(java.util.Date now)
      Pause, unpause and initialize fast clock
      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