MintDisplayTestImpl.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Christian LeCocq, July 31, 1986 6:29:18 pm PDT
Test of the MintDisplay oscilloscope. Generates data
DIRECTORY
IO USING [PutFR, int],
MintDisplay,
Rope USING [ROPE, Cat];
MintDisplayTestImpl: CEDAR PROGRAM
IMPORTS MintDisplay, IO, Rope
~ BEGIN
viewer: MintDisplay.Viewer;
displayList: MintDisplay.DisplayList;
m: INT;
DataGenerator: PUBLIC PROC [numberOfItems: INT ← 1, length: INT ← 32, x0: REAL ← 0.0, analog: BOOLEANTRUE, yMult: REAL ← 1.0, oldDisplayList: MintDisplay.DisplayList ← NIL] RETURNS [displayList: MintDisplay.DisplayList] ~ {
generate numberOfItems lists of values named n0, n1...np.
displayList ← oldDisplayList;
FOR n: INT IN [0..numberOfItems) DO
displayList ← CONS[[
name: Rope.Cat["n", IO.PutFR["%d", IO.int[n]]],
analog: analog,
or: [0.0, 0.0],
list: NIL], displayList];
FOR i: INT IN [0..length) DO
m ← (i /(3+n)) MOD 2;
displayList.first.list ← CONS[[x: i*2000.0 + x0, y: 5000.0*yMult*m], displayList.first.list];
ENDLOOP;
ENDLOOP;
};
viewer ← MintDisplay.BuildViewer["Test"];
displayList ← DataGenerator[8];
displayList ← DataGenerator[numberOfItems: 4, analog: FALSE, yMult: 256.0, oldDisplayList: displayList] ;
displayList ← DataGenerator[numberOfItems: 4, oldDisplayList: displayList] ;
MintDisplay.LoadDisplay[displayList, viewer];
END.