DIRECTORY
Imager USING [Context, Color],
ViewerClasses USING [Viewer],
Vector2 USING [VEC],
Rope USING [ROPE];
~
BEGIN
The input data structure:
VEC: TYPE ~ Vector2.VEC;
VecList: TYPE ~ LIST OF VEC;
Viewer: TYPE ~ ViewerClasses.Viewer;
DisplayList: TYPE = LIST OF DisplayListRec;
DisplayListRec:
TYPE =
RECORD [
name: Rope.ROPE,
analog: BOOLEAN ← TRUE,
or: VEC,
list: VecList
];
If you do viewerData: ViewerData ~ NARROW[viewer.data], rather indiscretely, you will gain acces to the display constants. Read them if you want, modify them before any LoadDisplay, but not on the fly please.
ViewerData: TYPE = REF ViewerDataRec;
ViewerDataRec:
TYPE =
RECORD [
context: Imager.Context,
xTranslation, yTranslation: REAL ← 0.0,
xMax, yMax: REAL ← 100.0,
xMin, yMin: REAL ← 0.0,
scalex: REAL ← 0.01,
scaley: REAL ← 0.005,
magOn: BOOLEAN ← FALSE,
magOr: REAL ← 0.0,
magScale: REAL ← 0.08,
inter: REAL ← 50.0, -- separation between curves
displayList: DisplayList,
magDisplayList: DisplayList
];
black: Imager.Color;
white: Imager.Color;
red: Imager.Color;
green: Imager.Color;
blue: Imager.Color;
puce: Imager.Color;
BuildViewer:
PROC[viewerTitle: Rope.
ROPE]
RETURNS[viewer: Viewer];
Gives you an oscilloscope-like viewer embedded in its own container. The viewer is the Handle of this package.
DrawVect:
PROC [or:
VEC, ex:
VEC, viewer
: Viewer, color: Imager.Color];
DrawRope:
PROC[pos:
VEC, rope: Rope.
ROPE, viewer
: Viewer, color: Imager.Color];
TimeAxis:
PROC [unit:
REAL, viewer
: Viewer, color: Imager.Color];
ReDraw:
PROC [viewer
: Viewer];
Erase and re-draw the viewer
ProduceIPMaster:
PROC [viewer
: Viewer];
LoadDisplay:
PROC [displayList: DisplayList, viewer
: Viewer];
Initialize the display and the data structures. the VecLists should be reverse time ordered, that is they more likely come from newListOfValues ← CONS[newElement, oldListOfValues]
UpdateDisplay:
PROC [displayList: DisplayList, viewer
: Viewer];
Append the new lists to the old ones. The new list and the list in previous calls of LoadDisplay and UpdateDisplay are independant. Only matching names will be updated. Does not call ReDraw itself.