|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.DefaultClockControl
jmri.jmrix.nce.NceClockControl
public class NceClockControl
NceClockControl.java Implementation of the Hardware Fast Clock for NCE
This module is based on the LocoNet version as worked over by David Duchamp based on original work by Bob Jacobsen and Alex Shepherd. It implements the sync logic to keep the Nce clock in sync with the internal clock or keeps the internal in sync to the Nce clock. The following of the Nce clock is better than the other way around due to the fine tuning available on the internal clock while the Nce clock doesn't.
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 |
CMD_CLOCK_SET_PARAM_SIZE
|
static int |
CMD_CLOCK_SET_REPLY_SIZE
|
static int |
CMD_CLOCK_SET_RUN_SIZE
|
static int |
CMD_CLOCK_SET_TIME_SIZE
|
static int |
CMD_MEM_SET_REPLY_SIZE
|
static int |
CS_CLOCK_1224
|
static int |
CS_CLOCK_AMPM
|
static int |
CS_CLOCK_HOURS
|
static int |
CS_CLOCK_MEM_ADDR
|
static int |
CS_CLOCK_MEM_SIZE
|
static int |
CS_CLOCK_MINUTES
|
static int |
CS_CLOCK_SCALE
|
static int |
CS_CLOCK_SECONDS
|
static int |
CS_CLOCK_STATUS
|
static int |
CS_CLOCK_TICK
|
static int |
MAX_ERROR_ARRAY
|
static int |
SYNCMODE_INTERNAL_MASTER
|
static int |
SYNCMODE_NCE_MASTER
|
static int |
SYNCMODE_OFF
|
static double |
TARGET_SYNC_DELAY
|
static int |
WAIT_CMD_EXECUTION
|
| Constructor Summary | |
|---|---|
NceClockControl(NceTrafficController tc,
String prefix)
Create a ClockControl object for a NCE clock |
|
| Method Summary | |
|---|---|
boolean |
canCorrectHardwareClock()
Nce clock runs stable enough |
boolean |
canSet12Or24HourClock()
Nce clock supports 12/24 operation |
void |
dispose()
stops any sync, removes listeners |
String |
getHardwareClockName()
name of Nce clock |
double |
getRate()
last known ratio from Nce clock |
Date |
getTime()
returns the current Nce time, does not have a date component |
void |
initiateRead()
not sure when or if this gets called, but will issue a read to get latest time |
void |
message(NceMessage m)
|
void |
newInternalMinute()
Handles minute notifications for NCE Clock Monitor/Synchronizer |
void |
reply(NceReply r)
|
boolean |
requiresIntegerRate()
Nce only supports integer rates |
void |
setRate(double newRate)
sets Nce clock speed, must be 1 to 15 |
void |
setTime(Date now)
set the time, the date part is ignored |
void |
startHardwareClock(Date now)
set Nce clock and start clock |
void |
stopHardwareClock()
stops the Nce Clock |
| Methods inherited from class jmri.implementation.DefaultClockControl |
|---|
getStatus, initializeHardwareClock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CS_CLOCK_MEM_ADDR
public static final int CS_CLOCK_MEM_SIZE
public static final int CS_CLOCK_SCALE
public static final int CS_CLOCK_TICK
public static final int CS_CLOCK_SECONDS
public static final int CS_CLOCK_MINUTES
public static final int CS_CLOCK_HOURS
public static final int CS_CLOCK_AMPM
public static final int CS_CLOCK_1224
public static final int CS_CLOCK_STATUS
public static final int CMD_CLOCK_SET_TIME_SIZE
public static final int CMD_CLOCK_SET_PARAM_SIZE
public static final int CMD_CLOCK_SET_RUN_SIZE
public static final int CMD_CLOCK_SET_REPLY_SIZE
public static final int CMD_MEM_SET_REPLY_SIZE
public static final int MAX_ERROR_ARRAY
public static final double TARGET_SYNC_DELAY
public static final int SYNCMODE_OFF
public static final int SYNCMODE_NCE_MASTER
public static final int SYNCMODE_INTERNAL_MASTER
public static final int WAIT_CMD_EXECUTION
| Constructor Detail |
|---|
public NceClockControl(NceTrafficController tc,
String prefix)
| Method Detail |
|---|
public void message(NceMessage m)
message in interface NceListenerpublic void reply(NceReply r)
reply in interface NceListenerpublic String getHardwareClockName()
getHardwareClockName in interface ClockControlgetHardwareClockName in class DefaultClockControlpublic boolean canCorrectHardwareClock()
canCorrectHardwareClock in interface ClockControlcanCorrectHardwareClock in class DefaultClockControlpublic boolean canSet12Or24HourClock()
canSet12Or24HourClock in interface ClockControlcanSet12Or24HourClock in class DefaultClockControlpublic void setRate(double newRate)
setRate in interface ClockControlsetRate in class DefaultClockControlpublic boolean requiresIntegerRate()
requiresIntegerRate in interface ClockControlrequiresIntegerRate in class DefaultClockControlpublic double getRate()
getRate in interface ClockControlgetRate in class DefaultClockControlpublic void setTime(Date now)
setTime in interface ClockControlsetTime in class DefaultClockControlpublic Date getTime()
getTime in interface ClockControlgetTime in class DefaultClockControlpublic void startHardwareClock(Date now)
startHardwareClock in interface ClockControlstartHardwareClock in class DefaultClockControlpublic void stopHardwareClock()
stopHardwareClock in interface ClockControlstopHardwareClock in class DefaultClockControlpublic void initiateRead()
public void dispose()
public void newInternalMinute()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||