-- DoradoBoard.mesa
-- last modified by C. Thacker November 8, 1982 9:45 am

DIRECTORY
 Containers,
 Graphics,
IO,
 Rope,
 ViewerClasses;

DoradoBoard: CEDAR DEFINITIONS

IMPORTS IO, Rope, ViewerClasses =

BEGIN

------ Constants ------

ASISeal: CARDINAL = 1009;
canonWithSegs: CARDINAL = LAST[CARDINAL];
canonWithoutSegs: CARDINAL = LAST[CARDINAL]-1;


------ Variables ------

boardWidth, boardHeight: Mils;
asiOffset: Point;
board: Board;


------ Types ------

ErrorType: TYPE = {ASISealError, EndOfFile, IllegalFile, InvalidSignal, NeedFile};
MouseButton: TYPE = {red, yellow, blue};
Pad: TYPE = RECORD [
 p: Point,
 con: CARDINAL,
 segs: REF SegTab,
 type: PadType
 ];

PadType: TYPE = RECORD [ t: ProbeID, n: FlukeChan];
ProbeID: TYPE = {noProbe, signal,gnd,vee,vdd,vtt,vcc};
FlukeChan: TYPE = [0..7203];

PadIndex: TYPE = CARDINAL [0 .. 10000];
Pads: TYPE = ARRAY PadIndex OF Pad;
PadsRef: TYPE = REF Pads;
Point: TYPE = RECORD [x, y: Mils];
Mils: TYPE = INTEGER;
SegTab: TYPE = RECORD [
 l: ARRAY WiringLayer OF INTALL[0],
 sigName: Rope.ROPENIL,
 padCount: CARDINAL ← 0 --count of the non-canonical pads in this net
 ];
SigPadList: TYPE = LIST OF PadIndex;
WiringLayer: TYPE = [0 .. 4);
Board: TYPE = REF BoardRec;


BoardRec: TYPE = RECORD [
 outer: Containers.Container ← NIL,
  -- handle for the enclosing container
 height: CARDINAL ← 0,
  -- height measured from the top of the container
 boardName, signal, boardPicture: ViewerClasses.Viewer ← NIL,
 asiFile: IO.STREAMNIL,
 errorInStream: IO.STREAMNIL,
 errorOutStream: IO.STREAMNIL,
 showLabels, showPads: BOOLTRUE,
 plotLayer: ARRAY WiringLayer OF BOOLALL[TRUE],
 mirFact: INTEGER ← 1,
 rotAngle: INTEGER ← 0,
 center: Point,
 padCount: PadIndex ← 0, -- number of pads in ASI file
 hitPadIndex: PadIndex ← 0,
 pads: PadsRef ← NIL,
 scale, milsPerPixel: REAL ← 1.0,
 signalPads: SigPadList ← NIL-- list of signals to be painted
 ];


------ Procedures in BoardPaint.mesa ------

PaintBoard: ViewerClasses.PaintProc;
BoardContext: PROC [state: Board, context: Graphics.Context ← NIL]
RETURNS[Graphics.Context];

------ Procedures in Wiring.mesa ------

AddSignal: PROC [state: Board, signal: Rope.ROPE]
RETURNS [BOOLEAN];
RemoveSignal: PROC [state: Board, signal: Rope.ROPE]
RETURNS [BOOLEAN];
FileError: PROC [state: Board, file: Rope.ROPE, error: ErrorType];
GetCardinal: PROC [state: Board] RETURNS [CARDINAL];
GetInt: PROC [state: Board] RETURNS [INT];
GetPoint: PROC [state: Board] RETURNS [Point];
FindClosestPad: PROC [state: Board, p: Point]
RETURNS [pad: PadIndex, sigName: Rope.ROPE];
MinPadGE: PROC [state: Board, x: Mils] RETURNS [minIndex: PadIndex];
-- Returns smallest index minIndex such that x<=state.pads[minIndex].p.x.
GetCanonicalPad: PROC [state: Board, index: PadIndex] RETURNS [pindex: PadIndex];
ReadBoardData: PROC [state: Board, boardName: Rope.ROPE];
------ Procedures in Fluke.mesa ------
ASItoFluke: PROC[x,y: INTEGER] RETURNS [PadType];

END. -- of DoradoBoard


CHANGE LOG

Created by L. Hilton, September 9, 1982 7:05 pm
Started adding code for Fluke tester - CT November 8, 1982 9:46 am