C Program to print out coords of wires for specified cells/layers. common/cells/ncellstot(10) c cell count for prototype II c INTEGER NCELLS(10)/ 6,7,8,9,11,12,13,14,15,16/! for hex2 c cell count for 1/16 of chamber (+ 1 cell) INTEGER NCELLS(10)/ 7,8,9,10,12,13,14,15,16,17/! for hex2 c cell count for one quadrant c INTEGER NCELLS(10)/ 24,28,32,36,44,48,52,56,60,64/ c add one cell per layer so outer sense wires fall on both boundaries c INTEGER NCELLS(10)/ 25,29,33,37,45,49,53,57,61,65/ c cell count for entire chamber c INTEGER NCELLStot(10)/ 96,112,128,144,176,192,208,224,240,256/ INTEGER LAY1/1/, LAY2/40/ pi = 4.*atan(1.) c write header for AutoLISP program on unit 2 c also turn of screen echo of AutoLISP commands c define layers for different holes types write (2,10) 10 format ('(defun HEX2 ()' / . '(setvar "cmdecho" 0)' / ! turnoff command line echo . '(setvar "menuecho" 0)' / ! turn off menu echo . '(command "layer" "n" "sense" "")' / ! create layer for sense wire holes . '(command "layer" "n" "field" "")' / . '(command "layer" "n" "clear" "")' / . '(command "layer" "n" "blind" "")' ) c SUBROUTINE HEX2(IPRT,ZVIEW,ZORG,NCELLS,LYR1,LYR2,PHIAXIS,EDGE,FLIP) C C Generates wire coordinates for layers of hex2 cells in AUVAUV... geometry. C IPRT Print flag 0 for no printout, 1 for printout C ZVIEW Value of Z where coordinates are plotted C (but if ZVIEW is greater than ZCONE, then use ZCONE) C ZORG Value of Z where phi holes originate (+_ about PHIAXIS). C NCELLS Number of cells per layer C LYR1 Beginning layer number (0 to 40, 0 includes wall layer) C LYR2 Ending layer number (1 to 41, 41 includes wall layer) C If negative, then last enclosing layer is a hex2b zipper. C PHIAXIS Central phi angle at each layer (rad) c The program lines up the cells in all layers along angle PHIAXIS C EDGE Specifies how cell edges are trimmed (i.e. +-phi edge) C 0 - Trimmed symmetrically, with N,N-1,N,... cells/layer C 1 - Trimmed with equal cells/layer, N cells/layer C 2 - Trimmed with field wires on +phi edge only. C (allows meshing of cells over the 360 degree cut) C FLIP 0 - View is from +Z direction C 1 - " " " -Z " C Also, if FLIP is 1 and ZVIEW is very negative (< -zhalf), C then the holes for the rods supporting the electronics C are added. C C A. Boyarski 95/4/3 Original hex2. C " 96/2/20 Zippers: hex2b in 1 and 40, hex2 elsewhere. C " 96/2/28 Fix bug for zippers for edge=1 or 2. C " 96/3/1 Force cells to line up on back end plate. zlen = 2.764 zhalf = zlen/2. + .001 ! make zhalf slightly more than to plot standoffs c Prototype II = 1/16 of chamber CALL HEX2(1,-zhalf,-zhalf,NCELLS,LAY1,LAY2, pi/16.,0,1) c CALL HEX2(1,-zhalf,-zhalf,NCELLS,LAY1,LAY2, 1.57079633,0,0) c plot one quadrant, centered on 45 deg. c CALL HEX2 ( 1, ZVIEW, ZREF, NCELLS, LAY1, LAY2, pi/4., 0, 1) c CALL HEX2 ( 1,-zhalf,-zhalf, NCELLS, LAY1, LAY2, pi/4., 0, 0) c write AutoLISP trailer write (2,20) 20 format ( . '(command "menuecho" 0)' / ! turn menuecho back on . ')' ) END SUBROUTINE WOUT(IPRT,TYPE,R,A,D,V,*,Z,TWIST) CHARACTER*(*) TYPE character*1 wiretype(4) REAL R,A,D,V,Z,TWIST data wiretype / 'S', 'F', 'C', 'R' / C C WOUT is called from HEX4 at every wire coord. C IPRT is the print flag with which HEX4 was called. C TYPE is 'F' for field, 'S' for sense, 'C' for potential - wires c 'R' for standoffs C R is radius of point (meters) C A is the polar angle (radians) C D is diameter of wire (meters) C V is voltage on wire. C * is an alternate return to quit further generation by HEX4. C Z is the Z coord of the wire (min of ZVIEW or ZCONE) C TWIST is the half twist angle of point R,A,Z. C INTEGER N/0/ SAVE N c dummy lines to suppress compiler warnings temp = z temp = twist c IF(N.EQ.0.AND.IPRT.NE.0) WRITE(*,1) IF(N.EQ.0.AND.IPRT.NE.0) WRITE(1,1) 1 FORMAT(/,' TYPE NW R PHI ', > ' X Y D V') c IF(N.GE.10000) THEN cc WRITE(6,110) 10000 c WRITE(1,110) 10000 c 110 FORMAT(/,' TOO MANY WIRES, ONLY FIRST',I5,' KEPT') c RETURN 1 ! Alternate return to quit HEX4. c ENDIF N = N + 1 c IF(IPRT.NE.0) WRITE(*,40) TYPE,N,R,A,R*COS(A),R*SIN(A),D,V IF(IPRT.NE.0) WRITE(1,40) TYPE,N,R,A,R*COS(A),R*SIN(A),D,V 40 FORMAT(5X,A,I6,3P,F10.3,0P,F12.6,3P,2F10.3,6P,F10.1,0P,F10.0) c if (n .gt. 10) return 99 continue c write AutoLISP file on unit 2 c convert center and radius to mm x = R*cos(A)*1000. y = R*sin(A)*1000. c set AutoCAD layer type and radius of hole if (TYPE .eq. wiretype(1)) then c sense wires radius = 2.25 radius = 0.5 ! crimp pin radius write(2,101) 101 format ('(command "layer" "s" "sense" "")' ) elseif (TYPE .eq. wiretype(2)) then c field wires radius = 1.25 radius = 0.5 ! crimp pin radius write(2,102) 102 format ('(command "layer" "s" "field" "")' ) elseif (TYPE .eq. wiretype(3)) then c clearing wires radius = 1.25 radius = 0.5 ! crimp pin radius write(2,103) 103 format ('(command "layer" "s" "clear" "")' ) elseif (TYPE .eq. wiretype(4)) then c standoffs radius = 1.143 write(2,104) 104 format ('(command "layer" "s" "blind" "")' ) endif ! TYPE write(2,100) x, y, radius 100 format ( . ' (command "circle" (list ',f8.3,' ',f8.3') ',f8.3,')' . ) RETURN END