<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:Locale="urn:Locale-namespace">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:include href="DefaultPrint-r102.xsl"/>
	<!--<xsl:include href="Locale.xsl"/>-->
	<xsl:param name="printtype">Full</xsl:param>
	<xsl:variable name="NativePressureUnits">psi</xsl:variable>
	<xsl:variable name="TheSchema" select="document('AltusA10UV-Method-r100.xsd')"/>
	<xsl:variable name="LanguageSubfolder" select="Locale:LanguageSubfolder()"/>
	<xsl:variable name="ResourceFile" select="concat($LanguageSubfolder,'\\AltusA10UV-Resource-r100.xml')"/>
	<xsl:variable name="TheResources" select="document(string($ResourceFile))"/>
	<xsl:template match="WavelengthMode"/>
	<!-- Emit ChannelB only in dual mode -->
	<xsl:template match="ChannelB">
		<xsl:if test="//WavelengthMode = '2' ">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<!-- Don't emit event table if brief or summary report is requested -->
	<xsl:template match="EventTable">
		<xsl:if test="$printtype = 'Full' or $printtype = 'Plain Text'">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<!-- Customize text for boolean On/Off at end of FieldList -->
	<xsl:template match="Lamp">
		<!--
			<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar">DEBUG</xsl:with-param>
			<xsl:with-param name="InputType">DEBUG</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue" select="$Language"/>
			</xsl:call-template>
