|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hades.simulator.SimObject hades.models.io.RemoteIpin
RemoteIpin - read N bits of data from a remote server and generate the corresponding output events on output ports YN-1..Y0. This class waits for a rising edge (0-1 transition) on the "sample" input port to contact the remote server specified by the "urlBase" and "userID" values. It then reads the remote server simulation time and 24 (N_OUTPUTS) StdLogic1164 data values in ASCII representation and converts this information into events on the YN..Y0 ouptut ports.
If the remote server cannot be reached or its response is invalid, the "error" output signal is asserted.
See the code and class documentation for the encodeURL() and parseURLData() methods for the protocol details.
Field Summary | |
protected PortStdLogic1164 |
port_error
|
protected PortStdLogic1164 |
port_sample
|
(package private) java.lang.String |
urlBase
|
(package private) java.lang.String |
userID
|
protected PortStdLogic1164[] |
yports
|
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
RemoteIpin()
RemoteIpin(): |
Method Summary | |
void |
configure()
configure: |
SimObject |
copy()
create a copy of this RemoteIpin 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 constructs the URL used to contact the server |
void |
evaluate(java.lang.Object arg)
evaluate: called from the simulation kernel when the sample input changes. |
int |
getNumberOfOutputs()
|
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 |
parseURLData()
parse the data returned by the URL connection. |
void |
readFromRemoteServer()
|
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 |
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 |
Field Detail |
java.lang.String urlBase
java.lang.String userID
protected PortStdLogic1164[] yports
protected PortStdLogic1164 port_sample
protected PortStdLogic1164 port_error
Constructor Detail |
public RemoteIpin()
Method Detail |
public int getNumberOfOutputs()
public void createPorts()
public java.lang.String encodeURL()
Currently, the output format is as follows:
"urlBase" + "?" + "userID" + ":" + "simTime"
where
userID : a String (which should not contain ':')
simTime : simulation time encoded as hex-formatted double value
public java.lang.String encodeTime(double time)
public double getSimTimeOr0()
public void parseURLData()
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)
SimObject
elaborate
in interface Simulatable
elaborate
in class SimObject
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- an arbitrary object argumentpublic void readFromRemoteServer()
public SimObject copy()
copy
in class SimObject
public java.lang.String getToolTip(java.awt.Point position, long millis)
SimObject
getToolTip
in interface ContextToolTip
getToolTip
in class SimObject
public java.lang.String toString()
SimObject
toString
in class SimObject
public void write(java.io.PrintWriter ps)
write
in class SimObject
public boolean initialize(java.lang.String s)
initialize
in class SimObject
public void configure()
configure
in class SimObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |