hades.models.io
Class IpinStdLogic1164

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.gates.GenericGate
          extended byhades.models.io.Ipin
              extended byhades.models.io.IpinStdLogic1164
All Implemented Interfaces:
Assignable, java.lang.Cloneable, ContextToolTip, InputConnector, java.io.Serializable, Simulatable, Wakeable

public class IpinStdLogic1164
extends Ipin

IpinStdLogic1164 - an input pin (and hierarchy connectors) which allows to generate all nine std_logic values directly by clicking: U/X/0/1/Z/L/H/W/D.

See Also:
Serialized Form

Field Summary
protected  double delay
           
 
Fields inherited from class hades.models.io.Ipin
output_0, output_1, output_U, output_X, output_Z, port_toplevel, port_Y, showOnOff, startValue, state
 
Fields inherited from class hades.models.gates.GenericGate
t_delay
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
IpinStdLogic1164()
          IpinStdLogic1164(): simple constructor
 
Method Summary
 void configure()
          configure: display a dialog to specify the Ipin instance name, initial output value, and gate propagation delay.
 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: as interactive IpinStdLogic1164 events are handled by mousePressed(), this method is only called by the simulation engine whenever our (hidden) toplevel signal changes.
 int findStateFromMouseclick(java.awt.event.MouseEvent me)
           
protected  void initDisplay()
           
 void mousePressed(java.awt.event.MouseEvent me)
          mousePressed: an interactive mouse click on this switch.
 void schedule(int state, double delay, boolean interactive)
           
 void setStartState()
           
 void setValueAtTime(StdLogic1164 value, double time)
          used to specify a new IpinStdLogic1164 output value from an external source (e.g. a script).
 void showState()
           
 java.lang.String toString()
          toString() - the usual info method
 
Methods inherited from class hades.models.io.Ipin
assign, getDelay, getStartValue, initialize, setDelay, setName, setStartValue, setSymbol, wakeup, write
 
Methods inherited from class hades.models.gates.GenericGate
copy, getToolTip, scheduleEvent, scheduleEventAfter, scheduleOutputValue, scheduleOutputValueAfter, setDelay
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setParent, setPorts, setSimulator, setVersionId, setVisible
 
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
 

Field Detail

delay

protected double delay
Constructor Detail

IpinStdLogic1164

public IpinStdLogic1164()
IpinStdLogic1164(): simple constructor

Method Detail

initDisplay

protected void initDisplay()
Overrides:
initDisplay in class Ipin

setStartState

public void setStartState()
Overrides:
setStartState in class Ipin

showState

public void showState()
Overrides:
showState in class Ipin

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
mousePressed: an interactive mouse click on this switch.

For a normal click, we find the std_logic value whose "field" is selected by (or nearest to) the click position. The output value of this switch is then updated after t_delay. Note that the algorithm used for searching the right field does not work for mirrored symbols (yet).

If the SHIFT-key is down during the mouse click, we increment the switch state, allowing to toggle quickly through all nine std_logic values: U-X-0-1-Z-L-H-W-D-0-... The output value of this switch is updated after t_delay.

Overrides:
mousePressed in class Ipin

findStateFromMouseclick

public int findStateFromMouseclick(java.awt.event.MouseEvent me)

elaborate

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

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

schedule

public void schedule(int state,
                     double delay,
                     boolean interactive)
Overrides:
schedule in class Ipin

setValueAtTime

public void setValueAtTime(StdLogic1164 value,
                           double time)
used to specify a new IpinStdLogic1164 output value from an external source (e.g. a script). Note that this method only schedules an output value, but does _not_ update the graphical representation of the IpinStdLogic1164. This should probably be corrected...

Overrides:
setValueAtTime in class Ipin

evaluate

public void evaluate(java.lang.Object arg)
evaluate: as interactive IpinStdLogic1164 events are handled by mousePressed(), this method is only called by the simulation engine whenever our (hidden) toplevel signal changes. Take the toplevel signal value and propagate to our local signal.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class Ipin

configure

public void configure()
Description copied from class: Ipin
configure: display a dialog to specify the Ipin instance name, initial output value, and gate propagation delay.

Overrides:
configure in class Ipin

toString

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

Overrides:
toString in class SimObject