hades.models.special
Class ParallelTerminal

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.special.ParallelTerminal
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class ParallelTerminal
extends SimObject
implements Simulatable

ParallelTerminal - a text-terminal (VT-100 style) with 8-bit parallel, strobed I/O. Output and input goes to a separate Swing (JFrame) window.

The terminal will latch the 8-bit data input on the rising edge of CLK. Similarly, it will output the 8-bit ASCII code of any typed key on the data outputs Q0 .. Q7. Once the data outputs are valid, ParallelTerminal generates a 100 nsec. strobe pulse on STR. A '0' value on the CLR input asynchronously clears the terminal display.

Note that this model assumes (but does not check!) that characters are never read or written faster than with a 200 nsec. cycle time.

See Also:
Serialized Form

Field Summary
(package private)  javax.swing.JPanel buttonPanel
           
(package private)  javax.swing.JButton clearButton
           
(package private)  javax.swing.JButton closeButton
           
protected  int index_D0
           
protected  int index_Q0
           
protected  int index_STR
           
protected  double lastSendTime
           
(package private)  javax.swing.JCheckBox logCB
           
protected  PortStdLogic1164 port_CLK
           
protected  PortStdLogic1164 port_CLR
           
protected  PortStdLogic1164 port_D0
           
protected  PortStdLogic1164 port_Q0
           
protected  PortStdLogic1164 port_STR
           
(package private)  javax.swing.JLabel receiveHexTF
           
(package private)  javax.swing.JLabel receiveTF
           
protected  Label symbolTypeLabel
           
(package private)  java.awt.Image theIcon
           
(package private)  javax.swing.JFrame topFrame
           
(package private)  javax.swing.JLabel transmitHexTF
           
(package private)  javax.swing.JLabel transmitTF
           
protected  StdLogic1164 value_0
           
protected  StdLogic1164 value_1
           
protected  StdLogic1164 value_X
           
(package private)  VT52Canvas vt52Canvas
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
ParallelTerminal()
          ParallelTerminal(): simple constructor
 
Method Summary
(package private)  void buildButtonPanel()
           
(package private)  void buildGUI()
           
(package private)  void buildGUICallbacks()
           
 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 ParallelTerminal, including its color
 void elaborate(java.lang.Object arg)
          elaborate(): We assign a '0' to all our outputs.
 void evaluate(java.lang.Object arg)
          evaluate(): called by the simulation engine on all events that concern this object.
 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.
(package private)  void latchOneCharacter()
           
static void main(java.lang.String[] argv)
          main(): simple selftest of the ParallelTerminal's GUI
 void mousePressed(java.awt.event.MouseEvent me)
          react to a MouseEvent.
 void setName(java.lang.String name)
          set the name of this SimObject.
 void setSymbol(Symbol s)
           
 java.lang.String toString()
          toString() - the usual info method
 void transmitOneCharacter(char c)
          transmitOneCharacter generates all simulation events to propagate the bit pattern corresponding to char 'c' on the data outputs and a strobe pulse on the strobe output port_STR.
 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, 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

port_CLR

protected PortStdLogic1164 port_CLR

port_CLK

protected PortStdLogic1164 port_CLK

port_D0

protected PortStdLogic1164 port_D0

port_STR

protected PortStdLogic1164 port_STR

port_Q0

protected PortStdLogic1164 port_Q0

value_0

protected StdLogic1164 value_0

value_1

protected StdLogic1164 value_1

value_X

protected StdLogic1164 value_X

index_D0

protected int index_D0

index_STR

protected int index_STR

index_Q0

protected int index_Q0

lastSendTime

protected double lastSendTime

symbolTypeLabel

protected Label symbolTypeLabel

topFrame

javax.swing.JFrame topFrame

buttonPanel

javax.swing.JPanel buttonPanel

clearButton

javax.swing.JButton clearButton

closeButton

javax.swing.JButton closeButton

vt52Canvas

VT52Canvas vt52Canvas

receiveTF

javax.swing.JLabel receiveTF

receiveHexTF

javax.swing.JLabel receiveHexTF

transmitTF

javax.swing.JLabel transmitTF

transmitHexTF

javax.swing.JLabel transmitHexTF

theIcon

java.awt.Image theIcon

logCB

javax.swing.JCheckBox logCB
Constructor Detail

ParallelTerminal

public ParallelTerminal()
ParallelTerminal(): simple constructor

Method Detail

setSymbol

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

setName

public void setName(java.lang.String name)
Description copied from class: SimObject
set the name of this SimObject. If there is a Symbol for this SimObject, we also try to set the InstanceLabel in the Symbol.

To avoid consistency problems, when the user changes a SimObject's name interactively, we also try to enforce a unique name.

Overrides:
setName in class SimObject

buildButtonPanel

void buildButtonPanel()

buildGUI

void buildGUI()

buildGUICallbacks

void buildGUICallbacks()

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

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

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

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(): We assign a '0' to all our outputs.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class SimObject
Parameters:
arg - This parameter is ignored by ParallelTerminal

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

latchOneCharacter

void latchOneCharacter()

transmitOneCharacter

public void transmitOneCharacter(char c)
transmitOneCharacter generates all simulation events to propagate the bit pattern corresponding to char 'c' on the data outputs and a strobe pulse on the strobe output port_STR.

Because this method is called in reaction to an (asynchronous) user input event, we have to use the scheduleInteractiveEvent() calls to keep the simulator data structures consistent.


copy

public SimObject copy()
copy(): create a clone of the current ParallelTerminal, 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 ParallelTerminal's GUI