<!-- Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) -->

<system name="A320: Engine Fire">

	<channel name="Engine Fire">
		<fcs_function name="enginefire1">
              <function>
				<sum>
					<property>/systems/fire/engine1/temperature</property>
					<product>
					   <table>
							<independentVar lookup="row">/systems/failures/engine-left-fire</independentVar>
							<tableData>
								0    -5
							    1	 30
							</tableData>
						</table>
						<property>simulation/channel-dt</property>
					</product>
				</sum>
            </function>
			<clipto>
				<min>0</min>
				<max>300</max>
			</clipto>
            <output>/systems/fire/engine1/temperature</output>
        </fcs_function>
		
		<fcs_function name="enginefire2">
              <function>
				<sum>
					<property>/systems/fire/engine2/temperature</property>
					<product>
					   <table>
							<independentVar lookup="row">/systems/failures/engine-right-fire</independentVar>
							<tableData>
								0    -5
							    1	 30
							</tableData>
						</table>
						<property>simulation/channel-dt</property>
					</product>
				</sum>
            </function>
			<clipto>
				<min>0</min>
				<max>300</max>
			</clipto>
            <output>/systems/fire/engine2/temperature</output>
        </fcs_function>
		
		<fcs_function name="apufire">
              <function>
				<sum>
					<property>/systems/fire/apu/temperature</property>
					<product>
					   <table>
							<independentVar lookup="row">/systems/failures/apu-fire</independentVar>
							<tableData>
								0    -5
							    1	 45
							</tableData>
						</table>
						<property>simulation/channel-dt</property>
					</product>
				</sum>
            </function>
			<clipto>
				<min>0</min>
				<max>300</max>
			</clipto>
            <output>/systems/fire/apu/temperature</output>
        </fcs_function>
	</channel>
	
	<channel name="Cargo Fire">
		<fcs_function name="fwdfire">
              <function>
				<sum>
					<property>/systems/fire/cargo/fwd/temperature</property>
					<product>
					   <table>
							<independentVar lookup="row">/systems/failures/cargo-fwd-fire</independentVar>
							<tableData>
								0    -5
							    1	 30
							</tableData>
						</table>
						<property>simulation/channel-dt</property>
					</product>
				</sum>
            </function>
			<clipto>
				<min>0</min>
				<max>300</max>
			</clipto>
            <output>/systems/fire/cargo/fwd/temperature</output>
        </fcs_function>
		
		<fcs_function name="aftfire">
              <function>
				<sum>
					<property>/systems/fire/cargo/aft/temperature</property>
					<product>
					   <table>
							<independentVar lookup="row">/systems/failures/cargo-aft-fire</independentVar>
							<tableData>
								0    -5
							    1	 45
							</tableData>
						</table>
						<property>simulation/channel-dt</property>
					</product>
				</sum>
            </function>
			<clipto>
				<min>0</min>
				<max>300</max>
			</clipto>
            <output>/systems/fire/cargo/aft/temperature</output>
        </fcs_function>
	</channel>
</system>