Package jmri.jmrix.srcp
Class SRCPClockControl
- java.lang.Object
-
- jmri.implementation.DefaultClockControl
-
- jmri.jmrix.srcp.SRCPClockControl
-
- All Implemented Interfaces:
ClockControl
public class SRCPClockControl extends DefaultClockControl
Class providing SRCP Clock Control to the SRCP client.- See Also:
- SRCP TIME documentation
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SRCPBusConnectionMemo_memo(package private) SRCPTrafficController_tc
-
Constructor Summary
Constructors Constructor Description SRCPClockControl(SRCPBusConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHardwareClockName()Get name of hardware clockdoublegetRate()Default implementation returns the rate of the internal clock.java.util.DategetTime()Default implementation returns InstanceM default jmri.Timebase getTime().voidinitializeHardwareClock(double rate, java.util.Date now, boolean getTime)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.voidsetRate(double newRate)Get and set the rate of the fast clock Note: The rate is an integer that multiplies the wall clock For example, a rate of 4 specifies that the fast clock runs 4 times faster than the wall clock.voidsetTime(java.util.Date now)Set and get the fast clock time For the default implementation,set time is ignored and getTime returns the time of the internal clock; Date format sent as yyyyDDD HH mm ss , YearJulDay Hour Minute SecondsvoidstartHardwareClock(java.util.Date now)Start and stop hardware fast clock Many hardware fast clocks continue to run indefinitely.voidstopHardwareClock()Default implementation is to ignore.-
Methods inherited from class jmri.implementation.DefaultClockControl
canCorrectHardwareClock, canSet12Or24HourClock, getStatus, requiresIntegerRate
-
-
-
-
Field Detail
-
_memo
SRCPBusConnectionMemo _memo
-
-
Constructor Detail
-
SRCPClockControl
public SRCPClockControl(SRCPBusConnectionMemo memo)
-
-
Method Detail
-
getHardwareClockName
public java.lang.String getHardwareClockName()
Get name of hardware clock- Specified by:
getHardwareClockNamein interfaceClockControl- Overrides:
getHardwareClockNamein classDefaultClockControl- Returns:
- the name
-
setRate
public void setRate(double newRate)
Get and set the rate of the fast clock Note: The rate is an integer that multiplies the wall clock For example, a rate of 4 specifies that the fast clock runs 4 times faster than the wall clock. For the default implementation, setRate is ignored, and getRate returns the rate of the internal clock;- Specified by:
setRatein interfaceClockControl- Overrides:
setRatein classDefaultClockControl- Parameters:
newRate- the new rate
-
getRate
public double getRate()
Description copied from class:DefaultClockControlDefault 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:
getRatein interfaceClockControl- Overrides:
getRatein classDefaultClockControl- Returns:
- Fast Clock rate.
-
setTime
public void setTime(java.util.Date now)
Set and get the fast clock time For the default implementation,set time is ignored and getTime returns the time of the internal clock; Date format sent as yyyyDDD HH mm ss , YearJulDay Hour Minute Seconds- Specified by:
setTimein interfaceClockControl- Overrides:
setTimein classDefaultClockControl- Parameters:
now- the new time
-
getTime
public java.util.Date getTime()
Description copied from class:DefaultClockControlDefault implementation returns InstanceM default jmri.Timebase getTime(). ie. the time of the internal clock. Get the fast clock time.- Specified by:
getTimein interfaceClockControl- Overrides:
getTimein classDefaultClockControl- Returns:
- current time.
-
startHardwareClock
public void startHardwareClock(java.util.Date now)
Start and stop hardware fast clock Many hardware fast clocks continue to run indefinitely. This is provided for the case where the hardware clock can be stopped and started.- Specified by:
startHardwareClockin interfaceClockControl- Overrides:
startHardwareClockin classDefaultClockControl- Parameters:
now- the starting time
-
stopHardwareClock
public void stopHardwareClock()
Description copied from class:DefaultClockControlDefault implementation is to ignore. Stop hardware fast clock. This is provided for the case where the hardware clock can be stopped and started.- Specified by:
stopHardwareClockin interfaceClockControl- Overrides:
stopHardwareClockin classDefaultClockControl
-
initializeHardwareClock
public void initializeHardwareClock(double rate, java.util.Date now, boolean getTime)
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. Default implementation is to ignore this request.- Specified by:
initializeHardwareClockin interfaceClockControl- Overrides:
initializeHardwareClockin classDefaultClockControl- Parameters:
rate- the ratenow- the timegetTime- true if hardware clock should be used; false otherwise
-
-