|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimObject
hades.models.gates.GenericGate
hades.models.io.DiodeSwitch
DiodeSwitch - a simple subclass of GenericGate that models a switch in series with a diode. This type of switch is typically used for a switch matrix, e.g. a pocket calculator keypad.
Clicking on the switch will close the switch As usual, this switch is configured to be active low.
Field Summary | |
protected double |
delay
|
protected PortStdLogic1164 |
port_A
|
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 | |
DiodeSwitch()
DiodeSwitch(): simple constructor |
Method Summary | |
void |
assign(java.lang.String value,
double simTime)
assign: set a new state for this switch at the specified time, also update the graphical symbol (if visible) via a WakeupEvent. |
void |
configure()
configure: display a dialog to specify instance name, initial output value, and switch propagation delay. |
void |
elaborate(java.lang.Object arg)
elaborate: set the selected inital state, show that state on the symbol, and generate a corresponding SimEvent on the Y output port. |
void |
evaluate(java.lang.Object arg)
evaluate: This is only called when this switch is used as a hierarchy connector. |
double |
getDelay()
|
java.lang.String |
getStartValue()
|
protected void |
initDisplay()
|
boolean |
initialize(java.lang.String s)
initialize an DiodeSwitch from a String, which contains the integer version id, and optionally the initial start value (StdLogic1164.getChar) if the DiodeSwitch should start in the '0' state instead of the 'U' state. |
void |
mousePressed(java.awt.event.MouseEvent me)
react to a MouseEvent. |
void |
setDelay(java.lang.String s)
|
void |
setStartState()
|
void |
setStartValue(java.lang.String s)
|
void |
setSymbol(Symbol s)
|
void |
showState()
|
void |
wakeup(java.lang.Object arg)
wakeup: this method is currently used to handle "external" events on this DiodeSwitch via the assign call, which schedules a Wakeup event to update our symbol at the correct simulation time. |
void |
write(java.io.PrintWriter ps)
write the versionID and the initial start value of this switch, e.g. |
Methods inherited from class hades.models.gates.GenericGate |
copy, getToolTip, scheduleEvent, scheduleEventAfter, scheduleOutputValue, scheduleOutputValueAfter, setDelay |
Methods inherited from class hades.simulator.SimObject |
constructDynamicSymbol, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, 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 PortStdLogic1164 port_A
protected PortStdLogic1164 port_Y
protected StdLogic1164 startValue
protected double delay
protected int state
protected ColoredCircle showOnOff
Constructor Detail |
public DiodeSwitch()
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 void setSymbol(Symbol s)
setSymbol
in class SimObject
protected void initDisplay()
public void setStartState()
public void showState()
public void mousePressed(java.awt.event.MouseEvent me)
SimObject
Note that the HADES schematic editor will also deliver jfig.canvas.FigCanvasEvent object, which also include the world-coordinates of the Event.
mousePressed
in class SimObject
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
elaborate
in class GenericGate
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- an arbitrary object argumentpublic void assign(java.lang.String value, double simTime)
assign
in interface Assignable
public void wakeup(java.lang.Object arg)
wakeup
in interface Wakeable
public void configure()
configure
in class GenericGate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |