DIRECTORY CD, Rope USING [ROPE]; CDSequencer: CEDAR DEFINITIONS = BEGIN Command: TYPE = REF CommandRec; CommandRec: TYPE = RECORD [ key: ATOM _ NIL, design: CD.Design _ NIL, l: CD.Layer _ CD.undefLayer, 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: BOOL _ FALSE, ref: REF _ NIL, --typically describes issuer the command (if interactive: viewers data field) data: REF _ NIL --reserved for command implementor ]; CommandProc: TYPE = PROC[Command]; QueueMethod: TYPE = {doQueueAndMark, doQueue, dontQueue, useDefault}; ExecuteProc: PROC [proc: CommandProc, design: CD.Design _ NIL, queue: QueueMethod _ doQueue, comm: CDSequencer.Command _ NIL]; ExecuteCommand: PROC [key: ATOM _ NIL, design: CD.Design _ NIL, queue: QueueMethod _ useDefault, comm: CDSequencer.Command _ NIL]; ImplementCommand: PROC [key: ATOM, proc: CommandProc, technology: CD.Technology_NIL, queue: QueueMethod _ doQueueAndMark]; FetchCommand: PROC [key: ATOM, technology: CD.Technology_NIL] RETURNS [proc: CommandProc, qm: QueueMethod]; MarkChanged: PROC [design: CD.Design]; OpenDialogue: PROC [design: CD.Design]; Quit: PROC [message: Rope.ROPE_NIL]; AbortDesignsCommand: 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, 1986 by Xerox Corporation. All rights reserved. by Christian Jacobi, June 29, 1983 2:34 pm last edited by Christian Jacobi, March 17, 1986 9:30:24 am PST Implementation of interactive commands. Monitoring asynchronous commands. Since this module monitors asynchronous commands its implementation is the right place to implement also the regular background saving process. --doQueueAndMark: fork and queue, mark the design as changed --doQueue: fork and queue, don't mark the design as changed --dontQueue: don't fork, don't queue, don't mark (procedure call) --useDefault: use the commands default QueueMethod --Executes a command procedure proc. --design#NIL: design replaces comm.design --proc must be global --To transfer data to proc use: "comm: NEW[CommandRec _ [data: ..]]" --Fetches and executes a command. --key#NIL: key replaces comm.a --design#NIL: design replaces comm.design --Registeres a command --technology=NIL: implement command for all technologies. --Re-using the same atom (in same technology) overwrites the command --Fetches a commands registration --NIL proc if not defined --Mark the design as changed; it will be saved some time later again... --Initializes the command queue --Write message and terminates execution of the command of this process --Never returns --(use only from ChipNDale processes which have the CDSequencer lock of the design) --aborts -- Abortion does not guarantee the aborted process to stop, but most long -- commands are benevolent. -- Abortion of a command is also propagated using an event $Aborted. --Called from any process; tries to abort the designs current command --May flush commands not yet started --(On return success is not yet known) --Checks whether the current command on design has been aborted --(Accurate only inside CDSequencer's lock of design) --IF Aborted[design] THEN Quit[] ΚR˜codešœ*™*Kšœ Οmœ7™BKšœ,™,Kšœ?™?—šΟk ˜ Kšž˜Kšœžœžœ˜—K˜KšΠln œžœž œ˜!Kšž˜K˜K™'™!K™K™KK™D—K˜K˜Kšœ žœžœ ˜šœ žœžœ˜Kšœžœžœ˜Kšœžœ žœ˜Kšœžœ žœ ˜Kšœžœ ˜KšœžœΟc˜7Kšœžœ 8˜TKšœžœžœ ˜%Kšœžœžœ˜Kšœžœžœ M˜]Kšœžœžœ "˜2K˜—Kšœ žœžœ ˜"šœ žœ4˜EKšœ=™=Kšœ=™=KšœB™BKšœ4™4K˜—K˜š Οn œžœžœ žœ<žœ˜~Kšœ$™$Kšœ)™)Kšœ™KšœE™EK˜—š‘œžœžœžœ žœ žœ?žœ˜‚Kšœ!™!Kšœ™Kšœ)™)K˜—š ‘œžœžœ!žœ žœ*˜}Kšœ™Kšœ9™9KšœE™EK˜—š ‘ œžœžœžœ žœžœ'˜lKšœ!™!Kšœ™K˜—š‘ œžœ žœ ˜&KšœG™GK˜—š‘ œžœ žœ ˜'Kšœ™K˜—K™š‘œžœžœ˜$KšœG™GKšœ™KšœS™SK˜—K™K™K™JK™K™DK˜šΟbœžœ žœ ˜.KšœF™FKšœ%™%Kšœ'™'K˜—š ‘œžœ žœ žœžœ˜1Kšœ?™?Kšœ5™5—K˜š‘ œžœ žœ ˜(Kš  ™ —K˜K˜Kšžœ˜—…—€ˆ