<?xml version="1.0"?>

<!--
##############################################
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
-->

<!-- Airbus A32X Hydraulics System -->

<PropertyList>
	
 <!-- =============================================================== -->
 <!-- Spoiler Control                                                 -->
 <!-- =============================================================== -->
	
	<!-- Spoiler L1 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l1</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<property>/controls/flight/speedbrake-norm</property> 
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l1</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<output>/controls/flight/spoiler-l1-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l1-cmd</input>
		<output>/controls/flight/spoiler-l1</output>
		<max-rate-of-change>0.6</max-rate-of-change>
	</filter>
 
	<!-- Spoiler L2 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>0.7</dep></entry>
					</table>
					<table>
						<property>/controls/flight/spoiler-left-fbw-cmd</property> 
						<entry><ind>0.1</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.4</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>1.0</dep></entry>
					</table>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.1</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l2-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l2-cmd</input>
		<output>/controls/flight/spoiler-l2</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Spoiler L3 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-l3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-left-fbw-cmd</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.0</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l3-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l3-cmd</input>
		<output>/controls/flight/spoiler-l3</output>
		<max-rate-of-change>0.4</max-rate-of-change>
	</filter>
	
	<!-- Spoiler L4 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-left-fbw-cmd</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.0</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l4-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l4-cmd</input>
		<output>/controls/flight/spoiler-l4</output>
		<max-rate-of-change>0.7</max-rate-of-change>
	</filter>
	
	<!-- Spoiler L5 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-l5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind>0.0</ind><dep>   0</dep></entry>
						<entry><ind>1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-l5</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-l5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-left-fbw-cmd</property> 
					<entry><ind>-0.0</ind><dep>  0</dep></entry>
					<entry><ind>-1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l5-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-l5-cmd</input>
		<output>/controls/flight/spoiler-l5</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Left Spoiler Sum -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<sum>
					<property>/controls/flight/spoiler-l1</property>
					<property>/controls/flight/spoiler-l2</property>
					<property>/controls/flight/spoiler-l3</property>
					<property>/controls/flight/spoiler-l4</property>
					<property>/controls/flight/spoiler-l5</property>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/spoiler-l-sum</output>
	</filter>
	
	<!-- Spoiler R1 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r1</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<property>/controls/flight/speedbrake-norm</property> 
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r1</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<output>/controls/flight/spoiler-r1-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r1-cmd</input>
		<output>/controls/flight/spoiler-r1</output>
		<max-rate-of-change>0.6</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R2 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>0.7</dep></entry>
					</table>
					<table>
						<property>/controls/flight/spoiler-right-fbw-cmd</property> 
						<entry><ind>-0.1</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.4</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<table>
						<property>/controls/flight/speedbrake-norm</property> 
						<entry><ind>0.1</ind><dep>0.0</dep></entry>
						<entry><ind>0.5</ind><dep>0.3</dep></entry>
						<entry><ind>1.0</ind><dep>1.0</dep></entry>
					</table>
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r2</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.1</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r2-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r2-cmd</input>
		<output>/controls/flight/spoiler-r2</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R3 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-right-fbw-cmd</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r3</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.0</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r3-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r3-cmd</input>
		<output>/controls/flight/spoiler-r3</output>
		<max-rate-of-change>0.4</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R4 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/spoiler-right-fbw-cmd</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r4</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.0</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r4-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r4-cmd</input>
		<output>/controls/flight/spoiler-r4</output>
		<max-rate-of-change>0.7</max-rate-of-change>
	</filter>
	
	<!-- Spoiler R5 -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<not-equals>
						<property>/controls/flight/speedbrake-lever</property>
						<value>0.0</value>
					</not-equals>
					<or>
						<equals>
							<property>/gear/gear[1]/wow</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/gear/gear[2]/wow</property>
							<value>1</value>
						</equals>
					</or>
					<equals>
						<property>/systems/failures/spoiler-r5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<sum>
					<property>/controls/flight/speedbrake-norm</property> 
					<table>
						<property>/controls/flight/roll-fbw</property> 
						<entry><ind> 0.0</ind><dep>   0</dep></entry>
						<entry><ind>-1.0</ind><dep>-0.5</dep></entry>
					</table>
				</sum>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<less-than>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</less-than>
					<equals>
						<property>/systems/failures/spoiler-r5</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<value>0.0</value>
		</input>
		<input>
			<condition>
				<and>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<equals>
						<property>/systems/failures/spoiler-r5</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<table>
					<property>/controls/flight/spoiler-right-fbw-cmd</property> 
					<entry><ind>0.0</ind><dep>  0</dep></entry>
					<entry><ind>1.0</ind><dep>0.5</dep></entry>
				</table>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r5-cmd</output>
		<min>0.0</min>
		<max>1.0</max>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<input>/controls/flight/spoiler-r5-cmd</input>
		<output>/controls/flight/spoiler-r5</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
	<!-- Right Spoiler Sum -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<sum>
					<property>/controls/flight/spoiler-r1</property>
					<property>/controls/flight/spoiler-r2</property>
					<property>/controls/flight/spoiler-r3</property>
					<property>/controls/flight/spoiler-r4</property>
					<property>/controls/flight/spoiler-r5</property>
				</sum>
			</expression>
		</input>
		<output>/controls/flight/spoiler-r-sum</output>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Trims                                                           -->
 <!-- =============================================================== -->

	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<enable>
			<condition>
				<greater-than-equals>
					<property>/systems/hydraulic/green-psi</property>
					<value>1500</value>
				</greater-than-equals>
			</condition>
		</enable>
		<input>/controls/flight/elevator-trim</input>
		<output>/controls/flight/elevator-trim-fdm</output>
		<max-rate-of-change>0.1</max-rate-of-change>
	</filter>
	
	<filter>
		<debug>false</debug>
		<type>noise-spike</type>
		<enable>
			<condition>
				<or>
					<greater-than-equals>
						<property>/systems/hydraulic/green-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<greater-than-equals>
						<property>/systems/hydraulic/blue-psi</property>
						<value>1500</value>
					</greater-than-equals>
					<greater-than-equals>
						<property>/systems/hydraulic/yellow-psi</property>
						<value>1500</value>
					</greater-than-equals>
				</or>
			</condition>
		</enable>
		<input>/controls/flight/rudder-trim</input>
		<output>/controls/flight/rudder-trim-fdm</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Speedbrake Logic                                                -->
 <!-- =============================================================== -->
 
	<!-- Speedbrake Sum -->
	
	<filter>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<and>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>0</value>
					</equals>
				</and>
			</condition>
			<expression>
				<product>
					<sum>
						<property>/controls/flight/spoiler-l-sum</property>
						<property>/controls/flight/spoiler-r-sum</property>
					</sum>
					<value>0.15</value>
				</product>
			</expression>
		</input>
		<input>
			<condition>
				<or>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>1</value>
					</equals>
					<equals>
						<property>/gear/gear[2]/wow</property>
						<value>1</value>
					</equals>
				</or>
			</condition>
			<expression>
				<product>
					<sum>
						<property>/controls/flight/spoiler-l-sum</property>
						<property>/controls/flight/spoiler-r-sum</property>
					</sum>
					<value>0.1</value>
				</product>
			</expression>
		</input>
		<output>/controls/flight/speedbrake-output</output>
	</filter>
	
	<flipflop>
		<name>Auto Speedbrake</name>
		<debug>false</debug>
		<type>RS</type>
		<enable>
			<condition>
				<and>
					<equals>
						<property>/controls/flight/speedbrake-arm</property>
						<value>1</value>
					</equals>
					<less-than>
						<property>/engines/engine[0]/reverser-pos-norm</property>
						<value>0.01</value>
					</less-than>
					<less-than>
						<property>/engines/engine[1]/reverser-pos-norm</property>
						<value>0.01</value>
					</less-than>
				</and>
			</condition>
		</enable>
		<S>
			<and>
				<less-than>
					<property>/controls/engines/engine[0]/throttle</property>
					<value>0.15</value>
				</less-than>
				<less-than>
					<property>/controls/engines/engine[1]/throttle</property>
					<value>0.15</value>
				</less-than>
				<or>
					<property>/gear/gear[1]/wow</property>
					<property>/gear/gear[2]/wow</property>
				</or>
				<greater-than>
					<property>/velocities/groundspeed-kt</property>
					<value>72</value>
				</greater-than>
			</and>
		</S>
		<R>
			<or>
				<greater-than>
					<property>/controls/engines/engine[0]/throttle</property>
					<value>0.16</value>
				</greater-than>
				<greater-than>
					<property>/controls/engines/engine[1]/throttle</property>
					<value>0.16</value>
				</greater-than>
			</or>
		</R>
		<output>/controls/flight/speedbrake-lever</output>	
	</flipflop>
	
	<filter>
		<name>Main Speedbrake Controller</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<max>
					<property>/controls/flight/ground-spoilers</property>
					<property>/controls/flight/speedbrake-lever</property>
				</max>
			</expression>
		</input>
		<output>
			<property>/controls/flight/speedbrake</property>
			<property>/controls/flight/speedbrake-norm</property>
		</output>
		<min>0.0</min>
		<max>
			<condition>
				<and>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<equals>
						<property>/gear/gear[1]/wow</property>
						<value>0</value>
					</equals>
					<or>
						<equals>
							<property>/it-autoflight/output/ap1</property>
							<value>1</value>
						</equals>
						<equals>
							<property>/it-autoflight/output/ap2</property>
							<value>1</value>
						</equals>
					</or>
				</and>
			</condition>
			<value>0.5</value>
		</max>
		<max>1.0</max>
	</filter>
	
	<!-- Braking -->
	
	<filter>
		<name>Left Press</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/controls/gear/brake-left</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.3</ind><dep>1000</dep></entry>
					<entry><ind>0.6</ind><dep>2000</dep></entry>
					<entry><ind>  1</ind><dep>3000</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/brakes/pressure-left-psi</output>
	</filter>
	
	<filter>
		<name>Right Press</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/controls/gear/brake-right</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.3</ind><dep>1000</dep></entry>
					<entry><ind>0.6</ind><dep>2000</dep></entry>
					<entry><ind>  1</ind><dep>3000</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/brakes/pressure-right-psi</output>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Landing Gear                                                    -->
 <!-- =============================================================== -->
	
	<filter>
		<name>Left Door</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/gear/gear[1]/position-norm</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.19</ind><dep>1</dep></entry>
					<entry><ind>0.81</ind><dep>1</dep></entry>
					<entry><ind>  1</ind><dep>0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/gear/door-left</output>
	</filter>
	
	<filter>
		<name>Left Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-left</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>-100</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-left</output>
	</filter>
	
	<filter>
		<name>Right Door</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/gear/gear[2]/position-norm</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.19</ind><dep>1</dep></entry>
					<entry><ind>0.81</ind><dep>1</dep></entry>
					<entry><ind>  1</ind><dep>0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/gear/door-right</output>
	</filter>
	
	<filter>
		<name>Right Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-right</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>100</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-right</output>
	</filter>
	
	<filter>
		<name>Nose Door</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/gear/gear[0]/position-norm</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>0.19</ind><dep>1</dep></entry>
					<entry><ind>0.81</ind><dep>1</dep></entry>
					<entry><ind>  1</ind><dep>0</dep></entry>
				</table>
			</expression>
		</input>
		<output>/systems/hydraulic/gear/door-nose</output>
	</filter>
	
	<filter>
		<name>NLG Left Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-nose</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>95</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-nose-left</output>
	</filter>
	
	<filter>
		<name>NLG Right Door Conversion to Degrees</name>
		<type>gain</type>
		<gain>1.0</gain>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<input>
			<expression>
				<table>
					<property>/systems/hydraulic/gear/door-nose</property>
					<entry><ind>  0</ind><dep>0</dep></entry>
					<entry><ind>  1</ind><dep>-95</dep></entry>
				</table>
			</expression>
		</input>
		<output>/ECAM/Lower/door-nose-right</output>
	</filter>
	
 <!-- =============================================================== -->
 <!-- Autobrake                                                       -->
 <!-- =============================================================== -->

	<filter>
		<name>Autobrake Decel Error</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<dif>
					<property>/velocities/groundspeed-mps</property>
					<property>/velocities/groundspeed-mps-ahead</property>
				</dif>
			</expression>
		</input>
		<output>/controls/autobrake/decel-error</output>
	</filter>
	
	<pi-simple-controller>
		<name>IT-CONTROLLER: AUTOBRAKE DECEL</name>
		<debug>false</debug>
		<enable>
			<condition>
				<equals>
					<property>/controls/autobrake/active</property>
					<value>1</value>
				</equals>
			</condition>
		</enable>
		<input>
			<property>/controls/autobrake/decel-error</property>
		</input>
		<reference>
			<property>/controls/autobrake/decel-rate</property>
		</reference>
		<output>
			<property>/controls/gear/brake-left</property>
			<property>/controls/gear/brake-right</property>
		</output>
		<config>
			<Kp>0.45</Kp>
			<Ki>0.25</Ki>
			<min>0.0</min>
			<max>1.0</max>
		</config>
	</pi-simple-controller>

</PropertyList>