|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Timebase
Provide access to clock capabilities in hardware or software.
The Rate parameter determines how much faster than real time this timebase runs. E.g. a value of 2.0 means that the value returned by getTime will advance an hour for every half-hour of wall-clock time elapsed.
The Rate and Run parameters are bound, so you can listen for them
changing. The Time parameters is not bound, because it changes
continuously. Ask for its value when needed, or add a
a listener for the changes in the "minute" value using addMinuteChangeListener(java.beans.PropertyChangeListener)
This file is part of JMRI.
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.
| Field Summary | |
|---|---|
static int |
ANALOG_CLOCK
|
static int |
LCD_CLOCK
|
static int |
NIXIE_CLOCK
|
static int |
NONE
|
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| Method Summary | |
|---|---|
void |
addMinuteChangeListener(PropertyChangeListener l)
Request a call-back when the minutes place of the time changes. |
void |
addPropertyChangeListener(PropertyChangeListener l)
Request a call-back when the bound Rate or Run property changes. |
void |
dispose()
Remove references to and from this object, so that it can eventually be garbage-collected. |
boolean |
getCorrectHardware()
|
boolean |
getInternalMaster()
|
boolean |
getIsInitialized()
|
String |
getMasterName()
|
double |
getRate()
Caution: This method may return a fiddled clock rate if certain hardware clocks are the Time Source. |
boolean |
getRun()
|
int |
getStartClockOption()
|
boolean |
getStartSetTime()
|
boolean |
getStartStopped()
|
Date |
getStartTime()
|
boolean |
getSynchronize()
|
Date |
getTime()
|
void |
initializeClock()
|
void |
initializeHardwareClock()
Initialize hardware clock at start up after all options are set up. |
void |
removeMinuteChangeListener(PropertyChangeListener l)
Remove a request for call-back when the minutes place of the time changes. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a request for a call-back when a bound property changes. |
void |
set12HourDisplay(boolean display,
boolean update)
Set 12 or 24 hour display option |
void |
setCorrectHardware(boolean correct,
boolean update)
|
void |
setInternalMaster(boolean master,
boolean update)
|
void |
setMasterName(String name)
|
void |
setRate(double factor)
Set fast clock rate factor |
void |
setRun(boolean y)
|
void |
setStartClockOption(int option)
|
void |
setStartSetTime(boolean set,
Date time)
|
void |
setStartStopped(boolean stopped)
|
void |
setSynchronize(boolean synchronize,
boolean update)
|
void |
setTime(Date d)
Set the current time |
boolean |
use12HourDisplay()
|
double |
userGetRate()
This method is used by Setup Fast Clock when an external change in fast clock rate occurs because of the peculiar way some hardware clocks attempt to synchronize with the JMRI fast clock. |
void |
userSetRate(double factor)
Used when the user changes fast clock rate in Setup Fast Clock and by hardware ClockControl implementations that fiddle with the fast clock rate to synchronize |
void |
userSetTime(Date d)
Special method for when the user changes fast clock time in Setup Fast Clock. |
| Methods inherited from interface jmri.NamedBean |
|---|
addPropertyChangeListener, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getState, getSystemName, getUserName, setComment, setProperty, setState, setUserName, updateListenerRef |
| Field Detail |
|---|
static final int NONE
static final int NIXIE_CLOCK
static final int ANALOG_CLOCK
static final int LCD_CLOCK
| Method Detail |
|---|
void setTime(Date d)
void userSetTime(Date d)
Date getTime()
void setRun(boolean y)
boolean getRun()
void setRate(double factor)
throws TimebaseRateException
TimebaseRateException - if the implementation can't do the requested rate
void userSetRate(double factor)
throws TimebaseRateException
TimebaseRateExceptiondouble getRate()
double userGetRate()
void setInternalMaster(boolean master,
boolean update)
boolean getInternalMaster()
void setMasterName(String name)
String getMasterName()
void setSynchronize(boolean synchronize,
boolean update)
boolean getSynchronize()
void setCorrectHardware(boolean correct,
boolean update)
boolean getCorrectHardware()
void set12HourDisplay(boolean display,
boolean update)
display - true if a 12-hour display is requested, false for 24-hour displayboolean use12HourDisplay()
void setStartStopped(boolean stopped)
boolean getStartStopped()
void setStartSetTime(boolean set,
Date time)
boolean getStartSetTime()
Date getStartTime()
void setStartClockOption(int option)
int getStartClockOption()
void initializeClock()
void initializeHardwareClock()
Note: This method is always called at start up. It should be ignored if there is no communication with a hardware clock
boolean getIsInitialized()
void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in interface NamedBeanvoid removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in interface NamedBeanvoid addMinuteChangeListener(PropertyChangeListener l)
void removeMinuteChangeListener(PropertyChangeListener l)
void dispose()
dispose in interface NamedBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||