|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClockControl
ClockControl defines an interface for control of hardware Fast Clocks
Each hardware system that has a hardware Fast Clock implementation must supply a module that implements this interface. Each ClockControl module must register itself with the Instance Manager at start up.
Parameters for fast clocks are set up generically in the Fast Clock Setup, accessed via the JMRI Tools menu. These parameters are saved in the configuration file generically, so no special configxml module is needed for storing parameters.
Hardware ClockControl modules should extend DefaultClockControl, which supplies default implementations of methods required by this interface that specific hardware implementations may not need.
All Clock Control modules communicate with the internal clock and the master JMRI Timebase, using methods of the Timebase interface.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
| Method Summary | |
|---|---|
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. |
String |
getHardwareClockName()
Get name of hardware clock Note: If there is no hardware clock, DefaultClockControl returns null, so all hardware clocks must override this method. |
double |
getRate()
|
int |
getStatus()
Get status of the fast clock |
Date |
getTime()
|
void |
initializeHardwareClock(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. |
boolean |
requiresIntegerRate()
Returns true if hardware clock requires an integer rate |
void |
setRate(double newRate)
Get and set the rate of the fast clock Note: 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. |
void |
setTime(Date now)
Set and get the fast clock time |
void |
startHardwareClock(Date now)
Start and stop hardware fast clock Some hardware fast clocks continue to run indefinitely. |
void |
stopHardwareClock()
|
| Method Detail |
|---|
int getStatus()
String getHardwareClockName()
boolean canCorrectHardwareClock()
boolean canSet12Or24HourClock()
boolean requiresIntegerRate()
void setRate(double newRate)
double getRate()
void setTime(Date now)
Date getTime()
void startHardwareClock(Date now)
void stopHardwareClock()
void initializeHardwareClock(double rate,
Date now,
boolean getTime)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||