hades.models.dcf77
Class Dcf77Sender

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.dcf77.Dcf77Sender
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable, Wakeable

public class Dcf77Sender
extends SimObject
implements Wakeable

A class that models a sender for the German standard normal-time code, as broadcast worldwide by the German DCF 77 sender at 77 KHz.

The code consists of a sequence of 59 bits broadcast every second, which code for the seconds, minutes, hours, day, month, year (and difference to GMT) of the next minute. A one is coded as a 200 msec. pause of a 1 sec. period in the 77 KHz signal, while a zero is coded as a 100 msec. pause. After transmitting 59 bits, no pause is broadcast for the 60th bit, to indicate that the data will become valid on the first bit (pause!) of the next minute.

This Java model is based on a VHDL model (C) 1996 by Andreas M?der, University of Hamburg, maeder@informatik.uni-hamburg.de

See Also:
Serialized Form

Nested Class Summary
(package private)  class Dcf77Sender.DateFormatter
           
(package private)  class Dcf77Sender.TimeFormatter
           
 
Field Summary
(package private)  Label datelabel
           
(package private)  PortStdLogic1164 port_dcf
           
(package private)  Signal signal_dcf
           
(package private)  SimKernel simulator
           
(package private)  Label timelabel
           
(package private)  StdLogic1164 value_0
           
(package private)  StdLogic1164 value_1
           
(package private)  StdLogic1164 value_X
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, symbol, versionId, visible
 
Constructor Summary
Dcf77Sender()
           
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void elaborate(java.lang.Object arg)
          elaborate(): unlike most other HADES models, the Dcf77Sender is elaborated even if it's output signal is (yet) null.
 void encodeTime()
           
 int getDay()
           
 int getHours()
           
 int getMinutes()
           
 int getMonth()
           
 double getNoise()
           
 int getSeconds()
           
 java.lang.String getToolTip(java.awt.Point position, long millis)
          construct a tool tip message (with the timing parameters)
 int getWeekday()
           
 int getYear()
           
 boolean hackToCheckWhetherDeleted()
          ugly utility method to decide whether this component has been deleted by the user (return true) or is still alive (return false).
 void incrementTime()
           
 boolean initialize(java.lang.String s)
          initialize the time to send from a String, which should contain the following data:
 void sendTime()
           
 void setDay(int i)
           
 void setDay(java.lang.String s)
           
 void setHours(int i)
           
 void setHours(java.lang.String s)
           
 void setMinutes(int i)
           
 void setMinutes(java.lang.String s)
           
 void setMonth(int i)
           
 void setMonth(java.lang.String s)
           
 void setNoise(double d)
           
 void setNoise(java.lang.String s)
           
 void setSeconds(int i)
           
 void setSeconds(java.lang.String s)
           
 void setWeekday(int i)
           
 void setWeekday(java.lang.String s)
           
 void setYear(int i)
           
 void setYear(java.lang.String s)
           
 java.lang.String toString()
          generate a textual represenation including class name, full Hades instance name, and the current DCF77 model time.
 void wakeup(java.lang.Object arg)
          one second has elapsed.
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, setVersionId, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hades.simulator.Simulatable
evaluate, message
 

Field Detail

value_X

StdLogic1164 value_X

value_0

StdLogic1164 value_0

value_1

StdLogic1164 value_1

port_dcf

PortStdLogic1164 port_dcf

signal_dcf

Signal signal_dcf

simulator

SimKernel simulator

timelabel

Label timelabel

datelabel

Label datelabel
Constructor Detail

Dcf77Sender

public Dcf77Sender()
Method Detail

initialize

public boolean initialize(java.lang.String s)
initialize the time to send from a String, which should contain the following data:
     versionId hours mins seconds day month year weekday noise
 

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
Overrides:
write in class SimObject

getSeconds

public int getSeconds()

getMinutes

public int getMinutes()

getHours

public int getHours()

getDay

public int getDay()

getWeekday

public int getWeekday()

getMonth

public int getMonth()

getYear

public int getYear()

setSeconds

public void setSeconds(int i)

setMinutes

public void setMinutes(int i)

setHours

public void setHours(int i)

setDay

public void setDay(int i)

setWeekday

public void setWeekday(int i)

setMonth

public void setMonth(int i)

setYear

public void setYear(int i)

setSeconds

public void setSeconds(java.lang.String s)

setMinutes

public void setMinutes(java.lang.String s)

setHours

public void setHours(java.lang.String s)

setDay

public void setDay(java.lang.String s)

setWeekday

public void setWeekday(java.lang.String s)

setMonth

public void setMonth(java.lang.String s)

setYear

public void setYear(java.lang.String s)

getNoise

public double getNoise()

setNoise

public void setNoise(double d)

setNoise

public void setNoise(java.lang.String s)

configure

public void configure()
Description copied from class: SimObject
create and display a 'ConfigDialog' to set the parameters for a SimObject. The default ConfigDialog for the base class (SimObject) itself is empty except for the 'instance name' of the SimObject.

Overrides:
configure in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
elaborate(): unlike most other HADES models, the Dcf77Sender is elaborated even if it's output signal is (yet) null.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class SimObject

wakeup

public void wakeup(java.lang.Object arg)
one second has elapsed. Send the next bit and update the display.

Specified by:
wakeup in interface Wakeable
Parameters:
arg - - unused argument

hackToCheckWhetherDeleted

public boolean hackToCheckWhetherDeleted()
ugly utility method to decide whether this component has been deleted by the user (return true) or is still alive (return false).

FIXME: bad hack due to major Hades software design flaw: the current implementation of wakeup() does not pass through the WakeupEvent source; therefore, there is no way to get deleteAllEventsFromSource working. This in turn means that we have no "official" way to check whether this Dcf77Sender has been deleted from its parent Design and should stop sending events and waking itself again...


encodeTime

public void encodeTime()

sendTime

public void sendTime()

incrementTime

public void incrementTime()

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
construct a tool tip message (with the timing parameters)

Specified by:
getToolTip in interface ContextToolTip
Overrides:
getToolTip in class SimObject

toString

public java.lang.String toString()
generate a textual represenation including class name, full Hades instance name, and the current DCF77 model time.

Overrides:
toString in class SimObject