<?xml version="1.0"?>

<!-- This autopilot file switches between S-TEC 55X and KAP140 -->

<PropertyList>
	
	<filter>
		<name>S-TEC 55X HDG Sync</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>/autopilot/settings/heading-bug-deg</input>
		<output>/it-stec55x/input/hdg</output>
	</filter>
	
	<filter>
		<name>HSI Installed</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<equals>
					<property>/options/panel</property>
					<value>HSI Panel</value>
				</equals>
			</condition>
			<value>1</value>
		</input>
		<input>0</input>
		<output>/autopilot/kap140/config/hsi-installed</output>
	</filter>
	
	<filter>
		<name>max-rate</name>
		<type>gain</type>
		<input>
			<condition>
				<and>
					<equals>
						<property>/options/autopilot</property>
						<value>KAP140</value>
					</equals>
					<equals>
						<property>autopilot/kap140/panel/state</property>
						<value>6</value>
					</equals>
					<not><property>autopilot/kap140/settings/cws</property></not>
				</and>
			</condition>
			<value>0.1</value>
		</input>
		<input>
			<value>100.0</value>
		</input>
		<output>autopilot/internal/max-rate-of-change</output>
	</filter>

	<filter>
		<name>AILERON OUTPUT KAP140</name>
		<type>noise-spike</type>
		<enable>
			<condition>
				<and>
					<equals>
						<property>/autopilot/kap140/panel/state</property>
						<value>6</value>
					</equals>
					<not><property>/autopilot/kap140/settings/cws</property></not>
					<equals>
						<property>/options/autopilot</property>
						<value>KAP140</value>
					</equals>
				</and>
			</condition>
		</enable>
		<input>autopilot/kap140/servo/aileron</input>
		<output>controls/flight/aileron</output>
		<max-rate-of-change>autopilot/internal/max-rate-of-change</max-rate-of-change>
	</filter>

	<filter>
		<name>ELEVATOR OUTPUT KAP140</name>
		<debug>false</debug>
		<type>noise-spike</type>
		<enable>
			<condition>
				<and>
					<equals>
						<property>/autopilot/kap140/panel/state</property>
						<value>6</value>
					</equals>
					<not><property>/autopilot/kap140/settings/cws</property></not>
					<equals>
						<property>/options/autopilot</property>
						<value>KAP140</value>
					</equals>
				</and>
			</condition>
		</enable>
		<input>/autopilot/kap140/servo/elevator</input>
		<output>/controls/flight/elevator</output>
		<max-rate-of-change>/autopilot/internal/max-rate-of-change</max-rate-of-change>
	</filter>

</PropertyList>
