|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hades.simulator.SimObject hades.models.gates.GenericGate hades.models.io.Ipin
Ipin - a simple subclass of GenericGate that models an switch. Also, a Ipin object is automatically interpreted as an input for a hierarchical Design - like a standard-CAD 'ipin'.
Starting with 28.05.2005, this class also supports a 'bindkey' that allows the user to simply type the bindkey instead of clicking the switch. We only allow lowercase keys a-z and 0-9 as bindkeys. Just typing such key is handled the same as a normal left-button mouseclick, namely toggling between the '0' and '1' states. For the a-z keys, the shift+key combination is interpreted the same as a shift-mouseclick, namely toggling between '0', '1', 'Z', 'X' states.
Field Summary | |
protected java.lang.String |
bindkey
|
protected double |
delay
|
protected StdLogic1164 |
output_0
|
protected StdLogic1164 |
output_1
|
protected StdLogic1164 |
output_U
|
protected StdLogic1164 |
output_X
|
protected StdLogic1164 |
output_Z
|
protected PortStdLogic1164 |
port_toplevel
|
protected PortStdLogic1164 |
port_Y
|
protected ColoredCircle |
showOnOff
|
protected StdLogic1164 |
startValue
|
protected int |
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 | |
Ipin()
Ipin(): simple constructor |
Method Summary | |
void |
assign(java.lang.String value,
double time)
used to specify a new Ipin output value from an external source (e.g. |
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 Ipin events are handled by mousePressed(), this method is only called by the simulation engine whenever our (hidden) toplevel signal changes. |
java.lang.String |
getBindkey()
return our bindkey as a String |
double |
getDelay()
|
java.lang.String |
getStartValue()
|
java.lang.String |
getToolTip(java.awt.Point position,
long millis)
construct a (short) tool tip message for a logic gate with name, class name, and gate delay. |
protected void |
initDisplay()
|
boolean |
initialize(java.lang.String s)
initialize an Ipin from a String, which contains the integer version id, and optionally the start value of this Ipin (the latter encoded via StdLogic1164.getChar() values, 'U' 'X' '0' ... |
void |
keyPressed(java.awt.event.KeyEvent evt)
react to a KeyEvent. |
void |
mouseOrKeyEvent(boolean shiftDown)
|
void |
mousePressed(java.awt.event.MouseEvent me)
handle a mouse click on this IpinWithBindkey's graphical symbol. |
protected void |
schedule(int state,
double delay,
boolean interactive)
|
void |
setBindkey(java.lang.String s)
|
void |
setDelay(java.lang.String s)
|
void |
setName(java.lang.String name)
set the name of this SimObject. |
void |
setStartState()
|
void |
setStartValue(java.lang.String s)
|
void |
setSymbol(Symbol s)
|
void |
setValueAtTime(StdLogic1164 value,
double time)
Deprecated. please use assign(String,time) instead |
void |
showState()
|
void |
wakeup(java.lang.Object arg)
wakeup: this method is currently used to handle "external" events on this Ipin via the assign call, which schedules a Wakeup event to update the Ipin symbol at the correct simulation time. |
void |
write(java.io.PrintWriter ps)
write the versionID and the start value of this Ipin (the latter as StdLogic1164.getChar() value), e.g. |
Methods inherited from class hades.models.gates.GenericGate |
copy, 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, tearDown, toString |
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 |
protected int state
protected PortStdLogic1164 port_Y
protected PortStdLogic1164 port_toplevel
protected StdLogic1164 output_1
protected StdLogic1164 output_0
protected StdLogic1164 output_Z
protected StdLogic1164 output_X
protected StdLogic1164 output_U
protected StdLogic1164 startValue
protected double delay
protected ColoredCircle showOnOff
protected java.lang.String bindkey
Constructor Detail |
public Ipin()
Method Detail |
public double getDelay()
getDelay
in class GenericGate
public void setDelay(java.lang.String s)
setDelay
in class GenericGate
public java.lang.String getStartValue()
public void setStartValue(java.lang.String s)
public boolean initialize(java.lang.String s)
initialize
in class GenericGate
public void write(java.io.PrintWriter ps)
write
in class GenericGate
public java.lang.String getBindkey()
getBindkey
in class SimObject
public void setBindkey(java.lang.String s)
public void setSymbol(Symbol s)
setSymbol
in class SimObject
public void setName(java.lang.String name)
SimObject
To avoid consistency problems, when the user changes a SimObject's name interactively, we also try to enforce a unique name.
setName
in class SimObject
protected void initDisplay()
public void setStartState()
public void showState()
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in class SimObject
public void mouseOrKeyEvent(boolean shiftDown)
public void keyPressed(java.awt.event.KeyEvent evt)
SimObject
At the moment this is actually called from KeyHandler.keyTyped(), but this naming mismatch is not considered critical...
keyPressed
in class SimObject
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
elaborate
in class GenericGate
arg
- This parameter is ignored by Ipinprotected void schedule(int state, double delay, boolean interactive)
public void setValueAtTime(StdLogic1164 value, double time)
public void assign(java.lang.String value, double time)
Internally, the latter graphical symbol update is implemented via a Wakeup event for this Ipin.
assign
in interface Assignable
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- an arbitrary object argumentpublic void wakeup(java.lang.Object arg)
wakeup
in interface Wakeable
public void configure()
configure
in class GenericGate
public java.lang.String getToolTip(java.awt.Point position, long millis)
GenericGate
getToolTip
in interface ContextToolTip
getToolTip
in class GenericGate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |