Package jmri.jmrix.mrc
Class MrcClockControl
java.lang.Object
jmri.implementation.DefaultClockControl
jmri.jmrix.mrc.MrcClockControl
- All Implemented Interfaces:
ClockControl,MrcTrafficListener
Implementation of the Hardware Fast Clock for Mrc
This file is part of JMRI.
This module is based on the NCE version.
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
FieldsModifier and TypeFieldDescription(package private) Timerstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int(package private) DecimalFormat(package private) DecimalFormat(package private) Timebasestatic final int(package private) PropertyChangeListenerstatic final intstatic final intstatic final intstatic final double(package private) DecimalFormat(package private) DecimalFormatstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionMrcClockControl(MrcTrafficController tc, String prefix) Create a ClockControl object for a Mrc clock -
Method Summary
Modifier and TypeMethodDescriptionbooleanMrc clock runs stable enoughbooleanMrc clock supports 12/24 operationvoiddispose()stops any sync, removes listenersname of Mrc clockdoublegetRate()last known ratio from Mrc clockgetTime()returns the current Mrc time, does not have a date componentvoidinitializeHardwareClock(double rate, Date now, boolean getTime) Default implementation is to ignore this request.voidvoidHandles minute notifications for MRC Clock Monitor/SynchronizervoidnotifyFailedXmit(Date timestamp, MrcMessage m) voidnotifyRcv(Date timestamp, MrcMessage m) voidnotifyXmit(Date timestamp, MrcMessage m) booleanMrc only supports integer ratesvoidsetRate(double newRate) sets Mrc clock speed, must be 1 to 60voidset the time, the date part is ignoredvoidstartHardwareClock(Date now) set Mrc clock and start clockMethods inherited from class jmri.implementation.DefaultClockControl
getStatus, stopHardwareClock
-
Field Details
-
CS_CLOCK_SCALE
- See Also:
-
CS_CLOCK_MINUTES
- See Also:
-
CS_CLOCK_HOURS
- See Also:
-
CS_CLOCK_AMPM
- See Also:
-
CS_CLOCK_1224
- See Also:
-
CS_CLOCK_STATUS
- See Also:
-
CMD_CLOCK_SET_TIME_SIZE
- See Also:
-
CMD_CLOCK_SET_PARAM_SIZE
- See Also:
-
CMD_CLOCK_SET_RUN_SIZE
- See Also:
-
CMD_CLOCK_SET_REPLY_SIZE
- See Also:
-
CMD_MEM_SET_REPLY_SIZE
- See Also:
-
MAX_ERROR_ARRAY
- See Also:
-
TARGET_SYNC_DELAY
- See Also:
-
SYNCMODE_OFF
- See Also:
-
SYNCMODE_MRC_MASTER
- See Also:
-
SYNCMODE_INTERNAL_MASTER
- See Also:
-
WAIT_CMD_EXECUTION
- See Also:
-
fiveDigits
-
fourDigits
-
threeDigits
-
twoDigits
-
internalClock
-
alarmSyncUpdate
-
minuteChangeListener
-
-
Constructor Details
-
MrcClockControl
Create a ClockControl object for a Mrc clock- Parameters:
tc- traffic control for connectionprefix- system prefix for connection
-
-
Method Details
-
message
-
notifyXmit
- Specified by:
notifyXmitin interfaceMrcTrafficListener
-
notifyFailedXmit
- Specified by:
notifyFailedXmitin interfaceMrcTrafficListener
-
notifyRcv
- Specified by:
notifyRcvin interfaceMrcTrafficListener
-
getHardwareClockName
name of Mrc clock- Specified by:
getHardwareClockNamein interfaceClockControl- Overrides:
getHardwareClockNamein classDefaultClockControl- Returns:
- the name
-
canCorrectHardwareClock
Mrc clock runs stable enough- Specified by:
canCorrectHardwareClockin interfaceClockControl- Overrides:
canCorrectHardwareClockin classDefaultClockControl- Returns:
- true if correctable; false otherwise
-
canSet12Or24HourClock
Mrc clock supports 12/24 operation- Specified by:
canSet12Or24HourClockin interfaceClockControl- Overrides:
canSet12Or24HourClockin classDefaultClockControl- Returns:
- true if settable; false otherwise
-
setRate
sets Mrc clock speed, must be 1 to 60- Specified by:
setRatein interfaceClockControl- Overrides:
setRatein classDefaultClockControl- Parameters:
newRate- the new rate
-
requiresIntegerRate
Mrc only supports integer rates- Specified by:
requiresIntegerRatein interfaceClockControl- Overrides:
requiresIntegerRatein classDefaultClockControl- Returns:
- true if integer rates only; false otherwise
-
getRate
last known ratio from Mrc clock- Specified by:
getRatein interfaceClockControl- Overrides:
getRatein classDefaultClockControl- Returns:
- Fast Clock rate.
-
setTime
set the time, the date part is ignored- Specified by:
setTimein interfaceClockControl- Overrides:
setTimein classDefaultClockControl- Parameters:
now- the new time
-
getTime
returns the current Mrc time, does not have a date component- Specified by:
getTimein interfaceClockControl- Overrides:
getTimein classDefaultClockControl- Returns:
- current time.
-
startHardwareClock
set Mrc clock and start clock- Specified by:
startHardwareClockin interfaceClockControl- Overrides:
startHardwareClockin classDefaultClockControl- Parameters:
now- the starting 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
-
dispose
stops any sync, removes listeners -
newInternalMinute
Handles minute notifications for MRC Clock Monitor/Synchronizer
-