hades.models.special
Class ValueTrigger

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.special.ValueTrigger
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable, Simulatable

public class ValueTrigger
extends SimObject
implements Simulatable, java.awt.event.ItemListener

ValueTrigger - a class to detect and react to selected events (values) on SignalStdLogic1164 signals.

For example, a ValueTrigger object may be used as a 'breakpoint' which pauses the simulation on certain input values.

See Also:
Serialized Form

Field Summary
 int _0
           
 int _0L
           
 int _1
           
 int _1H
           
 int _ANY
           
 int _D
           
 int _H
           
 int _L
           
 int _NONE
           
 int _U
           
 int _UX
           
 int _W
           
 int _X
           
 int _Z
           
 int _ZWLHD
           
(package private)  javax.swing.JPanel actionPanel
           
protected  int activeValue
           
(package private)  javax.swing.JCheckBox beepCB
           
protected  boolean beepFlag
           
(package private)  javax.swing.JPanel buttonPanel
           
(package private)  javax.swing.JButton closeButton
           
(package private)  javax.swing.JCheckBox logMessageCB
           
protected  boolean logMessageFlag
           
(package private)  javax.swing.JCheckBox pauseSimulationCB
           
protected  boolean pauseSimulationFlag
           
protected  Label symbolTypeLabel
           
(package private)  javax.swing.JFrame topFrame
           
(package private)  StdLogic1164 value_0
           
(package private)  StdLogic1164 value_1
           
(package private)  javax.swing.JComboBox valueChoice
           
protected  java.lang.String[] valueNames
           
(package private)  javax.swing.JPanel valuePanel
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
ValueTrigger()
          ValueTrigger(): simple constructor
 
Method Summary
(package private)  void buildActionPanel()
           
(package private)  void buildButtonPanel()
           
 void buildGUI()
           
 void buildGUICallbacks()
           
(package private)  void buildValuePanel()
           
 void changeName()
           
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 SimObject copy()
          copy(): create a clone of the current ValueTrigger, including its color
 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.
static java.lang.String formatPaddedLong(long value, int n_chars)
           
 StdLogic1164 getInputValue(Port p)
           
 java.awt.Component getPropertySheet()
          return a reference to the 'property sheet' or configuration window for this SimObject.
 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 SimObject from a String.
 void itemStateChanged(java.awt.event.ItemEvent evt)
           
static void main(java.lang.String[] argv)
          main(): simple selftest of the ValueTrigger's GUI
 boolean match(StdLogic1164 value_A, int intValue)
           
 void mousePressed(java.awt.event.MouseEvent me)
          react to a MouseEvent.
 void setSymbol(Symbol s)
           
 java.lang.String toString()
          toString() - the usual info method
 void trigger(java.lang.Object arg)
           
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, 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
 

Field Detail

value_0

StdLogic1164 value_0

value_1

StdLogic1164 value_1

_U

public final int _U
See Also:
Constant Field Values

_X

public final int _X
See Also:
Constant Field Values

_0

public final int _0
See Also:
Constant Field Values

_1

public final int _1
See Also:
Constant Field Values

_Z

public final int _Z
See Also:
Constant Field Values

_L

public final int _L
See Also:
Constant Field Values

_H

public final int _H
See Also:
Constant Field Values

_W

public final int _W
See Also:
Constant Field Values

_D

public final int _D
See Also:
Constant Field Values

_0L

public final int _0L
See Also:
Constant Field Values

_1H

public final int _1H
See Also:
Constant Field Values

_UX

public final int _UX
See Also:
Constant Field Values

_ZWLHD

public final int _ZWLHD
See Also:
Constant Field Values

_ANY

public final int _ANY
See Also:
Constant Field Values

_NONE

public final int _NONE
See Also:
Constant Field Values

valueNames

protected java.lang.String[] valueNames

activeValue

protected int activeValue

pauseSimulationFlag

protected boolean pauseSimulationFlag

beepFlag

protected boolean beepFlag

logMessageFlag

protected boolean logMessageFlag

symbolTypeLabel

protected Label symbolTypeLabel

topFrame

javax.swing.JFrame topFrame

valuePanel

javax.swing.JPanel valuePanel

buttonPanel

javax.swing.JPanel buttonPanel

actionPanel

javax.swing.JPanel actionPanel

valueChoice

javax.swing.JComboBox valueChoice

closeButton

javax.swing.JButton closeButton

beepCB

javax.swing.JCheckBox beepCB

pauseSimulationCB

javax.swing.JCheckBox pauseSimulationCB

logMessageCB

javax.swing.JCheckBox logMessageCB
Constructor Detail

ValueTrigger

public ValueTrigger()
ValueTrigger(): simple constructor

Method Detail

setSymbol

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

buildValuePanel

void buildValuePanel()

buildActionPanel

void buildActionPanel()

buildButtonPanel

void buildButtonPanel()

buildGUI

public void buildGUI()

buildGUICallbacks

public void buildGUICallbacks()

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

changeName

public void changeName()

write

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

initialize

public boolean initialize(java.lang.String s)
Description copied from class: SimObject
initialize a SimObject from a String. The method returns true once all required data has been read. Until then, you should repeatedly call initialize() with additional Strings.

Overrides:
initialize 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

getPropertySheet

public java.awt.Component getPropertySheet()
Description copied from class: SimObject
return a reference to the 'property sheet' or configuration window for this SimObject. We cast the return value to an AWT Component, but typically you can expect either a hades.gui.PropertySheet or an java.awt.Window (Dialog or Frame).

Overrides:
getPropertySheet 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

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 ValueTrigger

getInputValue

public StdLogic1164 getInputValue(Port p)

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

match

public boolean match(StdLogic1164 value_A,
                     int intValue)

trigger

public void trigger(java.lang.Object arg)

formatPaddedLong

public static java.lang.String formatPaddedLong(long value,
                                                int n_chars)

copy

public SimObject copy()
copy(): create a clone of the current ValueTrigger, including its color

Overrides:
copy in class SimObject

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
Description copied from class: SimObject
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

main

public static void main(java.lang.String[] argv)
main(): simple selftest of the ValueTrigger's GUI