DIRECTORY IO USING [PutFR, int], PlotGraph, Rope USING [ROPE, Cat], Vector2; PlotGraphTestImpl: CEDAR PROGRAM IMPORTS PlotGraph, IO, Rope ~ BEGIN VEC: TYPE ~ Vector2.VEC; VecList: TYPE ~ LIST OF VEC; DisplayList: TYPE = LIST OF DisplayListRec; DisplayListRec: TYPE = RECORD [ name: Rope.ROPE, analog: BOOLEAN _ TRUE, or: VEC, list: VecList ]; plot: PlotGraph.Plot; txt: PlotGraph.PlotText; testGClass: PlotGraph.GraphClass _ NEW[PlotGraph.GraphClassRec _ [ insert: NIL, delete: NIL, enumerate: TestEnum ]]; dummyAxisData: PlotGraph.AxisData _ [1000.0, FALSE]; displayList: DisplayList; m: INT; index: CARDINAL _ 0; window: PlotGraph.Rectangle _ [0.0, 0.0, 5000.0, 6400.0]; TestEnum: PROC [plot: PlotGraph.Plot, graph: PlotGraph.Graph, bounds: PlotGraph.Rectangle, eachPoint: PlotGraph.PointProc] RETURNS [invalidEnumeration: BOOL _ FALSE] ~ { quit: BOOLEAN _ FALSE; vecList: VecList _ NARROW[graph.data]; FOR iVecList: VecList _ vecList, iVecList.rest UNTIL iVecList=NIL DO IF eachPoint[iVecList.first.x, iVecList.first.y] THEN RETURN[TRUE]; ENDLOOP; }; DataGenerator: PUBLIC PROC [numberOfItems: INT _ 1, length: INT _ 64, x0: REAL _ 0.0, analog: BOOLEAN _ TRUE, yMult: REAL _ 1.0, oldDisplayList: DisplayList _ NIL] RETURNS [displayList: DisplayList] ~ { displayList _ oldDisplayList; FOR n: INT IN [0..numberOfItems) DO displayList _ CONS[[ name: Rope.Cat["n", IO.PutFR["%d", IO.int[index _ SUCC[index]]]], 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; }; plot _ PlotGraph.CreatePlot["Test"]; txt _ NEW[PlotGraph.PlotTextRec _ [ contents: "Test of PlotGraph", bounds: [0.4, 0.5, 0.2, 0.1], rotation: 90.0, justifyX: center, justifyY: center ]]; plot.texts _ LIST [txt]; plot.lowerBounds _ [0.0, 0.0]; plot.upperBounds _ [64*2000.0, 5000.0]; displayList _ DataGenerator[8]; displayList _ DataGenerator[numberOfItems: 4, analog: FALSE, yMult: 0.031, oldDisplayList: displayList] ; dummyAxisData.visible _ TRUE; FOR iDisplayList: DisplayList _ displayList, iDisplayList.rest UNTIL iDisplayList=NIL DO plot.axis _ CONS[NEW[PlotGraph.AxisRec _ [ graphs: LIST[NEW[PlotGraph.GraphRec _ [ class: testGClass, name: iDisplayList.first.name, data: iDisplayList.first.list ]]], bounds: [0.0, 0.0, 64*2000.0, 5000.0], name: "axis name here", style: IF iDisplayList.first.analog THEN analog ELSE hexaH, axisData: [dummyAxisData, dummyAxisData] ]], plot.axis]; ENDLOOP; plot.axis.first.style _ hexaV; PlotGraph.RefreshPlot[plot: plot, within: window, eraseFirst: TRUE]; END.  PlotGraphTestImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Barth, August 25, 1986 12:32:39 pm PDT Christian Le Cocq May 12, 1987 7:05:02 pm PDT Test of the PlotGraph oscilloscope. Generates data generate numberOfItems lists of values named n0, n1...np. Ê®˜codešœ™Kšœ Ïmœ1™žœ˜DKšžœ˜—…— R