hades.jpshell
Class JPWrapper

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.jpshell.JPWrapper
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class JPWrapper
extends SimObject
implements Simulatable, ContextToolTip, java.io.Serializable

JPWrapper - a subclass of SimObject used as base class for logic gates in JPython. Signals are expected to be StdLogic1164 objects.

See Also:
Serialized Form

Field Summary
 Port[] ports
           
 java.lang.String pyClass
           
 java.lang.String pyModul
           
 java.lang.String pyWriteArgs
           
 double t_delay
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, editor, name, parent, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
JPWrapper()
           
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 SimObject copy()
          create a copy of the current JPWrapper with the same gate delay.
 JPWrapper createJPObject(java.lang.String pyModul, java.lang.String pyClass, java.lang.String args)
           
 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.
 void execResource(java.lang.String resourcefilename)
           
 double getDelay()
           
 JPWrapper getPyObj()
           
 java.lang.String getSymbolResourceName()
          construct a symbol resource name from the class name of SimObject or its respective derived class: prepend '/', replace '.' by '/', and append ".sym".
 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 scheduleEvent(Signal signal, double time, StdLogic1164 value, Port port)
           
 void scheduleEventAfter(Signal signal, double delay, StdLogic1164 value, Port port)
           
 void setDelay(double t)
           
 void setDelay(java.lang.String s)
           
 void setPyClass(java.lang.String s)
           
 void setPyModul(java.lang.String s)
           
 void setPyObj(JPWrapper pyObj)
           
 void setPyWriteArgs(java.lang.String s)
           
 java.lang.String toString()
          toString() - the usual info method
 void updatePythonPath()
           
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, 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

pyModul

public java.lang.String pyModul

pyClass

public java.lang.String pyClass

pyWriteArgs

public java.lang.String pyWriteArgs

ports

public Port[] ports

t_delay

public double t_delay
Constructor Detail

JPWrapper

public JPWrapper()
Method Detail

getDelay

public double getDelay()

setDelay

public void setDelay(double t)

setDelay

public void setDelay(java.lang.String s)

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

getSymbolResourceName

public java.lang.String getSymbolResourceName()
Description copied from class: SimObject
construct a symbol resource name from the class name of SimObject or its respective derived class: prepend '/', replace '.' by '/', and append ".sym". For example, when called on a "hades.models.gates.And2" instance, this method will return "/hades/models/gates/And2.sym"

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

createJPObject

public JPWrapper createJPObject(java.lang.String pyModul,
                                java.lang.String pyClass,
                                java.lang.String args)

write

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

elaborate

public void elaborate(java.lang.Object arg)
Description copied from interface: Simulatable
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

evaluate

public void evaluate(java.lang.Object arg)
Description copied from interface: Simulatable
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 object argument

scheduleEvent

public void scheduleEvent(Signal signal,
                          double time,
                          StdLogic1164 value,
                          Port port)

scheduleEventAfter

public void scheduleEventAfter(Signal signal,
                               double delay,
                               StdLogic1164 value,
                               Port port)

copy

public SimObject copy()
create a copy of the current JPWrapper with the same gate delay.

Overrides:
copy in class SimObject

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

setPyObj

public void setPyObj(JPWrapper pyObj)

getPyObj

public JPWrapper getPyObj()

updatePythonPath

public void updatePythonPath()

execResource

public void execResource(java.lang.String resourcefilename)

setPyModul

public void setPyModul(java.lang.String s)

setPyClass

public void setPyClass(java.lang.String s)

setPyWriteArgs

public void setPyWriteArgs(java.lang.String s)