|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.DefaultClockControl
jmri.jmrix.loconet.LnClockControl
public class LnClockControl
LnClockControl.java Implementation of the Hardware Fast Clock for Loconet
This module is based on a GUI module developed by Bob Jacobsen and Alex Shepherd to correct the Loconet fast clock rate and synchronize it with the internal JMRI fast clock Timebase. The methods that actually send, correct, or receive information from the Loconet hardware are repackaged versions of their code.
The Loconet Fast Clock is controlled by the user via the Fast Clock Setup GUI that is accessed from the JMRI Tools menu.
For this implementation, "synchronize" implies "correct", since the two clocks run at a different rate.
Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.
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.
| Constructor Summary | |
|---|---|
LnClockControl(SlotManager sm,
LnTrafficController tc)
Create a ClockControl object for a Loconet clock |
|
| Method Summary | |
|---|---|
boolean |
canCorrectHardwareClock()
Returns true if hardware clock accuracy can be corrected using the computer clock. |
void |
dispose()
|
String |
getHardwareClockName()
Accessor routines |
double |
getRate()
|
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. |
void |
initiateRead()
Requests read of the Loconet fast clock |
void |
newMinute()
Corrects the Loconet Fast Clock |
void |
notifyChangedSlot(LocoNetSlot s)
Handle changed slot contents, due to clock changes. |
boolean |
requiresIntegerRate()
Returns true if hardware clock requires an integer rate Note: Default implementation returns false. |
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. |
void |
setTime(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; |
void |
startHardwareClock(Date now)
Start and stop hardware fast clock Many hardware fast clocks continue to run indefinitely. |
void |
stopHardwareClock()
|
| Methods inherited from class jmri.implementation.DefaultClockControl |
|---|
canSet12Or24HourClock, getStatus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LnClockControl(SlotManager sm,
LnTrafficController tc)
| Method Detail |
|---|
public String getHardwareClockName()
getHardwareClockName in interface ClockControlgetHardwareClockName in class DefaultClockControlpublic boolean canCorrectHardwareClock()
DefaultClockControl
canCorrectHardwareClock in interface ClockControlcanCorrectHardwareClock in class DefaultClockControlpublic void setRate(double newRate)
DefaultClockControl
setRate in interface ClockControlsetRate in class DefaultClockControlpublic boolean requiresIntegerRate()
DefaultClockControl
requiresIntegerRate in interface ClockControlrequiresIntegerRate in class DefaultClockControlpublic double getRate()
getRate in interface ClockControlgetRate in class DefaultClockControlpublic void setTime(Date now)
DefaultClockControl
setTime in interface ClockControlsetTime in class DefaultClockControlpublic Date getTime()
getTime in interface ClockControlgetTime in class DefaultClockControlpublic void startHardwareClock(Date now)
DefaultClockControl
startHardwareClock in interface ClockControlstartHardwareClock in class DefaultClockControlpublic void stopHardwareClock()
stopHardwareClock in interface ClockControlstopHardwareClock in class DefaultClockControl
public void initializeHardwareClock(double rate,
Date now,
boolean getTime)
DefaultClockControl
initializeHardwareClock in interface ClockControlinitializeHardwareClock in class DefaultClockControlpublic void initiateRead()
public void newMinute()
public void notifyChangedSlot(LocoNetSlot s)
notifyChangedSlot in interface SlotListeners - public void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||