Package jmri.jmrix.srcp
Class SRCPClockControl
java.lang.Object
jmri.implementation.DefaultClockControl
jmri.jmrix.srcp.SRCPClockControl
- All Implemented Interfaces:
ClockControl
Class providing SRCP Clock Control to the SRCP client.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) SRCPBusConnectionMemo(package private) SRCPTrafficController -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet name of hardware clockdoublegetRate()Default implementation returns the rate of the internal clock.getTime()Default implementation returns InstanceM default jmri.Timebase getTime().voidinitializeHardwareClock(double rate, 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.voidSet 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(Date now) Start and stop hardware fast clock Many hardware fast clocks continue to run indefinitely.voidDefault implementation is to ignore.Methods inherited from class jmri.implementation.DefaultClockControl
canCorrectHardwareClock, canSet12Or24HourClock, getStatus, requiresIntegerRate
-
Field Details
-
_memo
-
_tc
-
-
Constructor Details
-
SRCPClockControl
-
-
Method Details
-
getHardwareClockName
Get name of hardware clock- Specified by:
getHardwareClockNamein interfaceClockControl- Overrides:
getHardwareClockNamein classDefaultClockControl- Returns:
- the name
-
setRate
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
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
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
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
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
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
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
-