-->
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = 'true'">
						<xsl:value-of select="$TheResources//Enum[@id='BooleanOn_1B']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$TheResources//Enum[@id='BooleanOff_0B']/@value"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tLamp']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
		<xsl:text disable-output-escaping="yes">
			&lt;/FieldList&gt;
		</xsl:text>
	</xsl:template>
	<!-- Customize output of WavelengthMode -->
	<xsl:template match="WavelengthMode">
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = '1'">
						<xsl:value-of select="$TheResources//Enum[@id='WavelengthMode_1']/@value"/>
					</xsl:when>
					<xsl:when test=". = '2'">
						<xsl:value-of select="$TheResources//Enum[@id='WavelengthMode_2']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$TheResources//Enum[@id='WavelengthMode_0']/@value"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tWavelengthMode']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!-- Do not expose filter type since Hamming is always used -->
	<xsl:template match="FilterType"/>
	<!-- Expose ratio minimum only if ratio data mode is used -->
	<xsl:template match="ChannelA/RatioMinimum | ChannelB/RatioMinimum">
		<xsl:if test="//WavelengthMode = '2' and 
			( ../DataMode = $TheResources//Enum[@id='DualModeA_6B']/@value or ../DataMode = $TheResources//Enum[@id='DualModeB_6C']/@value)">
			<xsl:call-template name="Emit-Field-Value-Prompt">
				<xsl:with-param name="InputVar" select="name()"/>
				<xsl:with-param name="InputType">Float</xsl:with-param>
				<xsl:with-param name="InputPrecision">4</xsl:with-param>
				<xsl:with-param name="InputValue" select="."/>
				<xsl:with-param name="InputPrompt">
					<xsl:value-of select="$TheResources//Type[@name='tRatioAU']/@prompt"/>
				</xsl:with-param>
				<xsl:with-param name="InputUnits">
					<xsl:value-of select="$TheResources//Type[@name='tRatioAU']/@units"/>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<!-- Customize text for boolean Yes/No before end of FieldList -->
	<xsl:template match="AutoZeroInjectStart">
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = 'true'">
						<xsl:value-of select="$TheResources//Enum[@id='BooleanYes_1A']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$TheResources//Enum[@id='BooleanNo_0A']/@value"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tAutoZeroInjectStart']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!-- Customize text for boolean Yes/No before end of FieldList -->
	<xsl:template match="RunEvents">
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = 'true'">
						<xsl:value-of select="$TheResources//Enum[@id='BooleanYes_1A']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$TheResources//Enum[@id='BooleanNo_0A']/@value"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tRunEvents']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!-- Customize text for boolean Yes/No before end of FieldList -->
	<xsl:template match="ChartMarkEnable">
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = 'true'">
						<xsl:value-of select="$TheResources//Enum[@id='BooleanYes_1A']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$TheResources//Enum[@id='BooleanNo_0A']/@value"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tChartMarkEnable']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!-- Exclude absorbance offset from output -->
	<xsl:template match="AbsorbanceOffset"/>
	<!-- Exclude autozero event or key  from output -->
	<xsl:template match="AutoZeroEventOrKey"/>
	<!-- Exclude analog A out from Brief -->
	<xsl:template match="AnalogA">
		<xsl:if test="$printtype != 'Brief'">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<!-- Exclude analog B out from Brief or when single wavelength mode -->
	<xsl:template match="AnalogB">
		<xsl:if test="$printtype != 'Brief' and //WavelengthMode = '2' ">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<!-- Exclude threshold A unless printtype is Full and threshold is enabled -->
	<xsl:template match="ThresholdA">
		<xsl:if test="($printtype = 'Full' or $printtype = 'Plain Text') and ./Enable = 'true'">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<!-- Exclude threshold B unless printtype is Full and in dual wavelength mode and threshold is enabled -->
	<xsl:template match="ThresholdB">
		<xsl:if test="($printtype = 'Full' or $printtype = 'Plain Text') and //WavelengthMode = '2' and ./Enable = 'true'">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<!-- Exclude 'Enable' from threshold output -->
	<xsl:template match="ThresholdA/Enable | ThresholdB/Enable"/>
	<!-- Exclude ratio min and max from analog unless data mode is ratio -->
	<xsl:template match="AnalogA/RatioMinimum | AnalogA/RatioMaximum">
		<xsl:if test="//ChannelA/DataMode = $TheResources//Enum[@id='DualModeA_6B']/@value">
			<xsl:variable name="NAME">
				<xsl:value-of select="name()"/>
			</xsl:variable>
			<xsl:variable name="ID">
				<xsl:value-of select="$TheSchema//xsd:complexType[@name='tAnalog']//xsd:element[@name=$NAME]/@id"/>
			</xsl:variable>
			<xsl:call-template name="Emit-Field-Value-Prompt">
				<xsl:with-param name="InputVar" select="name()"/>
				<xsl:with-param name="InputType">Float</xsl:with-param>
				<xsl:with-param name="InputPrecision">2</xsl:with-param>
				<xsl:with-param name="InputValue" select="."/>
				<xsl:with-param name="InputPrompt">
					<xsl:value-of select="$TheResources//Type[@name='tRatio']/Prompt[@id=$ID]/@value"/>
				</xsl:with-param>
				<xsl:with-param name="InputUnits">
					<xsl:value-of select="$TheResources//Type[@name='tRatio']/@units"/>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<xsl:template match="AnalogB/RatioMinimum | AnalogB/RatioMaximum">
		<xsl:if test="//ChannelB/DataMode = $TheResources//Enum[@id='DualModeB_6C']/@value">
			<xsl:variable name="NAME">
				<xsl:value-of select="name()"/>
			</xsl:variable>
			<xsl:variable name="ID">
				<xsl:value-of select="$TheSchema//xsd:complexType[@name='tAnalog']//xsd:element[@name=$NAME]/@id"/>
			</xsl:variable>
			<xsl:call-template name="Emit-Field-Value-Prompt">
				<xsl:with-param name="InputVar" select="name()"/>
				<xsl:with-param name="InputType">Float</xsl:with-param>
				<xsl:with-param name="InputPrecision">2</xsl:with-param>
				<xsl:with-param name="InputValue" select="."/>
				<xsl:with-param name="InputPrompt">
					<xsl:value-of select="$TheResources//Type[@name='tRatio']/Prompt[@id=$ID]/@value"/>
				</xsl:with-param>
				<xsl:with-param name="InputUnits">
					<xsl:value-of select="$TheResources//Type[@name='tRatio']/@units"/>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<!--
	<xsl:template match="">
		<xsl:if test="">
			<xsl:call-template name="Emit-Field">
				<xsl:with-param name="InputVar" select="name()"/>
				<xsl:with-param name="InputType" select="tRatio"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
-->
	<!-- Customize text for Data Mode before end of FieldList -->
	<xsl:template match="ChannelA/DataMode">
		<xsl:variable name="dataMode" select="."/>
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:if test="//WavelengthMode = '1' ">
					<xsl:choose>
						<xsl:when test=". = 'SingleMode_1A' ">
							<xsl:value-of select="$TheResources//Enum[@id='SingleMode_1A']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'SingleMode_14A' ">
							<xsl:value-of select="$TheResources//Enum[@id='SingleMode_14A']/@value"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$dataMode"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
				<xsl:if test="//WavelengthMode = '2' ">
					<xsl:choose>
						<xsl:when test=". = 'DualModeA_1B' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeA_1B']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeA_14B' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeA_14B']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeA_5B' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeA_5B']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeA_6B' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeA_6B']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeA_8B' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeA_8B']/@value"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$dataMode"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tDataMode']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="ChannelB/DataMode">
		<xsl:variable name="dataMode" select="."/>
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:if test="//WavelengthMode = '2' ">
					<xsl:choose>
						<xsl:when test=". = 'DualModeB_2C' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeB_2C']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeB_15C' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeB_15C']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeB_5C' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeB_5C']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeB_6C' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeB_6C']/@value"/>
						</xsl:when>
						<xsl:when test=". = 'DualModeB_8C' ">
							<xsl:value-of select="$TheResources//Enum[@id='DualModeB_8C']/@value"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$dataMode"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tDataMode']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!-- Customize text for Auto Zero Wavelength before end of FieldList -->
	<xsl:template match="AutoZeroWavelength">
		<xsl:variable name="autoZeroWavelength" select="."/>
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = 'Az_1'">
						<xsl:value-of select="$TheResources//Enum[@id='Az_1']/@value"/>
					</xsl:when>
					<xsl:when test=". = 'Az_2'">
						<xsl:value-of select="$TheResources//Enum[@id='Az_2']/@value"/>
					</xsl:when>
					<xsl:when test=". = 'Az_3'">
						<xsl:value-of select="$TheResources//Enum[@id='Az_3']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$autoZeroWavelength"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tAutoZeroWavelength']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!-- Customize text for Threshold Event before end of FieldList -->
	<xsl:template match="ThresholdEvent">
		<xsl:variable name="thresholdEvent" select="."/>
		<xsl:call-template name="Emit-Field-Value-Prompt">
			<xsl:with-param name="InputVar" select="name()"/>
			<xsl:with-param name="InputType">String</xsl:with-param>
			<xsl:with-param name="InputPrecision">0</xsl:with-param>
			<xsl:with-param name="InputValue">
				<xsl:choose>
					<xsl:when test=". = 'ThresholdEvent_8'">
						<xsl:value-of select="$TheResources//Enum[@id='ThresholdEvent_8']/@value"/>
					</xsl:when>
					<xsl:when test=". = 'ThresholdEvent_9'">
						<xsl:value-of select="$TheResources//Enum[@id='ThresholdEvent_8']/@value"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$thresholdEvent"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="InputPrompt">
				<xsl:value-of select="$TheResources//Type[@name='tThresholdEvent']/@prompt"/>
			</xsl:with-param>
			<xsl:with-param name="InputUnits">None</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="AltusA10UVMethod">
		<xsl:element name="AltusA10UVMethod">
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
