|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthades.simulator.SimObject
hades.models.io.RemoteOpin
RemoteOpin - transfer input events to a remote server using a simple URL protocol encoding and generate a trigger pulse. This simulation model waits for input events on its N data inputs, encodes the input values into a simple text-only URL representation, and contacts the server specified by "urlBase". In combination with a corresponding server (cgi-script or servlet), this allows to access remote simulation models from a standard Hades simulation setup.
To improve efficiency and to reduce network load, multiple events occuring at the same time are encoded as a single output value change. Internally, this is realized using a Wakeup-Event.
Also, a short 1nsec. pulse is generated on the "trigger" output pin for each network transaction. One use of this trigger pulse is to activate a RemoteIpin component to sample the remote circuit's response.
See the code and class documentation for the encodeURL() method for the protocol details.
| Field Summary | |
protected java.util.Hashtable |
_wakeupTable
|
protected double |
DELTA
|
protected PortStdLogic1164[] |
dports
|
protected PortStdLogic1164 |
port_error
|
protected PortStdLogic1164 |
port_trigger
|
(package private) java.lang.String |
urlBase
|
(package private) java.lang.String |
userID
|
| Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
| Constructor Summary | |
RemoteOpin()
RemoteOpin(): |
|
| Method Summary | |
void |
configure()
configure: |
SimObject |
copy()
create a copy of this RemoteOpin with the same urlBase and userID |
void |
createPorts()
|
void |
elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine to initialize the simulation object. |
java.lang.String |
encodeTime(double time)
convert a simulation time into ASCII: the bit-pattern into a hex string |
java.lang.String |
encodeURL()
this method collects the current simulation data and constructs the output URL. |
void |
evaluate(java.lang.Object arg)
evaluate: called from the simulation kernel for external input events on the D15..D0 input ports. |
int |
getNumberOfInputs()
|
double |
getSimTimeOr0()
return the current simulation time or 0.0D if no simulator |
java.lang.String |
getToolTip(java.awt.Point position,
long millis)
construct a (short) tool tip message for a SimObject. |
java.lang.String |
getUrlBase()
|
java.lang.String |
getUserID()
|
boolean |
initialize(java.lang.String s)
initialize from a String that contains the following data: "versionID urlBase userID", e.g. |
void |
setUrlBase(java.lang.String s)
|
void |
setUserID(java.lang.String s)
|
java.lang.String |
toString()
toString: generate a text description for this SimObject. |
void |
wakeup(java.lang.Object arg)
wakeup(): This method is called by the simulation engine to wakeup the simulation object. |
void |
write(java.io.PrintWriter ps)
write "versionId urlBase userID" using NameMangler |
| 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, 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 |
java.lang.String urlBase
java.lang.String userID
protected PortStdLogic1164[] dports
protected PortStdLogic1164 port_trigger
protected PortStdLogic1164 port_error
protected final double DELTA
protected java.util.Hashtable _wakeupTable
| Constructor Detail |
public RemoteOpin()
| Method Detail |
public int getNumberOfInputs()
public void createPorts()
public java.lang.String encodeURL()
Currently, the output format is as follows:
"urlBase" + "?" + "userID" + ":" + "simTime" + ":" + "D15"+"D14"+...+"D0"
where
userID : a String (which should not contain ':')
simTime : simulation time encoded as hex-formatted double value
D[i] : a 1-bit StdLogic1164 value, 'U', 'X', '0', ... 'D'
With small changes, the encoding could also be used for raw IP or TCP transfers instead of http/URL based transactions.
public java.lang.String encodeTime(double time)
public double getSimTimeOr0()
public java.lang.String getUrlBase()
public void setUrlBase(java.lang.String s)
public java.lang.String getUserID()
public void setUserID(java.lang.String s)
public void elaborate(java.lang.Object arg)
Simulatable
elaborate in interface Simulatableelaborate in class SimObjectpublic void evaluate(java.lang.Object arg)
evaluate in interface Simulatableevaluate in class SimObjectarg - an arbitrary object argumentpublic void wakeup(java.lang.Object arg)
Wakeable
wakeup in interface Wakeablepublic SimObject copy()
copy in class SimObject
public java.lang.String getToolTip(java.awt.Point position,
long millis)
SimObject
getToolTip in interface ContextToolTipgetToolTip in class SimObjectpublic java.lang.String toString()
SimObject
toString in class SimObjectpublic void write(java.io.PrintWriter ps)
write in class SimObjectpublic boolean initialize(java.lang.String s)
initialize in class SimObjectpublic void configure()
configure in class SimObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||