DIRECTORY CD, CDBasics, CDSimpleOps, CDOps, CDOrient, CDRects, CDSequencer, TerminalIO; CDBasicCommands: CEDAR PROGRAM IMPORTS CDSimpleOps, CDOps, CDSequencer, TerminalIO, CDRects, CDBasics = BEGIN AddARect: PROC[design: CD.Design, r: CD.DesignRect, l: CD.Layer] = BEGIN ob: CD.ObPtr; sz: CD.DesignPosition _ CDBasics.SizeOfRect[r]; orient: CD.Orientation _ CDOrient.original; IF sz.y=start.x-wireWidth AND (stop.ystart.y+wireWidth) THEN { --crazy vertical wire IF ABS[start.y-stop.y]=start.y AND stop.y<=start.y+wireWidth THEN { --horizontal wire stop.y _ start.y+wireWidth; AddARect[comm.design, CDBasics.ToRect[start, stop], comm.l] } ELSE { --L shaped (firsthorizontal) IF start.x<=stop.x THEN {stop.x _ stop.x+wireWidth} ELSE {t: CD.Number=stop.x; stop.x _ start.x; start.x _ t}; stop.y _ start.y+wireWidth; AddARect[comm.design, CDBasics.ToRect[start, stop], comm.l]; IF firstOnly THEN RETURN; start.x _ comm.pos.x; stop.y _ comm.pos.y; stop.x _ start.x+wireWidth; AddARect[comm.design, CDBasics.ToRect[start, stop], comm.l]; } } ELSE { -- NOT firstHorizontalVC -- IF stop.y<=start.y AND stop.y>=start.y-wireWidth AND (stop.xstart.x+wireWidth) THEN { --crazy horizontal wire IF ABS[stop.x-start.x]=start.x AND stop.x<=start.x+wireWidth THEN { --vertical wire stop.x _ start.x+wireWidth; AddARect[comm.design, CDBasics.ToRect[start, stop], comm.l] } ELSE { --L shaped (firstVertical) IF start.y<=stop.y THEN {stop.y _ stop.y+wireWidth} ELSE {t: CD.Number = stop.y; stop.y _ start.y; start.y _ t}; stop.x _ start.x+wireWidth; AddARect[comm.design, CDBasics.ToRect[start, stop], comm.l]; IF firstOnly THEN RETURN; start.y _ comm.pos.y; stop.y _ start.y+wireWidth; stop.x _ comm.pos.x; AddARect[comm.design, CDBasics.ToRect[start, stop], comm.l]; } } END; DeleteSelected: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["Delete selected "]; CDSimpleOps.DeleteSelected[comm.design]; TerminalIO.WriteLn[]; END; Undelete: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["Undelete\n"]; CDSimpleOps.Undelete[comm.design] END; AbortCommand: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["Try to abort current command\n"]; CDSequencer.AbortTheCommand[comm.design] END; CDSequencer.ImplementCommand[$AbortCommand, AbortCommand,, dontQueue]; CDSequencer.ImplementCommand[$DrawRect, AddRect]; CDSequencer.ImplementCommand[$DrawWire, AddWire]; CDSequencer.ImplementCommand[$ContinueWire, ContinueWire]; CDSequencer.ImplementCommand[$DeleteS, DeleteSelected]; CDSequencer.ImplementCommand[$Undel, Undelete]; END. ÂCDBasicCommands.mesa (part of ChipNDale) Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, June 29, 1983 4:44 pm last edited Christian Jacobi, April 17, 1985 11:46:17 am PST --uses pos, sPos, n (for width), b (for firstHorizontal), l (for layer) --this procedure knows EXACTLY the algorithm used for showing --temporary wires in the cursor part --not only crazy vertical -- not only crazy horizontal Ê蘚œ*™*Jšœ Ïmœ7™BJšœ,™,Jšœ=™=—J˜šÏk ˜ Jšžœ˜J˜ Jšœ ˜ J˜J˜ J˜J˜ J˜ J˜—šÏnœžœž˜JšžœB˜I—Jšž˜J˜š Ÿœžœ žœ žœžœ ˜CJšž˜Jšœžœ˜ Jšœžœ)˜/Jšœžœ!˜+šžœ žœ˜Jšœžœ˜Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ˜—Jšžœ žœ7žœ˜NJšœ˜˜J˜J˜J˜"Jšœ˜—Jšžœ˜J˜—J˜šŸœžœ˜+Jšž˜J˜$JšœD˜DJšžœ˜—J˜šŸœžœ˜+JšœG™GJšž˜Jšœ'žœ˜-Jšž˜—J˜šŸ œžœ˜0Jšž˜Jšœ'žœ˜,Jšžœ˜—J˜šŸœžœ(žœžœ˜JJšœ=™=Jšœ$™$Jšž˜Jšœžœ˜&Jšœžœ˜#Jšœ žœ˜$Jšžœ žœžœ˜,J˜$šžœÏcœžœ˜$šžœžœ˜0Jšžœžœžœ ˜Mšžœžœžœžœ˜&Jšœ2žœ˜:—Jšœ˜Jšœ<˜