|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimObject
hades.models.special.MidiReceiver
MidiReceiver - a RS232 receiver set to 31.250 kbaud for MIDI protocol.
Field Summary | |
protected int |
baud_rate
|
protected double |
bit_time
|
int |
EVEN_PARITY
|
protected double |
lastSendTime
|
protected int |
n_databits
|
protected int |
n_rx_bits
|
protected int |
n_stopbits
|
int |
NO_PARITY
|
int |
ODD_PARITY
|
protected int |
parity_mode
|
protected PortStdLogic1164 |
port_RX
|
protected boolean[] |
rx_samples
|
protected int |
rx_state
|
protected boolean |
rx_waiting
|
protected StdLogic1164 |
value_0
|
protected StdLogic1164 |
value_1
|
protected StdLogic1164 |
value_X
|
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
MidiReceiver()
MidiReceiver(): simple constructor |
Method Summary | |
void |
configure()
create and display a 'ConfigDialog' to set the parameters for a SimObject. |
SimObject |
copy()
copy(): create a clone of the current MidiReceiver, including its color |
(package private) void |
decode(boolean[] receivedBits)
|
void |
elaborate(java.lang.Object arg)
elaborate(): Set the TX line to '1' (idle) |
void |
evaluate(java.lang.Object arg)
evaluate(): react to events on the RX input. |
boolean[] |
getDataBits(char c,
int n_databits)
|
StdLogic1164 |
getInputValue(Port p)
|
boolean |
getParityBit(boolean[] databits,
boolean even_parity)
|
boolean |
initialize(java.lang.String s)
nothing to initialize on a MidiReceiver |
static void |
main(java.lang.String[] argv)
main(): simple selftest of the MidiReceiver's GUI |
void |
mousePressed(java.awt.event.MouseEvent me)
react to a MouseEvent. |
(package private) void |
schedule(Signal signal,
Port port,
double time,
StdLogic1164 value)
|
void |
setName(java.lang.String name)
set the name of this SimObject. |
void |
setSymbol(Symbol s)
|
(package private) void |
startReceive()
|
java.lang.String |
toString()
toString() - the usual info method |
void |
wakeup(java.lang.Object arg)
Called in the middle of each bit period for sampling. |
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, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, 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 |
protected PortStdLogic1164 port_RX
protected StdLogic1164 value_0
protected StdLogic1164 value_1
protected StdLogic1164 value_X
public final int NO_PARITY
public final int ODD_PARITY
public final int EVEN_PARITY
protected int baud_rate
protected int n_databits
protected int n_stopbits
protected int parity_mode
protected double bit_time
protected int n_rx_bits
protected int rx_state
protected boolean rx_waiting
protected boolean[] rx_samples
protected double lastSendTime
Constructor Detail |
public MidiReceiver()
Method Detail |
public void setSymbol(Symbol s)
setSymbol
in class SimObject
public void setName(java.lang.String name)
SimObject
To avoid consistency problems, when the user changes a SimObject's name interactively, we also try to enforce a unique name.
setName
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()
SimObject
configure
in class SimObject
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 SimObject
arg
- This parameter is ignored by MidiReceiverpublic StdLogic1164 getInputValue(Port p)
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- An arbitrary and unused objectpublic void wakeup(java.lang.Object arg)
wakeup
in interface Wakeable
arg
- unused argumentvoid startReceive()
void decode(boolean[] receivedBits)
void schedule(Signal signal, Port port, double time, StdLogic1164 value)
public boolean[] getDataBits(char c, int n_databits)
public boolean getParityBit(boolean[] databits, boolean even_parity)
public SimObject copy()
copy
in class SimObject
public java.lang.String toString()
toString
in class SimObject
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |