diff --git a/HEN_HOUSE/doc/src/pirs509a-beamnrc/inputformats/SYNCHDMLC.inp b/HEN_HOUSE/doc/src/pirs509a-beamnrc/inputformats/SYNCHDMLC.inp index 36676a7ae..07e9348d1 100644 --- a/HEN_HOUSE/doc/src/pirs509a-beamnrc/inputformats/SYNCHDMLC.inp +++ b/HEN_HOUSE/doc/src/pirs509a-beamnrc/inputformats/SYNCHDMLC.inp @@ -60,6 +60,10 @@ ZLEAF_$SYNCHDMLC(1)>=ZTIP_$SYNCHDMLC(1), etc. See the BEAM manual or GUI help for restrictions on widths. + Note: If there are no FULL leaves in your model, you can input + blanks, zeroes, or arbitrary floating-point numbers for these + cross section dimensions. + 6 LEAFWIDTH_$SYNCHDMLC(2), WTONGUE_$SYNCHDMLC(2), WGROOVE_$SYNCHDMLC(2), WTIP_$SYNCHDMLC(2), WRAILTOP_$SYNCHDMLC(2), WRAILBOT_$SYNCHDMLC(2), @@ -131,6 +135,9 @@ leaf on +X [ORIENT=0] or +Y [ORIENT=1] side of ISOCENTER leaf only) ZTONGUE_$SYNCHDMLC(1)<=ZGROOVE_$SYNCHDMLC(3) + Note: If there are no HALF leaf pairs in your model, you can input + blanks, zeroes, or arbitrary floating-point numbers for these + cross section dimensions. 8 LEAFWIDTH_$SYNCHDMLC(4), WTONGUE_$SYNCHDMLC(4), WGROOVE_$SYNCHDMLC(4), WTIP_$SYNCHDMLC(4), WRAILTOP_$SYNCHDMLC(4), WRAILBOT_$SYNCHDMLC(4), @@ -188,6 +195,10 @@ ZRAILTOP_$SYNCHDMLC(5): Z of top of support rail ZRAILBOT_$SYNCHDMLC(5): Z of bottom of support rail + Note: If there are no QUARTER leaves in your model, you can input + blanks, zeroes, or arbitrary floating-point numbers for these + cross section dimensions. + Repeat 10 NGROUP_$SYNCHDMLC times 10 NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE (2I5) @@ -263,7 +274,7 @@ If MODE_$SYNCHDMLC=1 or 2 (dynamic delivery or step-and-shoot delivery): - 14b mlc_file (A80) + 14b mlc_file (A256) mlc_file: The full name of the file containing leaf opening data. The format of the file contents is as follows: @@ -286,17 +297,17 @@ MLC_TITLE: A title line NFIELDS_$SYNCHDMLC: Total number of fields INDEX_$SYNCHDMLC(I): Index of field I. 0 <=INDEX_$SYNCHDMLC(I) <= 1 and - INDEX_$SYNCHDMLC(I) >= INDEX_$SYNCHDMLC(I-1). This + INDEX_$SYNCHDMLC(I) > INDEX_$SYNCHDMLC(I-1). This number is compared to a random number on (0,1) at the start of each history; if the random number is <= INDEX_$SYNCHDMLC(I), then field I is used. NEG_$SYNCHDMLC: Min. Y (ORIENT_$SYNCHDMLC=0) or - X (ORIENT_$SYNCHDMLC=1) + X (ORIENT_$SYNCHDMLC=1) of front opening in leaf (ie the opening at ZMIN_$SYNCHDMLC) if ENDTYPE=1, or of rounded end of leaf if ENDTYPE=0 for leaf J in field I. POS_$SYNCHDMLC: Max. Y (ORIENT_$SYNCHDMLC=0) or - X (ORIENT_$SYNCHDMLC=1) + X (ORIENT_$SYNCHDMLC=1) of front opening in leaf if ENDTYPE=1, or of rounded end of leaf if ENDTYPE=0 for leaf J in field I. @@ -359,7 +370,8 @@ ******* The following example defines a multi-leaf tungsten collimator design - based loosely on the TrueBeam high-definition mlc (HD120). + based loosely on the TrueBeam high-definition mlc (HD120) but using + all leaf types. Actual parameters are DIFFERENT - this serves just as a template. Do not attempt to use these parameters for a simulation of the real machine. diff --git a/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex b/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex index 8702ceed9..a51d84d91 100644 --- a/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex +++ b/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex @@ -6705,7 +6705,8 @@ \subsubsubsection{SYNCMLCE} \index{SYNCHDMLC} \subsubsubsection{SYNCHDMLC} SYNCHDMLC is a version of SYNCVMLC optimized for modeling the High-definition Multileaf -Collimator (HDMLC 120) available on TrueBeam and Novalis linacs. SYNCHDMLC features five +Collimator (HDMLC 120) and the Millenium MLC (120 MLC) available on TrueBeam and Novalis linacs. +SYNCHDMLC features five possible leaf cross sections: FULL, HALF TARGET/HALF ISOCENTER pairs, and QUARTER TARGET/QUARTER ISOCENTER pairs. FULL leaves are similar to FULL leaves in DYNVMLC/SYNCVMLC. HALF TARGET/HALF ISOCENTER leaves are equivalent to the TARGET/ISOCENTER leaves in DYNVMLC/SYNCVMLC. QUARTER TARGET/QUARTER ISOCENTER have the @@ -8331,12 +8332,15 @@ \subsubsection{SYNCHDMLC} \index{SYNCHDMLC} SYNCHDMLC is a CM coded by Lobo \& Popescu and based on an earlier code by Borges et al\cite{Bo12} for -modeling the high-definition micro mlc (HD120) available on TrueBeam and Novalis linacs. In overall +modeling the high-definition micro mlc (HD120) and the Millenium MLC (MLC 120) available on TrueBeam and Novalis linacs. In overall design it is similar to DYNVMLC/SYNCVMLC but features two different types of TARGET/ISOCENTER leaf pairs: HALF TARGET/HALF ISOCENTER and QUARTER TARGET/QUARTER ISOCENTER. In terms of leaf cross-section (perpendicular to the opening direction), these are similar to the TARGET/ISOCENTER leaves in DYNVMLC, with HALF TARGET/HALF ISOCENTER leaves being -wider than the QUARTER TARGET/QUARTER ISOCENTER leaves. +wider than the QUARTER TARGET/QUARTER ISOCENTER leaves. The five available leaf types are intended to facilitate +modeling of either the HD120 MLC (HALF TARGET/ISOCENTER and QUARTER TARGET/ISOCENTER leaves) or the MLC 120 +(FULL and HALF TARGET/ISOCENTER leaves). However, the user is free to use any combination of leaf types to model +their MLC, provided that TARGET/ISOCENTER leaves are always used in pairs. \begin{figure}[htpb] \begin{center} @@ -8353,7 +8357,7 @@ \subsubsection{SYNCHDMLC} \end{center} \vspace*{-1.0cm} \caption[SYNCHDMLC CM geometry] -{Example SYNCHDMLC with 12 leaves opening in the Y +{Example SYNCHDMLC using all leaf types with 12 leaves opening in the Y direction ({\tt ORIENT}=0). The X cross-sections of the five leaf types show the dimensions that the user must input (see Table~\ref{dynvmlc_tab} for label key). @@ -8396,10 +8400,9 @@ \subsubsection{SYNCHDMLC} of adjacent leaves all having the same type. Since HALF TARGET/HALF ISOCENTER leaves and QUARTER TARGET/QUARTER ISOCENTER leaves must always occur in pairs, there are really only three types to choose from. This also means there must be an even number of -HALF or QUARTER TARGET/ISOCENTER leaves. Also note that, even though the user -must specify cross-sections for all leaf types, they need not use all types -in a given MLC simulation. Thus, there may be no FULL leaves, HALF TARGET/ISOCENTER pairs, -or QUARTER TARGET/ISOCENTER pairs in the simulation. +HALF or QUARTER TARGET/ISOCENTER leaves. Also note that, even though an input line must +exist for all cross-sections, the values on this line can be blanks, zeroes, or nonsense real +numbers for leaves not being used in the MLC model. Similar to DYNVMLC and SYNCVMLC, leaf ends can be straight, focused ({\tt ENDTYPE}=1) or cylindrical ({\tt ENDTYPE}=0). For straight, focused ends, the user must specify the Z-position of the diff --git a/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran b/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran index 1bfa79d43..7dd1c5708 100644 --- a/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran +++ b/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran @@ -287,6 +287,10 @@ "I> ZLEAF_$SYNCHDMLC(1)>=ZTIP_$SYNCHDMLC(1), etc. See the BEAM "I> manual or GUI help for restrictions on widths. "I> +"I> Note: If there are no FULL leaves in your model, you can input +"I> blanks, zeroes, or arbitrary floating-point numbers for these +"I> cross section dimensions. +"I> "I> "I> 6 LEAFWIDTH_$SYNCHDMLC(2), WTONGUE_$SYNCHDMLC(2), WGROOVE_$SYNCHDMLC(2), "I> WTIP_$SYNCHDMLC(2), WRAILTOP_$SYNCHDMLC(2), WRAILBOT_$SYNCHDMLC(2), @@ -358,6 +362,10 @@ "I> leaf on +X [ORIENT=0] or +Y [ORIENT=1] side of ISOCENTER "I> leaf only) ZTONGUE_$SYNCHDMLC(1)<=ZGROOVE_$SYNCHDMLC(3) "I> +"I> Note: If there are no HALF leaf pairs in your model, you can input +"I> blanks, zeroes, or arbitrary floating-point numbers for these +"I> cross section dimensions. +"I> "I> "I> 8 LEAFWIDTH_$SYNCHDMLC(4), WTONGUE_$SYNCHDMLC(4), WGROOVE_$SYNCHDMLC(4), "I> WTIP_$SYNCHDMLC(4), WRAILTOP_$SYNCHDMLC(4), WRAILBOT_$SYNCHDMLC(4), @@ -415,6 +423,10 @@ "I> ZRAILTOP_$SYNCHDMLC(5): Z of top of support rail "I> ZRAILBOT_$SYNCHDMLC(5): Z of bottom of support rail "I> +"I> Note: If there are no QUARTER leaves in your model, you can input +"I> blanks, zeroes, or arbitrary floating-point numbers for these +"I> cross section dimensions. +"I> "I> Repeat 10 NGROUP_$SYNCHDMLC times "I> "I> 10 NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE (2I5) @@ -586,7 +598,8 @@ "I> ******* "I> "I> The following example defines a multi-leaf tungsten collimator design -"I> based loosely on the TrueBeam high-definition mlc (HD120). +"I> based loosely on the TrueBeam high-definition mlc (HD120) but using +"I> all leaf types. "I> Actual parameters are DIFFERENT - this serves just as a template. "I> Do not attempt to use these parameters for a simulation of the real "I> machine. @@ -606,16 +619,16 @@ "I> 1, 5, 2, ORIENT, NGROUP, MODE "I> 47.0, ZMIN "I> 7.0, ZTHICK -"I> 0.5, 0.04, 0.04, 0.135, 0.325, 0.123, 47, 47.5, 49.5, 50.7, 51.0, 51.3, -"I> 1.7, 52.5, 52.8, FULL leaf cross-section -"I> 0.25, 0.04, 0.04, 0.093, 0.132, 0.132, 47, 47.4, 49.1, 49.4, -"I> 1.7, 50.5, 50.5, 53.6, 53.7, HALF TARGET cross-section -"I> 0.25, 0.04, 0.04, 0.075, 0.124, 0.123, 47.2, 47.4, 50.52,50.521,51.7,52.1, -"I> 1.7, 53.6, 53.8, HALF ISOCENTER cross-section -"I> 0.11, 0.04, 0.04, 0.044, 0.074, 0.083, 47.1, 47.3, 47.9, 48.1, -"I> 1.7, 50.5, 50.5, 53.6, 53.7, QUARTER TARGET cross-section +"I> 0.5, 0.04, 0.04, 0.135, 0.325, 0.123, 47, 47.5, 49.5, 50.7, 51.0, 51.3, +"I> 1.7, 52.5, 52.8, FULL leaf cross-section +"I> 0.25, 0.04, 0.04, 0.093, 0.132, 0.132, 47, 47.4, 49.1, 49.4, 1.7, 50.5, +"I> 50.5, 53.6, 53.7, HALF TARGET cross-section +"I> 0.25, 0.04, 0.04, 0.075, 0.124, 0.123, 47.2, 47.4, 50.52, 50.521, 51.7, +"I> 52.1, 1.7, 53.6, 53.8, HALF ISOCENTER cross-section +"I> 0.11, 0.04, 0.04, 0.044, 0.074, 0.083, 47.1, 47.3, 47.9, 48.1, 1.7, 50.5, +"I> 50.5, 53.6, 53.7, QUARTER TARGET cross-section "I> 0.11, 0.04, 0.04, 0.035, 0.08, 0.065, 47.2, 47.3, 50.53, 50.52, 52.9, 53.1, -"I> 1.7, 53.6, 53.9, QUARTER ISOCENTER cross-section +"I> 1.7, 53.6, 53.9, QUARTER ISOCENTER cross-section "I> 10, 1, FULL leaves "I> 14, 2, HALF TARGET/ISOCENTER pairs "I> 32, 3, QUARTER TARGET/ISOCENTER pairs @@ -1115,7 +1128,10 @@ INTEGER I,J,K,L, "T>DO loop indices MIN_INDEX, "T>index of leaf with min. opening coordinate MAX_INDEX, "T>index of leaf with max. opening coordinate mlc_unit, "T>unit no. to assign mlc_file - egs_get_unit; "T>egs function used to assign unit to mlc_file + egs_get_unit, "T>egs function used to assign unit to mlc_file + NUM_FULL, "no. of FULL leaves" + NUM_HLF, "no. of HALF leaves" + NUM_QTR; "no. of QUARTER leaves" character*256 mlc_file; CHARACTER*80 MLC_TITLE; "T> title line in mlc_file $REAL INDEXTMP; "T>temporary input variable for field indices in dynamic and @@ -1254,47 +1270,212 @@ OUTPUT LEAFWIDTH_$SYNCHDMLC(1), WTONGUE_$SYNCHDMLC(1), WGROOVE_$SYNCHDMLC(1), HOLEPOS_FULL_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(1), ZRAILBOT_$SYNCHDMLC(1); (15F15.5); +OUTPUT; +(/' For HALF TARGET leaves input (all in cm, widths projected to ZMIN): '/ +' leaf width (excl. tongue), width of tongue, width of groove, width of'/ +' tip at top, width of top of support rail, width of bottom of support rail,'/ +' Z of top of support rail, Z of bottom of support rail, Z of top of driving'/ +' screw hole, Z of bottom of driving screw hole, distance of hole from leaf'/ +' tip, Z of bottom of tongue, Z of top of groove, Z of bottom of leaf, Z of'/ +' bottom of tip:'/); +MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(2), WTONGUE_$SYNCHDMLC(2), + WGROOVE_$SYNCHDMLC(2), WTIP_$SYNCHDMLC(2), WRAILTOP_$SYNCHDMLC(2), + WRAILBOT_$SYNCHDMLC(2), ZRAILTOP_$SYNCHDMLC(2), ZRAILBOT_$SYNCHDMLC(2), + ZHOLETOP_$SYNCHDMLC(2), ZHOLEBOT_$SYNCHDMLC(2), HOLEPOS_TAR_$SYNCHDMLC, + ZTONGUE_$SYNCHDMLC(2), ZGROOVE_$SYNCHDMLC(2), ZLEAF_$SYNCHDMLC(2), + ZTIP_$SYNCHDMLC(2); (15F15.0); +OUTPUT LEAFWIDTH_$SYNCHDMLC(2), WTONGUE_$SYNCHDMLC(2), WGROOVE_$SYNCHDMLC(2), + WTIP_$SYNCHDMLC(2), WRAILTOP_$SYNCHDMLC(2), WRAILBOT_$SYNCHDMLC(2), + ZRAILTOP_$SYNCHDMLC(2), ZRAILBOT_$SYNCHDMLC(2), ZHOLETOP_$SYNCHDMLC(2), + ZHOLEBOT_$SYNCHDMLC(2), HOLEPOS_TAR_$SYNCHDMLC, ZTONGUE_$SYNCHDMLC(2), + ZGROOVE_$SYNCHDMLC(2), ZLEAF_$SYNCHDMLC(2), ZTIP_$SYNCHDMLC(2); (15F15.5); + +OUTPUT; +(/' For HALF ISOCENTER leaves input (all in cm, widths projected to ZMIN): '/ +' leaf width (excl. tongue), width of tongue, width of groove, width of'/ +' tip at top, width of top of support rail, width of bottom of support rail,'/ +' Z of top of tip, Z of top of leaf, Z of top of tongue, Z of bottom of'/ +' groove, Z of top of driving screw hole, Z of bottom of driving screw hole,'/ +' distance of hole from leaf tip, Z of top of support rail, Z of bottom of'/ +' support rail:'/); +MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(3), WTONGUE_$SYNCHDMLC(3), + WGROOVE_$SYNCHDMLC(3), WTIP_$SYNCHDMLC(3),WRAILTOP_$SYNCHDMLC(3), + WRAILBOT_$SYNCHDMLC(3), ZTIP_$SYNCHDMLC(3), ZLEAF_$SYNCHDMLC(3), + ZTONGUE_$SYNCHDMLC(3),ZGROOVE_$SYNCHDMLC(3), ZHOLETOP_$SYNCHDMLC(3), + ZHOLEBOT_$SYNCHDMLC(3), HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(3), + ZRAILBOT_$SYNCHDMLC(3); (15F15.0); +OUTPUT LEAFWIDTH_$SYNCHDMLC(3), WTONGUE_$SYNCHDMLC(3), WGROOVE_$SYNCHDMLC(3), + WTIP_$SYNCHDMLC(3), WRAILTOP_$SYNCHDMLC(3), WRAILBOT_$SYNCHDMLC(3), + ZTIP_$SYNCHDMLC(3), ZLEAF_$SYNCHDMLC(3), ZTONGUE_$SYNCHDMLC(3), + ZGROOVE_$SYNCHDMLC(3), ZHOLETOP_$SYNCHDMLC(3), ZHOLEBOT_$SYNCHDMLC(3), + HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(3), ZRAILBOT_$SYNCHDMLC(3); + (15F15.5); + +OUTPUT; +(/' For QUARTER TARGET leaves input (all in cm, widths projected to ZMIN): '/ +' leaf width (excl. tongue), width of tongue, width of groove, width of'/ +' tip at top, width of top of support rail, width of bottom of support rail,'/ +' Z of top of support rail, Z of bottom of support rail, Z of top of driving'/ +' screw hole, Z of bottom of driving screw hole, distance of hole from leaf'/ +' tip, Z of bottom of tongue, Z of top of groove, Z of bottom of leaf, Z of'/ +' bottom of tip:'/); +MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(4), WTONGUE_$SYNCHDMLC(4), + WGROOVE_$SYNCHDMLC(4), WTIP_$SYNCHDMLC(4), WRAILTOP_$SYNCHDMLC(4), + WRAILBOT_$SYNCHDMLC(4), ZRAILTOP_$SYNCHDMLC(4), ZRAILBOT_$SYNCHDMLC(4), + ZHOLETOP_$SYNCHDMLC(4), ZHOLEBOT_$SYNCHDMLC(4), HOLEPOS_TAR_$SYNCHDMLC, + ZTONGUE_$SYNCHDMLC(4), ZGROOVE_$SYNCHDMLC(4), ZLEAF_$SYNCHDMLC(4), + ZTIP_$SYNCHDMLC(4); (15F15.0); +OUTPUT LEAFWIDTH_$SYNCHDMLC(4), WTONGUE_$SYNCHDMLC(4), WGROOVE_$SYNCHDMLC(4), + WTIP_$SYNCHDMLC(4), WRAILTOP_$SYNCHDMLC(4), WRAILBOT_$SYNCHDMLC(4), + ZRAILTOP_$SYNCHDMLC(4), ZRAILBOT_$SYNCHDMLC(4), ZHOLETOP_$SYNCHDMLC(4), + ZHOLEBOT_$SYNCHDMLC(4), HOLEPOS_TAR_$SYNCHDMLC, ZTONGUE_$SYNCHDMLC(4), + ZGROOVE_$SYNCHDMLC(4), ZLEAF_$SYNCHDMLC(4), ZTIP_$SYNCHDMLC(4); (15F15.5); + +OUTPUT; +(/'QUARTER ISOCENTER leaves input'/); +"OUTPUT; +"(/'For QUARTER ISOCENTER leaves input(all in cm, widths projected to ZMIN):'/ +"' leaf width (excl. tongue), width of tongue, width of groove, width of'/ +"' tip at top, width of top of support rail, width of bottom of support rail,'/ +"' Z of top of tip, Z of top of leaf, Z of top of tongue, Z of bottom of'/ +"' groove, Z of top of driving screw hole, Z of bottom of driving screw hole,'/ +"' distance of hole from leaf tip, Z of top of support rail, Z of bottom of'/ +"' support rail:'/); +MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(5), WTONGUE_$SYNCHDMLC(5), + WGROOVE_$SYNCHDMLC(5), WTIP_$SYNCHDMLC(5),WRAILTOP_$SYNCHDMLC(5), + WRAILBOT_$SYNCHDMLC(5), ZTIP_$SYNCHDMLC(5), ZLEAF_$SYNCHDMLC(5), + ZTONGUE_$SYNCHDMLC(5),ZGROOVE_$SYNCHDMLC(5), ZHOLETOP_$SYNCHDMLC(5), + ZHOLEBOT_$SYNCHDMLC(5), HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(5), + ZRAILBOT_$SYNCHDMLC(5); (15F15.0); +OUTPUT LEAFWIDTH_$SYNCHDMLC(5), WTONGUE_$SYNCHDMLC(5), WGROOVE_$SYNCHDMLC(5), + WTIP_$SYNCHDMLC(5), WRAILTOP_$SYNCHDMLC(5), WRAILBOT_$SYNCHDMLC(5), + ZTIP_$SYNCHDMLC(5), ZLEAF_$SYNCHDMLC(5), ZTONGUE_$SYNCHDMLC(5), + ZGROOVE_$SYNCHDMLC(5), ZHOLETOP_$SYNCHDMLC(5), ZHOLEBOT_$SYNCHDMLC(5), + HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(5), ZRAILBOT_$SYNCHDMLC(5); + (15F15.5); + +TOT_LEAF_$SYNCHDMLC=0; +K=0; +OUTPUT;(' '); +NUM_FULL=0; +NUM_HLF=0; +NUM_QTR=0; +DO I=1,NGROUP_$SYNCHDMLC [ + OUTPUT I; + (' Group ',I3,':'/ + ' No. of leaves, leaf type (1. FULL leaves--the default, '/ + ' 2. HALF TARGET/ISOCENTER pairs with TARGET leaf on -X or -Y side'/ + ' 3. QUARTER TARGET/ISOCENTER pairs with TARGET leaf on -X or -Y side)'/ + ' :',$); + MINPUT ($SYNCHDMLC) NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE; (2I5); + OUTPUT NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE; (2I5); + + + TOT_LEAF_$SYNCHDMLC=TOT_LEAF_$SYNCHDMLC+NUM_LEAF_$SYNCHDMLC(I); + + IF(LEAFTYPE<=0|LEAFTYPE>3)[ + LEAFTYPE=1; + OUTPUT ICM_$SYNCHDMLC,I; + (//' ***WARNING IN CM ',I3,' ($SYNCHDMLC)'/ + ' Leaf type for group ',I3,' not recognized.'/ + ' Will default to 1.'//); + ] + IF(MOD(NUM_LEAF_$SYNCHDMLC(I),2)~=0 & (LEAFTYPE=2 | + LEAFTYPE=3) )[ + OUTPUT ICM_$SYNCHDMLC,I; + (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/ + ' Leaf group ',I3,' consists of TARGET/ISOCENTER pairs but'/ + ' does not have an even number of leaves.'//); + IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] + "now set LEAFTYPE for each leaf" + DO J=1,NUM_LEAF_$SYNCHDMLC(I)[ + K=K+1; + IF(LEAFTYPE=1)[ + LEAFTYPE_$SYNCHDMLC(K)=1; + NUM_FULL=NUM_FULL+1; + ] + ELSEIF(LEAFTYPE=2)["half target/isocenter pair" + IF(MOD(J,2)~=0)["target leaf" + LEAFTYPE_$SYNCHDMLC(K)=2; + ] + ELSE[ + LEAFTYPE_$SYNCHDMLC(K)=3; + ] + NUM_HLF=NUM_HLF+1; + ] + ELSE ["quarter target/isocenter pair" + IF(MOD(J,2)~=0)["target leaf" + LEAFTYPE_$SYNCHDMLC(K)=4; + ] + ELSE[ + LEAFTYPE_$SYNCHDMLC(K)=5; + ] + NUM_QTR=NUM_QTR+1; + ] + ] +] +; +IF(TOT_LEAF_$SYNCHDMLC>$MAXLEAF) [ + TOT_LEAF_$SYNCHDMLC=$MAXLEAF; + OUTPUT ICM_$SYNCHDMLC,TOT_LEAF_$SYNCHDMLC; + (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/ + ' Total # of leaves > max allowed'/ + ' Total # of leaves reduced to ',I3,' for now'//); + IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] +; +IF(TOT_LEAF_$SYNCHDMLC<=0) [ + TOT_LEAF_$SYNCHDMLC=1; + OUTPUT ICM_$SYNCHDMLC,TOT_LEAF_$SYNCHDMLC; + (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/ + ' Total # of leaves <= 0'/ + ' Total # of leaves set to ',I3,' for now'//); + IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ]; + "now do checks on input dimensions" -IF(WGROOVE_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1))[ +IF(NUM_FULL>0)[ + IF(WGROOVE_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in FULL leaf definition:'/ ' WGROOVE_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1). Groove is too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WTIP_$SYNCHDMLC(1)LEAFWIDTH_$SYNCHDMLC(1)+WTONGUE_$SYNCHDMLC(1))[ + ] + IF(WTIP_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1)+WTONGUE_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in FULL leaf definition:'/ ' WTIP_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1)+WTONGUE_$SYNCHDMLC(1)'/ ' -WGROOVE_$SYNCHDMLC(1). Tip is too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1)-WGROOVE_$SYNCHDMLC(1))[ + ] + IF(WRAILTOP_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1)-WGROOVE_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in FULL leaf definition:'/ ' WRAILTOP_$SYNCHDMLC(1)>LEAFWIDTH_$SYNCHDMLC(1)+WGROOVE_$SYNCHDMLC(1).'/ ' Upper rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(1)WRAILTOP_$SYNCHDMLC(1))[ + ] + IF(WRAILBOT_$SYNCHDMLC(1)>WRAILTOP_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in FULL leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(1)>WRAILTOP_$SYNCHDMLC(1). Lower rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(1)-WRAILBOT_$SYNCHDMLC(1)< + ] + IF(WRAILTOP_$SYNCHDMLC(1)-WRAILBOT_$SYNCHDMLC(1)< WTIP_$SYNCHDMLC(1)-WTONGUE_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in FULL leaf definition:'/ @@ -1302,673 +1483,522 @@ IF(WRAILTOP_$SYNCHDMLC(1)-WRAILBOT_$SYNCHDMLC(1)< ' WTIP_$SYNCHDMLC(1)-WTONGUE_$SYNCHDMLC(1).'/ ' Lower rail too wide. Or tip too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(ZTIP_$SYNCHDMLC(1)ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ + ] + IF(ZRAILBOT_$SYNCHDMLC(1)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in FULL leaf definition:'/ ' ZRAILBOT_$SYNCHDMLC(1)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] ] -OUTPUT; -(/' For HALF TARGET leaves input (all in cm, widths projected to ZMIN): '/ -' leaf width (excl. tongue), width of tongue, width of groove, width of'/ -' tip at top, width of top of support rail, width of bottom of support rail,'/ -' Z of top of support rail, Z of bottom of support rail, Z of top of driving'/ -' screw hole, Z of bottom of driving screw hole, distance of hole from leaf'/ -' tip, Z of bottom of tongue, Z of top of groove, Z of bottom of leaf, Z of'/ -' bottom of tip:'/); -MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(2), WTONGUE_$SYNCHDMLC(2), - WGROOVE_$SYNCHDMLC(2), WTIP_$SYNCHDMLC(2), WRAILTOP_$SYNCHDMLC(2), - WRAILBOT_$SYNCHDMLC(2), ZRAILTOP_$SYNCHDMLC(2), ZRAILBOT_$SYNCHDMLC(2), - ZHOLETOP_$SYNCHDMLC(2), ZHOLEBOT_$SYNCHDMLC(2), HOLEPOS_TAR_$SYNCHDMLC, - ZTONGUE_$SYNCHDMLC(2), ZGROOVE_$SYNCHDMLC(2), ZLEAF_$SYNCHDMLC(2), - ZTIP_$SYNCHDMLC(2); (15F15.0); -OUTPUT LEAFWIDTH_$SYNCHDMLC(2), WTONGUE_$SYNCHDMLC(2), WGROOVE_$SYNCHDMLC(2), - WTIP_$SYNCHDMLC(2), WRAILTOP_$SYNCHDMLC(2), WRAILBOT_$SYNCHDMLC(2), - ZRAILTOP_$SYNCHDMLC(2), ZRAILBOT_$SYNCHDMLC(2), ZHOLETOP_$SYNCHDMLC(2), - ZHOLEBOT_$SYNCHDMLC(2), HOLEPOS_TAR_$SYNCHDMLC, ZTONGUE_$SYNCHDMLC(2), - ZGROOVE_$SYNCHDMLC(2), ZLEAF_$SYNCHDMLC(2), ZTIP_$SYNCHDMLC(2); (15F15.5); - +IF(NUM_HLF>0) [ +"do checks on input dimensions for HALF leaves" "check input dimensions" -IF(WGROOVE_$SYNCHDMLC(2)>LEAFWIDTH_$SYNCHDMLC(2))[ + IF(WGROOVE_$SYNCHDMLC(2)>LEAFWIDTH_$SYNCHDMLC(2))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF TARGET leaf definition:'/ ' WGROOVE_$SYNCHDMLC(2)>LEAFWIDTH_$SYNCHDMLC(2). Groove too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] + ] -IF(WRAILBOT_$SYNCHDMLC(2)>LEAFWIDTH_$SYNCHDMLC(2))[ + IF(WRAILBOT_$SYNCHDMLC(2)>LEAFWIDTH_$SYNCHDMLC(2))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF TARGET leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(2)>LEAFWIDTH_$SYNCHDMLC(2). Lower rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILBOT_$SYNCHDMLC(2) WGROOVE_$SYNCHDMLC(2)+WTIP_$SYNCHDMLC(2))[ + ] + IF(WRAILBOT_$SYNCHDMLC(2) > WGROOVE_$SYNCHDMLC(2)+WTIP_$SYNCHDMLC(2))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF TARGET leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(2) > WGROOVE_$SYNCHDMLC(2)+WTIP_$SYNCHDMLC(2).'/ ' Lower rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(2)>WRAILBOT_$SYNCHDMLC(2))[ + ] + IF(WRAILTOP_$SYNCHDMLC(2)>WRAILBOT_$SYNCHDMLC(2))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF TARGET leaf definition:'/ ' WRAILTOP_$SYNCHDMLC(2)>WRAILBOT_$SYNCHDMLC(2). Top rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(2)ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ - OUTPUT ICM_$SYNCHDMLC; - (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF TARGET leaf definition:'/ - ' ZTIP_$SYNCHDMLC(2)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC.'//); - IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] - - -OUTPUT; -(/' For HALF ISOCENTER leaves input (all in cm, widths projected to ZMIN): '/ -' leaf width (excl. tongue), width of tongue, width of groove, width of'/ -' tip at top, width of top of support rail, width of bottom of support rail,'/ -' Z of top of tip, Z of top of leaf, Z of top of tongue, Z of bottom of'/ -' groove, Z of top of driving screw hole, Z of bottom of driving screw hole,'/ -' distance of hole from leaf tip, Z of top of support rail, Z of bottom of'/ -' support rail:'/); -MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(3), WTONGUE_$SYNCHDMLC(3), - WGROOVE_$SYNCHDMLC(3), WTIP_$SYNCHDMLC(3),WRAILTOP_$SYNCHDMLC(3), - WRAILBOT_$SYNCHDMLC(3), ZTIP_$SYNCHDMLC(3), ZLEAF_$SYNCHDMLC(3), - ZTONGUE_$SYNCHDMLC(3),ZGROOVE_$SYNCHDMLC(3), ZHOLETOP_$SYNCHDMLC(3), - ZHOLEBOT_$SYNCHDMLC(3), HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(3), - ZRAILBOT_$SYNCHDMLC(3); (15F15.0); -OUTPUT LEAFWIDTH_$SYNCHDMLC(3), WTONGUE_$SYNCHDMLC(3), WGROOVE_$SYNCHDMLC(3), - WTIP_$SYNCHDMLC(3), WRAILTOP_$SYNCHDMLC(3), WRAILBOT_$SYNCHDMLC(3), - ZTIP_$SYNCHDMLC(3), ZLEAF_$SYNCHDMLC(3), ZTONGUE_$SYNCHDMLC(3), - ZGROOVE_$SYNCHDMLC(3), ZHOLETOP_$SYNCHDMLC(3), ZHOLEBOT_$SYNCHDMLC(3), - HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(3), ZRAILBOT_$SYNCHDMLC(3); - (15F15.5); - + ] + IF(ZTIP_$SYNCHDMLC(2)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ + OUTPUT ICM_$SYNCHDMLC; + (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF TARGET leaf definition:'/ + ' ZTIP_$SYNCHDMLC(2)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC.'//); + IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] "now do checks on input dimensions" -IF(WGROOVE_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3))[ + IF(WGROOVE_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF ISO leaf definition:'/ ' WGROOVE_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3). Groove too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WTIP_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3)-WGROOVE_$SYNCHDMLC(3))[ + ] + IF(WTIP_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3)-WGROOVE_$SYNCHDMLC(3))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF ISO leaf definition:'/ ' WTIP_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3)-WGROOVE_$SYNCHDMLC(3).'/ ' Tip too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3)+WTONGUE_$SYNCHDMLC(3)- + ] + IF(WRAILTOP_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3)+WTONGUE_$SYNCHDMLC(3)- WGROOVE_$SYNCHDMLC(3))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF ISO leaf definition:'/ ' WRAILTOP_$SYNCHDMLC(3)>LEAFWIDTH_$SYNCHDMLC(3)+WTONGUE_$SYNCHDMLC(3)-'/ ' WGROOVE_$SYNCHDMLC(3). Top of rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(3)WRAILTOP_$SYNCHDMLC(3))[ + ] + IF(WRAILBOT_$SYNCHDMLC(3)>WRAILTOP_$SYNCHDMLC(3))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF ISO leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(3)>WRAILTOP_$SYNCHDMLC(3). Bottom of rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILBOT_$SYNCHDMLC(3)ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ + ] + IF(ZRAILBOT_$SYNCHDMLC(3)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in HALF ISO leaf definition:'/ ' ZRAILBOT_$SYNCHDMLC(3)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] + + "now check dimensions between HALF leaves" + IF(ZTONGUE_$SYNCHDMLC(3)<=ZGROOVE_$SYNCHDMLC(2))[ + OUTPUT ICM_$SYNCHDMLC; + (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ + ' ZTONGUE_$SYNCHDMLC(3)<=ZGROOVE_$SYNCHDMLC(2).'/ + ' HALF ISOCENTER/TARGET leaves will not fit together.'//); + IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] + IF(ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(3))[ + OUTPUT ICM_$SYNCHDMLC; + (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ + ' ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(3).'/ + ' HALF ISOCENTER/TARGET leaves will not fit together.'//); + IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] + ] -OUTPUT; -(/' For QUARTER TARGET leaves input (all in cm, widths projected to ZMIN): '/ -' leaf width (excl. tongue), width of tongue, width of groove, width of'/ -' tip at top, width of top of support rail, width of bottom of support rail,'/ -' Z of top of support rail, Z of bottom of support rail, Z of top of driving'/ -' screw hole, Z of bottom of driving screw hole, distance of hole from leaf'/ -' tip, Z of bottom of tongue, Z of top of groove, Z of bottom of leaf, Z of'/ -' bottom of tip:'/); -MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(4), WTONGUE_$SYNCHDMLC(4), - WGROOVE_$SYNCHDMLC(4), WTIP_$SYNCHDMLC(4), WRAILTOP_$SYNCHDMLC(4), - WRAILBOT_$SYNCHDMLC(4), ZRAILTOP_$SYNCHDMLC(4), ZRAILBOT_$SYNCHDMLC(4), - ZHOLETOP_$SYNCHDMLC(4), ZHOLEBOT_$SYNCHDMLC(4), HOLEPOS_TAR_$SYNCHDMLC, - ZTONGUE_$SYNCHDMLC(4), ZGROOVE_$SYNCHDMLC(4), ZLEAF_$SYNCHDMLC(4), - ZTIP_$SYNCHDMLC(4); (15F15.0); -OUTPUT LEAFWIDTH_$SYNCHDMLC(4), WTONGUE_$SYNCHDMLC(4), WGROOVE_$SYNCHDMLC(4), - WTIP_$SYNCHDMLC(4), WRAILTOP_$SYNCHDMLC(4), WRAILBOT_$SYNCHDMLC(4), - ZRAILTOP_$SYNCHDMLC(4), ZRAILBOT_$SYNCHDMLC(4), ZHOLETOP_$SYNCHDMLC(4), - ZHOLEBOT_$SYNCHDMLC(4), HOLEPOS_TAR_$SYNCHDMLC, ZTONGUE_$SYNCHDMLC(4), - ZGROOVE_$SYNCHDMLC(4), ZLEAF_$SYNCHDMLC(4), ZTIP_$SYNCHDMLC(4); (15F15.5); -"check input dimensions" -IF(WGROOVE_$SYNCHDMLC(4)>LEAFWIDTH_$SYNCHDMLC(4))[ +IF(NUM_QTR>0) [ +"check input dimensions for QUARTER leaves" + IF(WGROOVE_$SYNCHDMLC(4)>LEAFWIDTH_$SYNCHDMLC(4))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in QTR TARGET leaf definition:'/ ' WGROOVE_$SYNCHDMLC(4)>LEAFWIDTH_$SYNCHDMLC(4). Groove too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] + ] -IF(WRAILBOT_$SYNCHDMLC(4)>LEAFWIDTH_$SYNCHDMLC(4))[ + IF(WRAILBOT_$SYNCHDMLC(4)>LEAFWIDTH_$SYNCHDMLC(4))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in QTR TARGET leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(4)>LEAFWIDTH_$SYNCHDMLC(4). Lower rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILBOT_$SYNCHDMLC(4)WGROOVE_$SYNCHDMLC(4)+WTIP_$SYNCHDMLC(4))[ + ] + IF(WRAILBOT_$SYNCHDMLC(4)>WGROOVE_$SYNCHDMLC(4)+WTIP_$SYNCHDMLC(4))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in QTR TARGET leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(4)>WGROOVE_$SYNCHDMLC(4)+WTIP_$SYNCHDMLC(4).'/ ' Lower rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(4)>WRAILBOT_$SYNCHDMLC(4))[ + ] + IF(WRAILTOP_$SYNCHDMLC(4)>WRAILBOT_$SYNCHDMLC(4))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in QTR TARGET leaf definition:'/ ' WRAILTOP_$SYNCHDMLC(4)>WRAILBOT_$SYNCHDMLC(4). Top rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(4)ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ + ] + IF(ZTIP_$SYNCHDMLC(4)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in QTR TARGET leaf definition:'/ ' ZTIP_$SYNCHDMLC(4)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] - -OUTPUT; -(/'QUARTER ISOCENTER leaves input'/); -"OUTPUT; -"(/'For QUARTER ISOCENTER leaves input(all in cm, widths projected to ZMIN):'/ -"' leaf width (excl. tongue), width of tongue, width of groove, width of'/ -"' tip at top, width of top of support rail, width of bottom of support rail,'/ -"' Z of top of tip, Z of top of leaf, Z of top of tongue, Z of bottom of'/ -"' groove, Z of top of driving screw hole, Z of bottom of driving screw hole,'/ -"' distance of hole from leaf tip, Z of top of support rail, Z of bottom of'/ -"' support rail:'/); -MINPUT ($SYNCHDMLC) LEAFWIDTH_$SYNCHDMLC(5), WTONGUE_$SYNCHDMLC(5), - WGROOVE_$SYNCHDMLC(5), WTIP_$SYNCHDMLC(5),WRAILTOP_$SYNCHDMLC(5), - WRAILBOT_$SYNCHDMLC(5), ZTIP_$SYNCHDMLC(5), ZLEAF_$SYNCHDMLC(5), - ZTONGUE_$SYNCHDMLC(5),ZGROOVE_$SYNCHDMLC(5), ZHOLETOP_$SYNCHDMLC(5), - ZHOLEBOT_$SYNCHDMLC(5), HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(5), - ZRAILBOT_$SYNCHDMLC(5); (15F15.0); -OUTPUT LEAFWIDTH_$SYNCHDMLC(5), WTONGUE_$SYNCHDMLC(5), WGROOVE_$SYNCHDMLC(5), - WTIP_$SYNCHDMLC(5), WRAILTOP_$SYNCHDMLC(5), WRAILBOT_$SYNCHDMLC(5), - ZTIP_$SYNCHDMLC(5), ZLEAF_$SYNCHDMLC(5), ZTONGUE_$SYNCHDMLC(5), - ZGROOVE_$SYNCHDMLC(5), ZHOLETOP_$SYNCHDMLC(5), ZHOLEBOT_$SYNCHDMLC(5), - HOLEPOS_ISO_$SYNCHDMLC, ZRAILTOP_$SYNCHDMLC(5), ZRAILBOT_$SYNCHDMLC(5); - (15F15.5); + ] -"now do checks on input dimensions" -IF(WGROOVE_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5))[ + IF(WGROOVE_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' WGROOVE_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5). Groove too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WTIP_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5)-WGROOVE_$SYNCHDMLC(5))[ + ] + IF(WTIP_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5)-WGROOVE_$SYNCHDMLC(5))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' WTIP_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5)-WGROOVE_$SYNCHDMLC(5).'/ ' Tip too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5)+WTONGUE_$SYNCHDMLC(5)- + ] + IF(WRAILTOP_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5)+WTONGUE_$SYNCHDMLC(5)- WGROOVE_$SYNCHDMLC(5))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' WRAILTOP_$SYNCHDMLC(5)>LEAFWIDTH_$SYNCHDMLC(5)+WTONGUE_$SYNCHDMLC(5)-'/ ' WGROOVE_$SYNCHDMLC(5). Top of rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILTOP_$SYNCHDMLC(5)WRAILTOP_$SYNCHDMLC(5))[ + ] + IF(WRAILBOT_$SYNCHDMLC(5)>WRAILTOP_$SYNCHDMLC(5))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(5)>WRAILTOP_$SYNCHDMLC(5). Bottom of rail too wide.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(WRAILBOT_$SYNCHDMLC(5)ZTONGUE_$SYNCHDMLC(5))[ + ] + IF(ZGROOVE_$SYNCHDMLC(5)>ZTONGUE_$SYNCHDMLC(5))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' ZGROOVE_$SYNCHDMLC(5)>ZTONGUE_$SYNCHDMLC(5).'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(ZHOLETOP_$SYNCHDMLC(5)ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ + ] + IF(ZRAILBOT_$SYNCHDMLC(5)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' ZRAILBOT_$SYNCHDMLC(5)>ZMIN_$SYNCHDMLC+ZTHICK_$SYNCHDMLC.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] - - -"now check dimensions between leaf types" -IF(ZTONGUE_$SYNCHDMLC(3)<=ZGROOVE_$SYNCHDMLC(2))[ + ] + "between quarter leaves" + IF(ZTONGUE_$SYNCHDMLC(5)<=ZGROOVE_$SYNCHDMLC(4))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ - ' ZTONGUE_$SYNCHDMLC(3)<=ZGROOVE_$SYNCHDMLC(2).'/ - ' ISOCENTER/TARGET leaves will not fit together.'//); + ' ZTONGUE_$SYNCHDMLC(5)<=ZGROOVE_$SYNCHDMLC(4).'/ + ' QTR ISOCENTER/TARGET leaves will not fit together.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(3))[ + ] + IF(ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(5))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ - ' ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(3).'/ - ' ISOCENTER/TARGET leaves will not fit together.'//); + ' ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(5).'/ + ' QTR ISOCENTER/TARGET leaves will not fit together.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] ] -IF(ZGROOVE_$SYNCHDMLC(3)<=ZTONGUE_$SYNCHDMLC(1))[ + +IF(NUM_HLF>0 & NUM_FULL>0) [ + IF(ZGROOVE_$SYNCHDMLC(3)<=ZTONGUE_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ ' ZGROOVE_$SYNCHDMLC(3)<=ZTONGUE_$SYNCHDMLC(1).'/ - ' ISOCENTER leaf will not fit with'/ + ' HALF ISOCENTER leaf will not fit with'/ ' FULL leaf if ISOCENTER leaf is on -X or -Y side.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(1))[ + ] + IF(ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(1))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ ' ZTONGUE_$SYNCHDMLC(2)>=ZGROOVE_$SYNCHDMLC(1).'/ - ' TARGET leaf will not fit with'/ + ' HALF TARGET leaf will not fit with'/ ' FULL leaf if FULL leaf is on -X or -Y side.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; + ] ] -"between quarter leaves" -IF(ZTONGUE_$SYNCHDMLC(5)<=ZGROOVE_$SYNCHDMLC(4))[ - OUTPUT ICM_$SYNCHDMLC; - (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ - ' ZTONGUE_$SYNCHDMLC(5)<=ZGROOVE_$SYNCHDMLC(4).'/ - ' QTR ISOCENTER/TARGET leaves will not fit together.'//); - IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] -IF(ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(5))[ - OUTPUT ICM_$SYNCHDMLC; - (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ - ' ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(5).'/ - ' QTR ISOCENTER/TARGET leaves will not fit together.'//); - IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] - -"between half and quarter leaves" -IF(ZGROOVE_$SYNCHDMLC(5)<=ZTONGUE_$SYNCHDMLC(2))[ +IF(NUM_HLF>0 & NUM_QTR>0) [ + IF(ZGROOVE_$SYNCHDMLC(5)<=ZTONGUE_$SYNCHDMLC(2))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ ' ZGROOVE_$SYNCHDMLC(5)<=ZTONGUE_$SYNCHDMLC(2).'/ ' QUARTER ISOCENTER leaf will not fit with'/ ' HALF TARGET leaf if ISOCENTER leaf is on -X or -Y side.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] + ] -IF(ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(3))[ + IF(ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(3))[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC) in leaf definition:'/ ' ZTONGUE_$SYNCHDMLC(4)>=ZGROOVE_$SYNCHDMLC(3).'/ ' QUARTER TARGET leaf will not fit with'/ ' HALF ISO leaf if FULL leaf is on -X or -Y side.'//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; -] - -TOT_LEAF_$SYNCHDMLC=0; -K=0; -OUTPUT;(' '); -DO I=1,NGROUP_$SYNCHDMLC [ - OUTPUT I; - (' Group ',I3,':'/ - ' No. of leaves, leaf type (1. FULL leaves--the default, '/ - ' 2. HALF TARGET/ISOCENTER pairs with TARGET leaf on -X or -Y side'/ - ' 3. QUARTER TARGET/ISOCENTER pairs with TARGET leaf on -X or -Y side)'/ - ' :',$); - MINPUT ($SYNCHDMLC) NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE; (2I5); - OUTPUT NUM_LEAF_$SYNCHDMLC(I), LEAFTYPE; (2I5); - - - TOT_LEAF_$SYNCHDMLC=TOT_LEAF_$SYNCHDMLC+NUM_LEAF_$SYNCHDMLC(I); - - IF(LEAFTYPE<=0|LEAFTYPE>3)[ - LEAFTYPE=1; - OUTPUT ICM_$SYNCHDMLC,I; - (//' ***WARNING IN CM ',I3,' ($SYNCHDMLC)'/ - ' Leaf type for group ',I3,' not recognized.'/ - ' Will default to 1.'//); - ] - IF(MOD(NUM_LEAF_$SYNCHDMLC(I),2)~=0 & (LEAFTYPE=2 | - LEAFTYPE=3) )[ - OUTPUT ICM_$SYNCHDMLC,I; - (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/ - ' Leaf group ',I3,' consists of TARGET/ISOCENTER pairs but'/ - ' does not have an even number of leaves.'//); - IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; - ] - "now set LEAFTYPE for each leaf" - DO J=1,NUM_LEAF_$SYNCHDMLC(I)[ - K=K+1; - IF(LEAFTYPE=1)[ - LEAFTYPE_$SYNCHDMLC(K)=1; - ] - ELSEIF(LEAFTYPE=2)["half target/isocenter pair" - IF(MOD(J,2)~=0)["target leaf" - LEAFTYPE_$SYNCHDMLC(K)=2; - ] - ELSE[ - LEAFTYPE_$SYNCHDMLC(K)=3; - ] - ] - ELSE ["quarter target/isocenter pair" - IF(MOD(J,2)~=0)["target leaf" - LEAFTYPE_$SYNCHDMLC(K)=4; - ] - ELSE[ - LEAFTYPE_$SYNCHDMLC(K)=5; - ] - ] ] ] -; -IF(TOT_LEAF_$SYNCHDMLC>$MAXLEAF) [ - TOT_LEAF_$SYNCHDMLC=$MAXLEAF; - OUTPUT ICM_$SYNCHDMLC,TOT_LEAF_$SYNCHDMLC; - (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/ - ' Total # of leaves > max allowed'/ - ' Total # of leaves reduced to ',I3,' for now'//); - IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; - ] -; -IF(TOT_LEAF_$SYNCHDMLC<=0) [ - TOT_LEAF_$SYNCHDMLC=1; - OUTPUT ICM_$SYNCHDMLC,TOT_LEAF_$SYNCHDMLC; - (//' ***ERROR IN CM ',I3,' ($SYNCHDMLC)'/ - ' Total # of leaves <= 0'/ - ' Total # of leaves set to ',I3,' for now'//); - IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; - ]; " III. START POSITION OF LEAVES" " =============================" @@ -2004,7 +2034,7 @@ IF (LEAFGAP_$SYNCHDMLC<0.0) [ ]; "Check that there are no unblocked areas between adjacent leaves" -IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(1))[ +IF(NUM_FULL>0 & LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(1))[ LEAFGAP_$SYNCHDMLC = WTONGUE_$SYNCHDMLC(1); OUTPUT ICM_$SYNCHDMLC; (//'**ERROR IN CM ',I4,' ($SYNCHDMLC)'/ @@ -2012,7 +2042,7 @@ IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(1))[ ' Reset to be equal to the width of the tongue. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(3))[ +IF(NUM_HLF>0 & LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(3))[ LEAFGAP_$SYNCHDMLC = WTONGUE_$SYNCHDMLC(3); OUTPUT ICM_$SYNCHDMLC; (//'**ERROR IN CM ',I4,' ($SYNCHDMLC)'/ @@ -2020,7 +2050,7 @@ IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(3))[ ' Reset to be equal to the width of the tongue. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(2))[ +IF(NUM_HLF>0 & LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(2))[ LEAFGAP_$SYNCHDMLC = WTONGUE_$SYNCHDMLC(2); OUTPUT ICM_$SYNCHDMLC; (//'**ERROR IN CM ',I4,' ($SYNCHDMLC)'/ @@ -2028,7 +2058,7 @@ IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(2))[ ' Reset to be equal to the width of the tongue. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(4))[ +IF(NUM_QTR>0 & LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(4))[ LEAFGAP_$SYNCHDMLC = WTONGUE_$SYNCHDMLC(4); OUTPUT ICM_$SYNCHDMLC; (//'**ERROR IN CM ',I4,' ($SYNCHDMLC)'/ @@ -2036,7 +2066,7 @@ IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(4))[ ' Reset to be equal to the width of the tongue. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(5))[ +IF(NUM_QTR>0 & LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(5))[ LEAFGAP_$SYNCHDMLC = WTONGUE_$SYNCHDMLC(5); OUTPUT ICM_$SYNCHDMLC; (//'**ERROR IN CM ',I4,' ($SYNCHDMLC)'/ @@ -2046,43 +2076,50 @@ IF(LEAFGAP_$SYNCHDMLC>WTONGUE_$SYNCHDMLC(5))[ ] "check leaf gap between adjacent tongue and groove" -IF(WGROOVE_$SYNCHDMLC(1)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(1)<0.0)[ +IF(NUM_FULL > 0 & + WGROOVE_$SYNCHDMLC(1)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(1)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ ' Tongue in FULL leaf too wide for groove in FULL leaf. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(WGROOVE_$SYNCHDMLC(2)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(3)<0.0)[ +IF(NUM_HLF > 0 & + WGROOVE_$SYNCHDMLC(2)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(3)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ - ' Tongue in ISOCENTER leaf too wide for groove in TARGET leaf. '//); + ' Tongue in HALF ISOCENTER leaf too wide for groove in TARGET leaf. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(WGROOVE_$SYNCHDMLC(1)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(2)<0.0)[ +IF(NUM_FULL > 0 & NUM_HLF > 0 & +WGROOVE_$SYNCHDMLC(1)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(2)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ - ' Tongue in TARGET leaf too wide for groove in FULL leaf. '//); + ' Tongue in HALF TARGET leaf too wide for groove in FULL leaf. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(WGROOVE_$SYNCHDMLC(3)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(1)<0.0)[ +IF(NUM_FULL > 0 & NUM_HLF > 0 & + WGROOVE_$SYNCHDMLC(3)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(1)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ - ' Tongue in FULL leaf too wide for groove in ISOCENTER leaf. '//); + ' Tongue in FULL leaf too wide for groove in HALF ISOCENTER leaf. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(WGROOVE_$SYNCHDMLC(4)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(5)<0.0)[ +IF(NUM_QTR > 0 & + WGROOVE_$SYNCHDMLC(4)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(5)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ ' Tongue in QTR ISO leaf too wide for groove in QTR TARGET leaf. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(WGROOVE_$SYNCHDMLC(3)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(4)<0.0)[ +IF(NUM_HLF > 0 & NUM_QTR > 0 & + WGROOVE_$SYNCHDMLC(3)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(4)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ ' Tongue in QTR TARGET leaf too wide for groove in HALF ISO leaf. '//); IERR_GEOM(ICM_$SYNCHDMLC)=IERR_GEOM(ICM_$SYNCHDMLC)+1; ] -IF(WGROOVE_$SYNCHDMLC(5)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(2)<0.0)[ +IF(NUM_HLF > 0 & NUM_QTR > 0 & + WGROOVE_$SYNCHDMLC(5)+LEAFGAP_$SYNCHDMLC-WTONGUE_$SYNCHDMLC(2)<0.0)[ OUTPUT ICM_$SYNCHDMLC; (//' ***ERROR IN CM ',I4,' ($SYNCHDMLC)'/ ' Tongue in HALF TARGET leaf too wide for groove in QTR ISO leaf. '//); @@ -3912,5 +3949,3 @@ RETURN; END; "End of subroutine HOWNEAR_$SYNCHDMLC" "************************************************************************" "End of SYNCHDMLC_cm.mortran" - - diff --git a/HEN_HOUSE/omega/progs/gui/beamnrc/beamnrc_params.tcl b/HEN_HOUSE/omega/progs/gui/beamnrc/beamnrc_params.tcl index 5b5d1ac62..2fbceadb6 100644 --- a/HEN_HOUSE/omega/progs/gui/beamnrc/beamnrc_params.tcl +++ b/HEN_HOUSE/omega/progs/gui/beamnrc/beamnrc_params.tcl @@ -2461,22 +2461,23 @@ See the BEAMnrc and DOSXYZnrc Users Manuals for more info.\ set help_synchdmlc_text { SYNCHDMLC is optimized for simulating\ -the high-definition micro MLC (HD120) available on TrueBeam and Novalis\ +the high-definition micro MLC (HD120) as well as the Millenium MLC (120 MLC) available on TrueBeam and Novalis\ linacs. The original code was contributed by Borges et al, while the current\ version is from Lobo & Popescu. SYNCHDMLC is based on SYNCVMLC. -The user must specify cross-sections for five leaf types:\ -FULL, HALF TARGET, HALF ISOCENTER, QUARTER TARGET, QUARTER ISOCENTER. In general QUARTER TARGET/ISOCENTER\ -leaves are thinner in the X-dimension\ - (ORIENT=0) or Y-dimension (ORIENT=1). HALF TARGET/ISOCENTER leaves \ +The user has the option to specify cross-sections for five leaf types:\ +FULL, HALF TARGET, HALF ISOCENTER, QUARTER TARGET, QUARTER ISOCENTER. The geometry of each type\ +has been defined so that the HD120 MLC can be simulated using QUARTER TARGET\ISOCENTER\ +and HALF TARGET/ISOCENTER leaves and the 120 MLC can be simulated with\ +HALF TARGET/ISOCENTER and FULL leaves. The cross-sections dimensions of unused leaf\ +types can be left as blanks, zeroes or nonsense real numbers (although the input line\ +must exist in the .egsinp file). Note that HALF TARGET/ISOCENTER leaves \ and QUARTER TARGET/ISOCENTER leaves must be specified in pairs. -The figure at left shows a SYNCHDMLC with 12 leaves opening in the Y-direction (ORIENT=0).\ +The figure at left shows a SYNCHDMLC with 12 leaves opening in the Y-direction (ORIENT=0) using\ +all leaf types.\ Leaves 1,2,11,12 are FULL; leaves 3,4,9,10 are HALF TARGET/ISOCENTER pairs; leaves 5-9 are\ -QUARTER TARGET/ISOCENTER pairs. Note that, in general, the narrower QUARTER TARGET/ISOCENTER\ -pairs occur closer to the centre of the MLC to allow more high-resolution field definition.\ -Although cross-sections must be specified for all leaf types, not all types need be used in\ -an MLC. +QUARTER TARGET/ISOCENTER pairs. SYNCHDMLC has the option to specify cylindrical (ENDTYPE=0) or straight, focused (ENDTYPE=1)\ leaf ends. The origins of the cylinders defining leaf ends are at Z=ZMIN+ZTHICK/2\ diff --git a/HEN_HOUSE/omega/progs/gui/beamnrc/misc_egsnrc.tcl b/HEN_HOUSE/omega/progs/gui/beamnrc/misc_egsnrc.tcl index f0aa33c08..fa56aff95 100644 --- a/HEN_HOUSE/omega/progs/gui/beamnrc/misc_egsnrc.tcl +++ b/HEN_HOUSE/omega/progs/gui/beamnrc/misc_egsnrc.tcl @@ -194,12 +194,20 @@ proc help_gif { w text iconfile } { image create photo $w.graphic -file \ [file join $GUI_DIR graphics $iconfile.gif] label $w.f1.lbl -image $w.graphic -bg white - message $w.f1.m -width 5i -text $text -font $helvfont -bg white + text $w.f1.m -font $helvfont -width 80 -wrap word\ + -bd 5 -yscrollcommand "$w.f1.v_scroll set" -bg white + $w.f1.m insert 1.0 $text + $w.f1.m configure -state disabled + scrollbar $w.f1.v_scroll -command "$w.f1.m yview" } else { label $w.f1.lbl -text "No graphic for this source" - message $w.f1.m -width 7i -text $text -font $helvfont -bg white + text $w.f1.m -font $helvfont -width 80 -wrap word\ + -bd 5 -yscrollcommand "$w.f1.v_scroll set" -bg white + $w.f1.m insert 1.0 $text + $w.f1.m configure -state disabled + scrollbar $w.f1.v_scroll -command "$w.f1.m yview" } - pack $w.f1.lbl $w.f1.m -side left -padx 10 -pady 5 -fill both + pack $w.f1.lbl $w.f1.m $w.f1.v_scroll -side left -padx 10 -pady 5 -fill both pack $w.f1 frame $w.sep -bd 4 -width 100 -height 2 -relief groove pack $w.sep -pady 10 -fill x diff --git a/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl b/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl index 320cae558..d80355bac 100644 --- a/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl +++ b/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl @@ -60,7 +60,7 @@ proc init_SYNCHDMLC { id } { - global cmval ngroups nleaf sync_file + global cmval ngroups nleaf sync_file nfull nhlf nqtr set cmval($id,0) {} set cmval($id,1) {} @@ -107,11 +107,17 @@ proc init_SYNCHDMLC { id } { set cmval($id,20) {} set ngroups($id) 1 set nleaf($id) {} + # no. of groups of FULL leaves + set nfull 0 + # no. of groups of HALF leaf pairs + set nhlf 0 + # no. of groups of QUARTER leaf pairs + set nqtr 0 set sync_file($id) {} } proc read_SYNCHDMLC { fileid id } { - global cmval GUI_DIR ngroups cm_ident nleaf sync_file + global cmval GUI_DIR ngroups cm_ident nleaf sync_file nfull nhlf nqtr # read a trash line gets $fileid data @@ -188,12 +194,22 @@ proc read_SYNCHDMLC { fileid id } { # read numleaf, leaf type for each group--8 set nleaf($id) 0 + set nfull 0 + set nhlf 0 + set nqtr 0 for {set i 1} {$i<=$cmval($id,2,1)} {incr i} { gets $fileid data for {set j 0} {$j<2} {incr j} { set data [get_val $data cmval $id,8,$j,$i] } incr nleaf($id) $cmval($id,8,0,$i) + if {$cmval($id,8,1,$i)==1} { + incr nfull + } elseif {$cmval($id,8,1,$i)==2} { + incr nhlf + } elseif {$cmval($id,8,1,$i)==3} { + incr nqtr + } } # read start 9 @@ -726,6 +742,7 @@ proc define_synchdmlc_leaves { id } { FULL, HALF TARGET, HALF ISOCENTER leaves. For the HD MLC introduce values for: \ HALF TARGET , HALF ISOCENTER, QUARTER TARGET and QUARTER ISOCENTER leaves. + Option to leave dimensions for unused leaf types blank. For help, click on the \"?\"\ button for the appropriate leaf type." -width 800 -font $helvfont pack $w.message -side top -anchor n -fill x -expand true @@ -1990,7 +2007,7 @@ proc save_synchdmlc { id } { } proc save_synchdmlc_type { id } { - global cmval fromw tow nleaf + global cmval fromw tow nleaf nhlf nfull nqtr if {$tow($cmval($id,2,1))>$nleaf($id)} { tk_dialog .toomanytypegroups "Too many leaves" "You have specified too many\ @@ -2002,6 +2019,9 @@ proc save_synchdmlc_type { id } { return } + set nhlf 0 + set nqtr 0 + set nfull 0 for {set j 1} {$j<=$cmval($id,2,1)} {incr j} { if {[catch {set cmval($id,8,0,$j) [expr $tow($j)-$fromw($j)+1]}]==1} { tk_dialog .nope "No no no" "The leaf types for group $j\ @@ -2023,6 +2043,14 @@ proc save_synchdmlc_type { id } { have an even number of leaves." warning 0 OK return } + + if {$cmval($id,8,1,$j)==1} { + incr nfull + } elseif {$cmval($id,8,1,$j)==2} { + incr nhlf + } elseif {$cmval($id,8,1,$j)==3} { + incr nqtr + } } destroy .synchdmlc$id.childt @@ -2113,7 +2141,7 @@ proc del_synchdmlc_row_type { id } { } proc write_SYNCHDMLC {fileid id} { - global cmval cm_names cm_ident cm_type ngroups sync_file + global cmval cm_names cm_ident cm_type ngroups sync_file nfull nhlf nqtr puts $fileid "$cmval($id,0), RMAX" puts $fileid $cmval($id,1) @@ -2126,9 +2154,10 @@ proc write_SYNCHDMLC {fileid id} { for {set i 0} {$i<15} {incr i} { set str "$str$cmval($id,5,$i), " } - if {$str!=", , , , , , , , , , , , , , , "} { + if {$nfull == 0 | $str!=", , , , , , , , , , , , , , , "} { puts $fileid $str } else { +# output a guess based on leaves clearing each other puts $fileid "0.4, 0.04, 0.04 0.1, 0.3, 0.1, [expr $cmval($id,3)],\ [expr $cmval($id,3)+0.5], [expr $cmval($id,3)+2.5], [expr $cmval($id,3)+3.7],\ [expr $cmval($id,3)+3.9], [expr $cmval($id,3)+4.3], 1.7, [expr $cmval($id,3)+5.5],\ @@ -2136,6 +2165,7 @@ proc write_SYNCHDMLC {fileid id} { } #TARGET HALF leaf dimensions + #no guess for half leaf dimensions set str {} for {set i 0} {$i<15} {incr i} { set str "$str$cmval($id,6,$i), " @@ -2154,9 +2184,10 @@ proc write_SYNCHDMLC {fileid id} { for {set i 0} {$i<15} {incr i} { set str "$str$cmval($id,30,$i), " } - if {$str!=", , , , , , , , , , , , , , , "} { + if {$nqtr==0 | $str!=", , , , , , , , , , , , , , , "} { puts $fileid $str } else { +#put in a guess based on leaves clearing each other puts $fileid "0.11, 0.037, 0.037, 0.04, 0.07, 0.08, [expr $cmval($id,3)+0.1],\ [expr $cmval($id,3)+0.3], [expr $cmval($id,3)+0.9], [expr $cmval($id,3)+1.2],\ 1.7, [expr $cmval($id,3)+3.3], [expr $cmval($id,3)+3.5], [expr $cmval($id,3)+6],\ @@ -2168,9 +2199,10 @@ proc write_SYNCHDMLC {fileid id} { for {set i 0} {$i<15} {incr i} { set str "$str$cmval($id,31,$i), " } - if {$str!=", , , , , , , , , , , , , , , "} { + if {$nqtr==0 | $str!=", , , , , , , , , , , , , , , "} { puts $fileid $str } else { +#a guess based on leaf clearance puts $fileid "0.11, 0.036, 0.0365, 0.032, 0.08, 0.07, [expr $cmval($id,3)+0.2],\ [expr $cmval($id,3)+0.3], [expr $cmval($id,3)+3.7], [expr $cmval($id,3)+3.6],\ [expr $cmval($id,3)+5], [expr $cmval($id,3)+6], 1.7, [expr $cmval($id,3)+6.5],\ @@ -2450,7 +2482,7 @@ NOTE: This is a dynamic or step-and-shoot delivery, with leaf opening\ } proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { - global cmval colorlist medium nmed nleaf colornum sync_file + global cmval colorlist medium nmed nleaf colornum sync_file nfull nhlf nqtr # assign numbers to the media, in and out set med(in) $colornum @@ -2538,6 +2570,7 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { #set up arrays of widths that can be seen from the top view #FULL leaf + if {$nfull > 0} { set w(1,1) $cmval($id,5,3) set w(1,2) [expr $cmval($id,5,0)+$cmval($id,5,1)-$cmval($id,5,3) \ -$cmval($id,5,2)] @@ -2547,6 +2580,8 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { set wt(1) $cmval($id,5,1) set wg(1) $cmval($id,5,2) set wtot(1) [expr $cmval($id,5,0)+$cmval($id,5,1)] + } + if {$nhlf > 0} { #TARGET HALF leaf set w(2,1) [expr $cmval($id,6,0)+$cmval($id,6,1)-$cmval($id,6,5) \ +$cmval($id,6,4)] @@ -2564,6 +2599,8 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { set wt(3) $cmval($id,7,1) set wg(3) $cmval($id,7,2) set wtot(3) [expr $cmval($id,7,0)+$cmval($id,7,1)] + } + if {$nqtr > 0} { #TARGET QUARTER leaf set w(4,1) [expr $cmval($id,30,0)+$cmval($id,30,1)-$cmval($id,30,5) \ +$cmval($id,30,4)] @@ -2581,7 +2618,7 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { set wt(5) $cmval($id,31,1) set wg(5) $cmval($id,31,2) set wtot(5) [expr $cmval($id,31,0)+$cmval($id,31,1)] - + } if {$cmval($id,2,0)==1} { # leaves parallel to x set lstart $cmval($id,9) @@ -2651,7 +2688,7 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { } proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { - global cmval colorlist medium nmed meds_used nleaf colornum sync_file + global cmval colorlist medium nmed meds_used nleaf colornum sync_file nfull nqtr nhlf # assign numbers to the media, in and out set med(in) $colornum @@ -2742,6 +2779,7 @@ proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { #set up an array of widths and Z positions for the leaf types #FULL leaf + if {$nfull > 0 } { set wtot(1) [expr $cmval($id,5,0)+$cmval($id,5,1)] set wt(1) $cmval($id,5,1) set numzf(1) 5 @@ -2756,6 +2794,8 @@ proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { set holetop(1) $cmval($id,5,10) set holebot(1) $cmval($id,5,11) set holepos(1) $cmval($id,5,12) + } + if {$nhlf > 0} { #TARGET HALF leaf set wtot(2) [expr $cmval($id,6,0)+$cmval($id,6,1)] set wt(2) $cmval($id,6,1) @@ -2786,6 +2826,8 @@ proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { set holetop(3) $cmval($id,7,10) set holebot(3) $cmval($id,7,11) set holepos(3) $cmval($id,7,12) + } + if {$nqtr > 0} { #TARGET QUARTER leaf set wtot(4) [expr $cmval($id,30,0)+$cmval($id,30,1)] set wt(4) $cmval($id,30,1) @@ -2816,7 +2858,7 @@ proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { set holetop(5) $cmval($id,31,10) set holebot(5) $cmval($id,31,11) set holepos(5) $cmval($id,31,12) - + } #now find out which leaves are intersected by Y=0 (if leaves || to Y) #or X=0 (if leaves || to X) #if only part of a leaf intersects 0, show the entire leaf @@ -3048,7 +3090,7 @@ proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { global cmval colorlist medium nmed meds_used y z rmin rmax zf ztop nleaf - global colornum sync_file + global colornum sync_file nfull nhlf nqtr # assign numbers to the media, in and out set med(in) $colornum for {set j 0} {$j<=$nmed} {incr j} { @@ -3169,6 +3211,7 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { #tongue (at zmin) #FULL leaf + if {$nfull > 0 } { set wtot(1) [expr $cmval($id,5,1)+$cmval($id,5,0)] set wtongue(1) $cmval($id,5,1) #upper left corner of tip @@ -3225,7 +3268,8 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { #upper right of screw hole set hz(1,4) $cmval($id,5,10) set hy(1,4) [expr $cmval($id,5,0)+$cmval($id,5,1)] - + } + if {$nhlf > 0} { #TARGET HALF leaf set wtot(2) [expr $cmval($id,6,1)+$cmval($id,6,0)] set wtongue(2) $cmval($id,6,1) @@ -3342,7 +3386,8 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { #upper right of screw hole set hz(3,4) $cmval($id,7,10) set hy(3,4) [expr $cmval($id,7,0)+$cmval($id,7,1)] - + } + if {$nqtr > 0} { #TARGET QUARTER leaf set wtot(4) [expr $cmval($id,30,1)+$cmval($id,30,0)] set wtongue(4) $cmval($id,30,1) @@ -3459,7 +3504,7 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { #upper right of screw hole set hz(5,4) $cmval($id,31,10) set hy(5,4) [expr $cmval($id,31,0)+$cmval($id,31,1)] - + } set rmin -$cmval($id,0) set rmax $cmval($id,0)