DIRECTORY CD, Rope USING [ROPE]; CDSequencer: CEDAR DEFINITIONS = BEGIN Command: TYPE = REF CommandRec; CommandRec: TYPE = RECORD [ a: ATOM _ NIL, design: CD.Design _ NIL, l: CD.Layer _ CD.combined, n: CD.Number _ 0, pos: CD.Position _ [0, 0], -- final position of command sPos: CD.Position _ [0, 0], -- special position, start position, (exceptional: size) orient: CD.Orientation _ CD.original, b: BOOLEAN _ FALSE, ref: REF _ NIL, --typically describes who issued the command (viewers data field) data: REF _ NIL, --reserved for command implementor fetched: --PRIVATE-- REF READONLY CommDescriptor _ NIL --private for CDSequencerImpl ]; CommandProc: TYPE = PROC[Command]; QueueMethod: TYPE = {doQueueAndMark, doQueue, dontQueue, useDefault}; CommDescriptor: TYPE = RECORD [p: CommandProc, qm: QueueMethod]; ExecuteProc: PROC [comm: CDSequencer.Command _ NIL, design: CD.Design _ NIL, proc: CommandProc, queue: QueueMethod _ doQueue]; ExecuteCommand: PROC [comm: CDSequencer.Command _ NIL, design: CD.Design _ NIL, command: ATOM _ NIL, queue: QueueMethod _ useDefault]; ImplementCommand: PROC [a: ATOM, p: CommandProc, technology: CD.Technology_NIL, queue: QueueMethod _ doQueueAndMark]; FetchCommand: PROC [a: ATOM, technology: CD.Technology] RETURNS [REF READONLY CommDescriptor]; MarkChanged: PROC [design: CD.Design]; QuitCommand: PROC [message: Rope.ROPE]; AbortTheCommand: PROC [design: CD.Design]; Aborted: PROC [design: CD.Design] RETURNS [BOOL]; CheckAborted: PROC [design: CD.Design]; END. ¦CDSequencer.mesa (A ChipNDale module) Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, June 29, 1983 2:34 pm last edited by Christian Jacobi, July 8, 1985 4:24:50 pm PDT Executing and queueing commands --doQueueAndMark: mark the design as changed --the queued executions are also forked --if design#NIL replaces comm.design --proc must be global --To transfer data to proc use: "comm: NEW[CommandRec _ [data: ..]]" --if command#NIL replaces comm.a --if design#NIL replaces comm.design --If technology is NIL implement for all technologies. --Reimplementing the same atom in a technology overwrites the command; --If the same atom is specified for a particular technology and all technologies, --the more specific implementation wins independent of order. --There is a (finite, short) list of atoms you can NOT use. --NIL if not defined --the design has been changed; it should be saved some time again... --write message and terminates execution of the command of this process --never returns --called from any process --checks if the current command on design has been aborted --IF Aborted[design] THEN SIGNAL TerminalIO.UserAbort Ê ˜šœ*™*Jšœ Ïmœ7™BJšœ,™,Jšœ=™=J™J™—J˜šÏk ˜ Jšž˜Jšœžœžœ˜J˜—JšÏn œžœž œ˜!Jšž˜J˜Jšœ žœžœ ˜šœ žœžœ˜Jšœžœžœ˜Jšœžœ žœ˜Jšœžœ žœ ˜Jšœžœ ˜JšœžœÏc˜7Jšœžœ 8˜TJšœžœžœ ˜%Jšœžœžœ˜Jšœžœžœ A˜QJšœžœžœ "˜3Jš œ ž œžœžœžœ ˜TJ˜—Jšœ žœžœ ˜"šœ žœ4˜EJšœ,™,Jšœ'™'—J˜Jšœžœžœ#˜@J˜J˜š Ÿ œžœžœ žœ žœ3˜~Jšœ$™$Jšœ™JšœE™E—J˜šŸœžœžœ žœ žœ žœžœ#˜†Jšœ ™ Jšœ$™$—J˜š Ÿœžœžœžœ žœ*˜xJšœ6™6JšœG™GJšœQ™QJšœ>™>Jšœ;™;—J˜šŸ œžœžœžœ ˜8šžœžœžœ˜'Jšœ™——J˜šŸ œžœ žœ ˜&JšœD™D—J˜šŸ œžœžœ˜'JšœG™GJšœ™J˜—šŸœžœ žœ ˜*Jšœ™—J˜š Ÿœžœ žœ žœžœ˜1Jšœ:™:—J˜šŸ œžœ žœ ˜(Jš 5™5—J˜Jšžœ˜—…—ö ©