//routesbholes.bcpl

// Board-specific Route extra-hole routines for the D0 Main Logic Board
// last modified by S Tom Chang, March 5, 1979 10:00 PM
// Remove extra holes and Drill Cable Holes only if called for

get "route.defs"

external [ Pin1of3W ]

static [ boardInterfaceVersion = interfaceVersion ]

let ComputeMWCoords(px, py, isMils) be
[
unless isMils do
[
@px = 25*@px
@py = 25*@py
]

let pxsave = @px
let pysave = @py
@px = 1500 + pysave
@py = 1000 + pxsave
]

and DescribeHoles(PrintAHole) be
[
manifest [ plated = true; unplated = not plated; isMils = true ]
manifest
[
socketHoleSize = 41 // mils, after plating & solder coat
extractHoleSize = 110 // mils, unplated
screwHoleSize = 120 // mils, unplated
]

let x,y = nil,nil
let forceDrilling = false

for x=0 to 412 do for y=0 to 500 do
if FindIndexFromCoord(x,y) gr 0 then
PrintAHole(x, y, socketHoleSize, plated, false, forceDrilling)

for grp=0 to 1 do for col = 0 to 1 do for pin=0 to 21 do // cable-pin holes
PrintAHole(2233+pin*109-col*57+grp*3645, -310+col*112, socketHoleSize, plated, isMils, forceDrilling)

for grp=0 to 1 do // extra cable holes
PrintAHole(4574+grp*3645, -198, socketHoleSize, plated, isMils, forceDrilling)

forceDrilling = true
for row=1 to 19 do for col=0 to 8 do // bypass capacitors
[
if Pin1of3W(row, col, lv x, lv y) then
[ if ((row ne 8)&(row ne 12))&(col ne 0) then
[ PrintAHole(x+4, y, socketHoleSize, plated, false, forceDrilling)
PrintAHole(x+4, y+12, socketHoleSize, plated, false, forceDrilling)
]
if ((row eq 8)%(row eq 12))&(col ne 3)&(col le 7) then
[ PrintAHole(x+4, y-4, socketHoleSize, plated, false, forceDrilling)
PrintAHole(x+4, y+8, socketHoleSize, plated, false, forceDrilling)
]
]
]

for grp = 0 to 1 do for col = 0 to 4 do for hole = 0 to 1 do // edge pins
PrintAHole(grp*220+col*40, 496+hole*4, socketHoleSize, plated, false, forceDrilling)

for col = 0 to 1 do for hole = 0 to 1 do // additional edge pin holes
PrintAHole(196+col*220, 496+hole*4, socketHoleSize, plated, false, forceDrilling) // check if this cause extra holes at E01 and E101????

for col=0 to 1 do for
row=2 to 19 do for hole = 0 to 1 do // power bus feed-thru holes
[ let ydis = row*24-12+(row ge 9?12,0)+(row ge 13?12,0)-(row eq 19?(8-hole*4),0)
if (row ne 8)&(row ne 12) then
PrintAHole(224+col*20, ydis+hole*4, socketHoleSize, plated, false, forceDrilling)
if (row eq 8)%(row eq 12) then
PrintAHole(224+col*20, (row eq 8?180,288)+hole*12, socketHoleSize, plated, false, forceDrilling)
]

for pin=0 to 1 do // filter capacitors holes
[ PrintAHole(4+pin*32, 486, socketHoleSize, plated, false, forceDrilling)
PrintAHole(168+pin*32, 486, socketHoleSize, plated, false, forceDrilling)
PrintAHole(244+pin*32, 486, socketHoleSize, plated, false, forceDrilling)
PrintAHole(380+pin*32, 486, socketHoleSize, plated, false, forceDrilling)
]

for grp=0 to 1 do for col=0 to 1 do // Bus Bar mounting holes
PrintAHole(234, 52+col*120+grp*284, screwHoleSize, unplated, false, forceDrilling)

for grp=0 to 1 do for col=0 to 1 do for pin=0 to 1 do // Cable mounting holes
[ PrintAHole(1901+grp*3651+col*1635+pin*1312, -585, screwHoleSize, unplated, isMils, forceDrilling)
]

for grp=0 to 1 do for pin=0 to 1 do // more Cable mounting holes
[ PrintAHole(2348+grp*5056+pin*648, -585, screwHoleSize, unplated, isMils, forceDrilling)
]

// holes for stiffener near the edge connectors
PrintAHole(20, 486, screwHoleSize, unplated, false, forceDrilling)
PrintAHole(144, 486, screwHoleSize, unplated, false, forceDrilling)
PrintAHole(288, 486, screwHoleSize, unplated, false, forceDrilling)
PrintAHole(396, 486, screwHoleSize, unplated, false, forceDrilling)

for col=0 to 1 do // extractor holes
PrintAHole(-50+col*10500, -650, extractHoleSize, unplated, isMils, forceDrilling)
]