Class OlcbClockControl
- All Implemented Interfaces:
ClockControl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if hardware clock accuracy can be corrected using the computer clock.booleanReturns true if hardware clock can be set to 12 or 24 hour display from JMRI software.voiddispose()Get name of hardware clock.doublegetRate()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) Default implementation is to ignore this request.booleanDefault implementation returns false.voidsetRate(double newRate) For the default implementation, setRate is ignored.voidFor the default implementation, set time is ignored.voidstartHardwareClock(Date now) Default implementation is to call SetTime to now.voidDefault implementation is to ignore.Methods inherited from class jmri.implementation.DefaultClockControl
getStatus
-
Constructor Details
-
OlcbClockControl
-
-
Method Details
-
dispose
-
getHardwareClockName
Description copied from class:DefaultClockControlGet name of hardware clock.If there is no hardware clock, this method returns null. Get name of hardware clock Note: If there is no hardware clock, DefaultClockControl returns null, so all hardware clocks must override this method.
- Specified by:
getHardwareClockNamein interfaceClockControl- Overrides:
getHardwareClockNamein classDefaultClockControl- Returns:
- the name
-
canCorrectHardwareClock
Description copied from class:DefaultClockControlReturns true if hardware clock accuracy can be corrected using the computer clock.Hardware implementations should override this and return true if they can correct their hardware clock. Returns true if hardware clock accuracy can be corrected using the computer clock.
- Specified by:
canCorrectHardwareClockin interfaceClockControl- Overrides:
canCorrectHardwareClockin classDefaultClockControl- Returns:
- true if correctable; false otherwise
-
canSet12Or24HourClock
Description copied from class:DefaultClockControlReturns true if hardware clock can be set to 12 or 24 hour display from JMRI software.Default implementation is to return false. Returns 'true' if hardware clock can be set to 12 or 24 hour display from JMRI software.
- Specified by:
canSet12Or24HourClockin interfaceClockControl- Overrides:
canSet12Or24HourClockin classDefaultClockControl- Returns:
- true if settable; false otherwise
-
requiresIntegerRate
Description copied from class:DefaultClockControlDefault implementation returns false.If an integer rate is required by the hardware, this method should be overridden. Returns true if hardware clock requires an integer rate.
- Specified by:
requiresIntegerRatein interfaceClockControl- Overrides:
requiresIntegerRatein classDefaultClockControl- Returns:
- true if integer rates only; false otherwise
-
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.
-
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.
-
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
-
startHardwareClock
Description copied from class:DefaultClockControlDefault implementation is to call SetTime to now. Start hardware fast clock Some 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
-
setRate
Description copied from class:DefaultClockControlFor 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:
setRatein interfaceClockControl- Overrides:
setRatein classDefaultClockControl- Parameters:
newRate- the new rate
-
setTime
Description copied from class:DefaultClockControlFor the default implementation, set time is ignored. Set the fast clock time.- Specified by:
setTimein interfaceClockControl- Overrides:
setTimein classDefaultClockControl- Parameters:
now- the new time
-
initializeHardwareClock
Description copied from class:DefaultClockControlDefault 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:
initializeHardwareClockin interfaceClockControl- Overrides:
initializeHardwareClockin classDefaultClockControl- Parameters:
rate- the ratenow- the timegetTime- true if hardware clock should be used; false otherwise
-