97
97
</xsl:text></xsl:when></xsl:choose>
98
98
</xsl:for-each></xsl:when><xsl:otherwise> </xsl:otherwise></xsl:choose>
99
<xsl:for-each select="MICE_Information/Configuration_Information/coolingchannel/magnets/magnet">
99
<xsl:for-each select="MICE_Information/Configuration_Information/coolingchannel/magnet">
101
101
<xsl:when test="contains(@name, 'SSU')">
102
102
<xsl:for-each select="coil">
104
<xsl:when test="contains(@name, 'SSU-T2')">Substitution $SSUT2 <xsl:value-of select="@iset"/>
105
Substitution $SSUT2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
107
</xsl:text></xsl:when>
108
<xsl:when test="contains(@name, 'SSU-T1')">Substitution $SSUT1 <xsl:value-of select="@iset"/>
109
Substitution $SSUT2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
111
</xsl:text></xsl:when>
112
<xsl:when test="contains(@name, 'SSU-C')">Substitution $SSUC <xsl:value-of select="@iset"/>
104
<xsl:when test="contains(@name, 'SSU-T2')">Substitution $SSUT2Current <xsl:value-of select="@iset"/>
105
Substitution $SSUT2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
107
</xsl:text></xsl:when>
108
<xsl:when test="contains(@name, 'SSU-T1')">Substitution $SSUT1Current <xsl:value-of select="@iset"/>
109
Substitution $SSUT1Polarity <xsl:value-of select="../@polarity"/><xsl:text>
111
</xsl:text></xsl:when>
112
<xsl:when test="contains(@name, 'SSU-C')">Substitution $SSUCCurrent <xsl:value-of select="@iset"/>
113
113
Substitution $SSUCPolarity <xsl:value-of select="../@polarity"/><xsl:text>
115
115
</xsl:text></xsl:when>
116
<xsl:when test="contains(@name, 'SSU-M1')">Substitution $SSUM1 <xsl:value-of select="@iset"/>
116
<xsl:when test="contains(@name, 'SSU-M1')">Substitution $SSUM1Current <xsl:value-of select="@iset"/>
117
117
Substitution $SSUM1Polarity <xsl:value-of select="../@polarity"/><xsl:text>
119
119
</xsl:text></xsl:when>
120
<xsl:when test="contains(@name, 'SSU-M2')">Substitution $SSUM2 <xsl:value-of select="@iset"/>
120
<xsl:when test="contains(@name, 'SSU-M2')">Substitution $SSUM2Current <xsl:value-of select="@iset"/>
121
121
Substitution $SSUM2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
123
123
</xsl:text></xsl:when>
127
<xsl:when test="contains(@name, 'FCM') and contains(@mode, 'Solenoid')">
127
<xsl:when test="contains(@name, 'FCM') and ( contains(@mode, 'Solenoid') or contains(@mode, 'solenoid') )">
128
128
Substitution $FCMMode +1<xsl:text>
131
131
<xsl:for-each select="coil">
133
<xsl:when test="contains(@name, 'FCM-U')">Substitution $FCMU <xsl:value-of select="@iset"/>
133
<xsl:when test="contains(@name, 'FCM-U')">Substitution $FCMUCurrent <xsl:value-of select="@iset"/>
134
134
Substitution $FCMUPolarity <xsl:value-of select="../@polarity"/><xsl:text>
138
<xsl:when test="contains(@name, 'FCM-D')">Substitution $FCMD <xsl:value-of select="@iset"/>
138
<xsl:when test="contains(@name, 'FCM-D')">Substitution $FCMDCurrent <xsl:value-of select="@iset"/>
139
139
Substitution $FCMDPolarity <xsl:value-of select="../@polarity"/><xsl:text>
141
141
</xsl:text></xsl:when>
145
<xsl:when test="contains(@name, 'FCM') and contains(@mode, 'Flip')">
146
Substitution $FCMMode +1<xsl:text>
145
<xsl:when test="contains(@name, 'FCM') and ( contains(@mode, 'Flip') or contains(@mode, 'flip') )">
146
Substitution $FCMMode -1<xsl:text>
149
149
<xsl:for-each select="coil">
151
<xsl:when test="contains(@name, 'FCM-U')">Substitution $FCMU <xsl:value-of select="@iset"/>
151
<xsl:when test="contains(@name, 'FCM-U')">Substitution $FCMUCurrent <xsl:value-of select="@iset"/>
152
152
Substitution $FCMUPolarity <xsl:value-of select="../@polarity"/><xsl:text>
154
154
</xsl:text></xsl:when>
155
<xsl:when test="contains(@name, 'FCM-D')">Substitution $FCMD <xsl:value-of select="@iset"/>
155
<xsl:when test="contains(@name, 'FCM-D')">Substitution $FCMDCurrent <xsl:value-of select="@iset"/>
156
156
Substitution $FCMDPolarity <xsl:value-of select="../@polarity"/><xsl:text>
158
158
</xsl:text></xsl:when>
162
162
<xsl:when test="contains(@name, 'SSD')">
163
163
<xsl:for-each select="coil">
165
<xsl:when test="contains(@name, 'SSD-T2')">Substitution $SSDT2 <xsl:value-of select="@iset"/>
166
Substitution $SSDT2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
168
</xsl:text></xsl:when>
169
<xsl:when test="contains(@name, 'SSD-T1')">Substitution $SSDT1 <xsl:value-of select="@iset"/>
170
Substitution $SSDT2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
172
</xsl:text></xsl:when>
173
<xsl:when test="contains(@name, 'SSD-C')">Substitution $SSDC <xsl:value-of select="@iset"/>
165
<xsl:when test="contains(@name, 'SSD-T2')">Substitution $SSDT2Current <xsl:value-of select="@iset"/>
166
Substitution $SSDT2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
168
</xsl:text></xsl:when>
169
<xsl:when test="contains(@name, 'SSD-T1')">Substitution $SSDT1Current <xsl:value-of select="@iset"/>
170
Substitution $SSDT1Polarity <xsl:value-of select="../@polarity"/><xsl:text>
172
</xsl:text></xsl:when>
173
<xsl:when test="contains(@name, 'SSD-C')">Substitution $SSDCCurrent <xsl:value-of select="@iset"/>
174
174
Substitution $SSDCPolarity <xsl:value-of select="../@polarity"/><xsl:text>
176
176
</xsl:text></xsl:when>
177
<xsl:when test="contains(@name, 'SSD-M1')">Substitution $SSDM1 <xsl:value-of select="@iset"/>
177
<xsl:when test="contains(@name, 'SSD-M1')">Substitution $SSDM1Current <xsl:value-of select="@iset"/>
178
178
Substitution $SSDM1Polarity <xsl:value-of select="../@polarity"/><xsl:text>
180
180
</xsl:text></xsl:when>
181
<xsl:when test="contains(@name, 'SSD-M2')">Substitution $SSDM2 <xsl:value-of select="@iset"/>
181
<xsl:when test="contains(@name, 'SSD-M2')">Substitution $SSDM2Current <xsl:value-of select="@iset"/>
182
182
Substitution $SSDM2Polarity <xsl:value-of select="../@polarity"/><xsl:text>
184
184
</xsl:text></xsl:when>
311
311
PropertyDouble Thickness <xsl:value-of select="Thickness/@value"/>
312
312
PropertyDouble InnerRadius <xsl:value-of select="InnerRadius/@value"/>
313
313
ScaleFactor <xsl:choose>
314
<xsl:when test="contains(FieldName/@name, 'MatchCoil1_0') and boolean($mcmode)">$SSUM1Polarity * $SSUM1</xsl:when>
315
<xsl:when test="contains(FieldName/@name, 'MatchCoil2_0') and boolean($mcmode)">$SSUM2Polarity * $SSUM2</xsl:when>
316
<xsl:when test="contains(FieldName/@name, 'CenterCoil_0') and boolean($mcmode)">$SSUCPolarity * $SSUC</xsl:when>
317
<xsl:when test="contains(FieldName/@name, 'EndCoil1_0') and boolean($mcmode)">$SSUT1Polarity * $SSUT1</xsl:when>
318
<xsl:when test="contains(FieldName/@name, 'EndCoil2_0') and boolean($mcmode)">$SSUT2Polarity * $SSUT2</xsl:when>
319
<xsl:when test="contains(FieldName/@name, 'FCoil_0') and boolean($mcmode)">$FCMUPolarity * $FCMU</xsl:when>
320
<xsl:when test="contains(FieldName/@name, 'FCoil_1') and boolean($mcmode)">$FCMUPolarity * $FCMMode * $FCMD</xsl:when>
321
<xsl:when test="contains(FieldName/@name, 'MatchCoil1_1') and boolean($mcmode)">$SSDM1Polarity * $FCMMode * $SSDM1</xsl:when>
322
<xsl:when test="contains(FieldName/@name, 'MatchCoil2_1') and boolean($mcmode)">$SSDM2Polarity * $FCMMode * $SSDM2</xsl:when>
323
<xsl:when test="contains(FieldName/@name, 'CenterCoil_1') and boolean($mcmode)">$SSDCPolarity * $FCMMode * $SSDC</xsl:when>
324
<xsl:when test="contains(FieldName/@name, 'EndCoil1_1') and boolean($mcmode)">$SSDT1Polarity * $FCMMode * $SSDT1</xsl:when>
325
<xsl:when test="contains(FieldName/@name, 'EndCoil2_1') and boolean($mcmode)">$SSDT2Polarity * $FCMMode * $SSDT2</xsl:when>
314
<xsl:when test="contains(FieldName/@name, 'MatchCoil1_0') and boolean($mcmode)">$SSUM1Polarity*$SSUM1Current</xsl:when>
315
<xsl:when test="contains(FieldName/@name, 'MatchCoil2_0') and boolean($mcmode)">$SSUM2Polarity*$SSUM2Current</xsl:when>
316
<xsl:when test="contains(FieldName/@name, 'CenterCoil_0') and boolean($mcmode)">$SSUCPolarity*$SSUCCurrent</xsl:when>
317
<xsl:when test="contains(FieldName/@name, 'EndCoil1_0') and boolean($mcmode)">$SSUT1Polarity*$SSUT1Current</xsl:when>
318
<xsl:when test="contains(FieldName/@name, 'EndCoil2_0') and boolean($mcmode)">$SSUT2Polarity*$SSUT2Current</xsl:when>
319
<xsl:when test="contains(FieldName/@name, 'FCoil_0') and boolean($mcmode)">$FCMUPolarity*$FCMUCurrent</xsl:when>
320
<xsl:when test="contains(FieldName/@name, 'FCoil_1') and boolean($mcmode)">$FCMUPolarity*$FCMMode*$FCMDCurrent</xsl:when>
321
<xsl:when test="contains(FieldName/@name, 'MatchCoil1_1') and boolean($mcmode)">$SSDM1Polarity*$FCMMode*$SSDM1Current</xsl:when>
322
<xsl:when test="contains(FieldName/@name, 'MatchCoil2_1') and boolean($mcmode)">$SSDM2Polarity*$FCMMode*$SSDM2Current</xsl:when>
323
<xsl:when test="contains(FieldName/@name, 'CenterCoil_1') and boolean($mcmode)">$SSDCPolarity*$FCMMode*$SSDCCurrent</xsl:when>
324
<xsl:when test="contains(FieldName/@name, 'EndCoil1_1') and boolean($mcmode)">$SSDT1Polarity*$FCMMode*$SSDT1Current</xsl:when>
325
<xsl:when test="contains(FieldName/@name, 'EndCoil2_1') and boolean($mcmode)">$SSDT2Polarity*$FCMMode*$SSDT2Current</xsl:when>
326
326
<xsl:otherwise><xsl:value-of select="ScaleFactor/@value"/></xsl:otherwise>