Plotter.mesa, an interface for creating and maintaining
Viewer-world plots of real values
Jlarson, July 10, 1985 3:41:35 pm PDT
DIRECTORY
RealEvent USING[StreamHandle],
RealVec USING[Handle],
Rope USING[ROPE],
ViewerClasses USING[Viewer];
Plotter: DEFINITIONS =
{ Object: TYPE;
Handle: TYPE = REF Object;
A plotter is an active object that pulls events from an
eventSource, incorporates them in a circular buffer of
events, and maintains a graph showing event values vs.
event times.
PointShape: TYPE = {none, filledBox, emptyBox, filledDiamond,
emptyDiamond, dot, circle};
Connectivity: TYPE = {solid, dotted, dashed, dotDash, vertical};
Create: PROC
[label: Rope.ROPE,
eventSource: RealEvent.StreamHandle,
nEvents: NAT,
the length of the circular buffer.
plotValueDifferences: BOOLEANFALSE,
plotValuePerSecond: BOOLEANFALSE,
autoRepaint: BOOLEANFALSE,
TRUE => repaint whenever a new event occurs
iconic: BOOLEANTRUE,
connectivity: Connectivity ← solid,
how to draw the connecting line between
adjacent data points
pointShape: PointShape ← none
how to depict data points
]
RETURNS[Handle];
Paint: PROC[self: Handle];
Destroy: PROC[self: Handle];
CreatePlotViewer: PROC
[label: Rope.ROPE,
verticalAxis: RealVec.Handle,
horizontalAxis: RealVec.Handle ← NIL,
default: RealVec.IndexVec[verticalAxis.length]
iconic: BOOLEANTRUE,
connectivity: Connectivity ← solid,
pointShape: PointShape ← none
]
RETURNS[ViewerClasses.Viewer];
This low-level procedure is used by Create.
The two RealVec.Object's must have the same length.
CreatePlotViewer creates a graph of
verticalAxis[i] vs. horizontalAxis[i]
for i IN [0..verticalAxis.length)
Subsequent changes to the two RealVec.Object's will be
reflected in the graph when it is repainted
(via ViewerOps.PaintViewer). For the purpose of connecting
adjacent data points with lines, adjacency of values in
verticalAxis is determined by the sort order of
corresponding values in horizontalAxis.
}.