hades.models.io
Class PowerOnReset

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

public class PowerOnReset
extends SimObject
implements Assignable, Wakeable, Simulatable, java.io.Serializable

PowerOnReset - (active low) power on reset generator. Default is a 10msec zero impulse.

After the initial power-on-reset impulse, the POR may be used as a standard HADES input switch.

   xxxxxxxxx______-------------------------    
   ^        ^     ^
   t=0      t_o   t_o+t_active
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class hades.simulator.SimObject
classloader, console, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
PowerOnReset()
          PowerOnReset(): simple constructor
PowerOnReset(Design parent, java.lang.String name)
           
PowerOnReset(Design parent, java.lang.String name, double t_offset, double t_active)
           
 
Method Summary
 void assign(java.lang.String value, double time)
          specify a new output value from an external source (like a script).
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void elaborate(java.lang.Object arg)
          elaborate(): This method is called by the simulation engine to initialize the simulation object.
 void evaluate(java.lang.Object arg)
          evaluate(): called by the simulation engine on all events that concern this object.
 java.lang.String getBindkey()
          return our bindkey as a String
 double getT_active()
           
 double getT_offset()
           
 java.lang.String getToolTip(java.awt.Point position, long millis)
          construct a (short) tool tip message for a SimObject.
 boolean initialize(java.lang.String s)
          initialize a PowerOnReset from a String, which contains the integer version id, and the offset and active times (in seconds).
 void keyPressed(java.awt.event.KeyEvent evt)
          react to a KeyEvent.
 void mouseOrKeyEvent(boolean shiftDown)
          start or stop this PowerOnReset'erator
 void mousePressed(java.awt.event.MouseEvent me)
          react to a MouseEvent.
 double parse(java.lang.String s)
           
 void schedule(double time, StdLogic1164 value, boolean interactive)
           
 void setBindkey(java.lang.String s)
           
 void setSymbol(Symbol s)
           
 void setT_active(double d)
           
 void setT_active(java.lang.String s)
           
 void setT_offset(double d)
           
 void setT_offset(java.lang.String s)
           
 java.lang.String toString()
          toString() - the usual info method
 void wakeup(java.lang.Object arg)
          wakeup: this method is only used to handle "external" events on this PowerOnReset in reaction to an assign() call, which schedules a Wakeup event to update the symbol at the correct simulation time.
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, 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
message
 

Constructor Detail

PowerOnReset

public PowerOnReset()
PowerOnReset(): simple constructor


PowerOnReset

public PowerOnReset(Design parent,
                    java.lang.String name)

PowerOnReset

public PowerOnReset(Design parent,
                    java.lang.String name,
                    double t_offset,
                    double t_active)
Method Detail

setSymbol

public void setSymbol(Symbol s)
Overrides:
setSymbol in class SimObject

getT_offset

public double getT_offset()

getT_active

public double getT_active()

setT_offset

public void setT_offset(double d)

setT_active

public void setT_active(double d)

setT_offset

public void setT_offset(java.lang.String s)

setT_active

public void setT_active(java.lang.String s)

parse

public double parse(java.lang.String s)

initialize

public boolean initialize(java.lang.String s)
initialize a PowerOnReset from a String, which contains the integer version id, and the offset and active times (in seconds). For example, the String '1001 0.5 0.3' specifies a PowerOnReset whose output changes from 'U' to '0' after 0.5 seconds and from '0' to '1' after 0.8 (=0.5+0.3) seconds.

Overrides:
initialize in class SimObject

write

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

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

getBindkey

public java.lang.String getBindkey()
return our bindkey as a String

Overrides:
getBindkey in class SimObject

setBindkey

public void setBindkey(java.lang.String s)

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Description copied from class: SimObject
react to a KeyEvent. The base SimObject ignores all KeyEvents. this method is currently only used by a few classes in hades.models.io, e.g. IpinWithBindkey.

At the moment this is actually called from KeyHandler.keyTyped(), but this naming mismatch is not considered critical...

Overrides:
keyPressed in class SimObject

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Description copied from class: SimObject
react to a MouseEvent. The base SimObject ignores MouseEvents.

Note that the HADES schematic editor will also deliver jfig.canvas.FigCanvasEvent object, which also include the world-coordinates of the Event.

Overrides:
mousePressed in class SimObject

mouseOrKeyEvent

public void mouseOrKeyEvent(boolean shiftDown)
start or stop this PowerOnReset'erator


elaborate

public void elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine to initialize the simulation object.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class SimObject
Parameters:
arg - This parameter is ignored by PowerOnReset

evaluate

public void evaluate(java.lang.Object arg)
evaluate(): called by the simulation engine on all events that concern this object. The object is responsible for updating its internal state and for scheduling all pending output events.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimObject
Parameters:
arg - An arbitrary and unused object

wakeup

public void wakeup(java.lang.Object arg)
wakeup: this method is only used to handle "external" events on this PowerOnReset in reaction to an assign() call, which schedules a Wakeup event to update the symbol at the correct simulation time. To this end, the "arg" argument is expected to hold a WakeupEvent whose arg member is a StdLogic1164 object.

Specified by:
wakeup in interface Wakeable

schedule

public void schedule(double time,
                     StdLogic1164 value,
                     boolean interactive)

assign

public void assign(java.lang.String value,
                   double time)
specify a new output value from an external source (like a script). Calling this method will result both in the corresponding output event and an update/repaint of the PowerOneReset graphical symbol at the specified simulation time. The 'value' String is expected to have a one-character encoding of the StdLogic1164 value, namely "U" "X" "0" "1" "Z" "H" "L" "W" "D".

Internally, the latter graphical symbol update is implemented via a Wakeup event for this Ipin.

Specified by:
assign in interface Assignable

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
construct a (short) tool tip message for a SimObject. This method should be overridden as needed.

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

toString

public java.lang.String toString()
toString() - the usual info method

Overrides:
toString in class SimObject