<?xml version="1.0"?>

<!-- Copyright (c) 2021 Josh Davidson (Octal450) -->

<PropertyList>
	
	<filter>
		<name>Ground level diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/position/altitude-agl-ft</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/ground-level-diff</output>
	</filter>
	
	<filter>
		<name>Target alt diff (selected)</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/sel-alt-diff</output>
	</filter>
	
	<filter>
		<name>Target alt diff (managed)</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/mng-alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/mng-alt-diff</output>
	</filter>
	
	<filter>
		<name>Track heading diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/orientation/track-deg</property>
		</input>
		<reference>
			<property>/instrumentation/pfd/heading-deg</property>
		</reference>
		<output>/instrumentation/pfd/track-diff</output>
	</filter>
	
	<filter>
		<name>Heading scale</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<condition>
				<property>/it-autoflight/custom/trk-fpa</property>
			</condition>
			<property>/instrumentation/pfd/track-deg</property>
		</input>
		<input>/instrumentation/pfd/heading-deg</input>
		<output>/instrumentation/pfd/heading-scale</output>
	</filter>
	
	<filter>
		<name>Heading bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/input/hdg</property>
			<period>
				<min>-180.0</min>
				<max>180.0</max>
			</period>
		</input>
		<reference>
			<property>/instrumentation/pfd/heading-scale</property>
			<period>
				<min>-180.0</min>
				<max>180.0</max>
			</period>
		</reference>
		<output>/instrumentation/pfd/hdg-diff</output>
		<period>
			<min>-180.0</min>
			<max>180.0</max>
		</period>
	</filter>
	
	<filter>
		<name>Track bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/instrumentation/pfd/track-deg</property>
			<period>
				<min>-180.0</min>
				<max>180.0</max>
			</period>
		</input>
		<reference>
			<property>/instrumentation/pfd/heading-scale</property>
			<period>
				<min>-180.0</min>
				<max>180.0</max>
			</period>
		</reference>
		<output>/instrumentation/pfd/track-hdg-diff</output>
		<period>
			<min>-180.0</min>
			<max>180.0</max>
		</period>
	</filter>
	
	<filter>
		<name>Altitude bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter[0]/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/alt-diff[0]</output>
	</filter>
	
	<filter>
		<name>Altitude bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter[1]/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/alt-diff[1]</output>
	</filter>
	
	<filter>
		<name>Altitude bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter[2]/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/alt-diff[2]</output>
	</filter>
	
	<filter>
		<name>Altitude bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter[3]/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/alt-diff[3]</output>
	</filter>
	
	<filter>
		<name>Altitude bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter[4]/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/alt-diff[4]</output>
	</filter>
	
	<filter>
		<name>Altitude bug diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/it-autoflight/internal/alt</property>
		</input>
		<reference>
			<property>/instrumentation/altimeter[5]/indicated-altitude-ft</property>
		</reference>
		<output>/instrumentation/pfd/alt-diff[5]</output>
	</filter>
	
	<filter>
		<name>Localizer course diff</name>
		<type>gain</type>
		<update-interval-secs type="double">0.05</update-interval-secs>
		<gain>1.0</gain>
		<input>
			<property>/instrumentation/nav[0]/radials/selected-deg</property>
			<period>
				<min>-180.0</min>
				<max>180.0</max>
			</period>
		</input>
		<reference>
			<property>/instrumentation/pfd/heading-deg</property>
			<period>
				<min>-180.0</min>
				<max>180.0</max>
			</period>
		</reference>
		<output>/instrumentation/pfd/loc-crs-diff</output>
		<period>
			<min>-180.0</min>
			<max>180.0</max>
		</period>
	</filter>
	
	<filter>
		<name>Speed Predictor Input</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<difference>
					<property>/systems/navigation/adr/output/cas-1</property>
					<value>30</value>
				</difference>
			</expression>
		</input>
		<output>/instrumentation/pfd/speed-minus-30-1</output>
		<min>0</min>
		<max>390</max>
	</filter>
	
	<filter>
		<name>Speed Predictor Input</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<difference>
					<property>/systems/navigation/adr/output/cas-2</property>
					<value>30</value>
				</difference>
			</expression>
		</input>
		<output>/instrumentation/pfd/speed-minus-30-2</output>
		<min>0</min>
		<max>390</max>
	</filter>
	
	<filter>
		<name>Speed Predictor Input</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<difference>
					<property>/systems/navigation/adr/output/cas-3</property>
					<value>30</value>
				</difference>
			</expression>
		</input>
		<output>/instrumentation/pfd/speed-minus-30-3</output>
		<min>0</min>
		<max>390</max>
	</filter>
	
	<predict-simple>
		<name>Speed Predictor (Smoothed)</name>
		<debug>false</debug>
		<input>/instrumentation/pfd/speed-minus-30</input>
		<output>/instrumentation/pfd/speed-lookahead-cmd</output>
		<seconds>10.0</seconds>
		<filter-gain>0.01</filter-gain>
	</predict-simple>
	
	<predict-simple>
		<name>Speed Predictor (Smoothed)</name>
		<debug>false</debug>
		<input>/instrumentation/pfd/speed-minus-30-1</input>
		<output>/instrumentation/pfd/speed-lookahead-cmd-1</output>
		<seconds>10.0</seconds>
		<filter-gain>0.01</filter-gain>
	</predict-simple>
	
	<predict-simple>
		<name>Speed Predictor (Smoothed)</name>
		<debug>false</debug>
		<input>/instrumentation/pfd/speed-minus-30-2</input>
		<output>/instrumentation/pfd/speed-lookahead-cmd-2</output>
		<seconds>10.0</seconds>
		<filter-gain>0.01</filter-gain>
	</predict-simple>
	
	<predict-simple>
		<name>Speed Predictor (Smoothed)</name>
		<debug>false</debug>
		<input>/instrumentation/pfd/speed-minus-30-3</input>
		<output>/instrumentation/pfd/speed-lookahead-cmd-3</output>
		<seconds>10.0</seconds>
		<filter-gain>0.01</filter-gain>
	</predict-simple>
	
	<filter>
		<name>Speed Predictor Exponential</name>
		<debug>false</debug>
		<type>exponential</type>
		<input>/instrumentation/pfd/speed-lookahead-cmd-1</input>
		<output>/instrumentation/pfd/speed-lookahead-1</output>
		<filter-time>0.32</filter-time>
	</filter>
	
	<filter>
		<name>Speed Predictor Exponential</name>
		<debug>false</debug>
		<type>exponential</type>
		<input>/instrumentation/pfd/speed-lookahead-cmd-2</input>
		<output>/instrumentation/pfd/speed-lookahead-2</output>
		<filter-time>0.32</filter-time>
	</filter>
	
	<filter>
		<name>Speed Predictor Exponential</name>
		<debug>false</debug>
		<type>exponential</type>
		<input>/instrumentation/pfd/speed-lookahead-cmd-3</input>
		<output>/instrumentation/pfd/speed-lookahead-3</output>
		<filter-time>0.32</filter-time>
	</filter>
	
	<filter>
		<name>Pitch PFD</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<table>
					<property>/orientation/pitch-deg</property>
					<entry><ind>-90.0</ind><dep>-57.50</dep></entry>
					<entry><ind>-80.0</ind><dep>-47.50</dep></entry>
					<entry><ind>-50.0</ind><dep>-32.50</dep></entry>
					<entry><ind>-30.0</ind><dep>-22.50</dep></entry>
					<entry><ind>-20.0</ind><dep>-17.50</dep></entry>
					<entry><ind>-15.0</ind><dep>-13.75</dep></entry>
					<entry><ind>-10.0</ind><dep>-10.00</dep></entry>
					<entry><ind>  0.0</ind><dep>  0.00</dep></entry>
					<entry><ind> 27.5</ind><dep> 27.50</dep></entry>
					<entry><ind> 30.0</ind><dep> 28.75</dep></entry>
					<entry><ind> 50.0</ind><dep> 38.75</dep></entry>
					<entry><ind> 80.0</ind><dep> 53.75</dep></entry>
					<entry><ind> 90.0</ind><dep> 63.75</dep></entry>
				</table>
			</expression>
		</input>
		<output>/instrumentation/pfd/pitch-deg-non-linear</output>
	</filter>
	
	<filter>
		<name>Ground Horizon</name>
		<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>
				<dif>
					<table>
						<property>/position/gear-agl-ft</property> 
						<entry><ind>  1</ind><dep>  0.00</dep></entry>
						<entry><ind>150</ind><dep> 17.35</dep></entry>
					</table>
					<table>
						<property>/instrumentation/pfd/pitch-deg-non-linear</property>
						<entry><ind> 0.00</ind><dep>  0.00</dep></entry>
						<entry><ind>17.35</ind><dep>-17.35</dep></entry>
					</table>
				</dif>
			</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>
				<dif>
					<table>
						<property>/position/gear-agl-ft</property> 
						<entry><ind>  1</ind><dep>  0.00</dep></entry>
						<entry><ind>150</ind><dep> 17.35</dep></entry>
					</table>
					<table>
						<property>/instrumentation/pfd/pitch-deg-non-linear</property>
						<entry><ind>-17.35</ind><dep> 17.35</dep></entry>
						<entry><ind>  0.00</ind><dep>  0.00</dep></entry>
						<entry><ind> 17.35</ind><dep>-17.35</dep></entry>
					</table>
				</dif>
			</expression>
		</input>
		<output>/instrumentation/pfd/horizon-ground</output>
		<min>-17.35</min>
		<max>17.35</max>
	</filter>
	
	<filter>
		<name>Horizon Heading Pitch</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>/instrumentation/pfd/pitch-deg-non-linear</input>
		<output>/instrumentation/pfd/horizon-pitch</output>
		<min>-17.35</min>
		<max>17.35</max>
	</filter>
	
	<filter>
		<name>Vertical Speed Needle</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<table>
					<property>/it-autoflight/internal/vert-speed-fpm</property>
					<entry><ind>-6000</ind><dep>-76.6</dep></entry>
					<entry><ind>-4000</ind><dep>-74.8</dep></entry>
					<entry><ind>-2000</ind><dep>-73.0</dep></entry>
					<entry><ind>-1500</ind><dep>-70.2</dep></entry>
					<entry><ind>-1000</ind><dep>-66.5</dep></entry>
					<entry><ind> -750</ind><dep>-59.8</dep></entry>
					<entry><ind> -500</ind><dep>-49.0</dep></entry>
					<entry><ind> -250</ind><dep>-30.1</dep></entry>
					<entry><ind>    0</ind><dep>  0.0</dep></entry>
					<entry><ind>  250</ind><dep> 30.1</dep></entry>
					<entry><ind>  500</ind><dep> 49.0</dep></entry>
					<entry><ind>  750</ind><dep> 59.8</dep></entry>
					<entry><ind> 1000</ind><dep> 66.5</dep></entry>
					<entry><ind> 1500</ind><dep> 70.2</dep></entry>
					<entry><ind> 2000</ind><dep> 73.0</dep></entry>
					<entry><ind> 4000</ind><dep> 74.8</dep></entry>
					<entry><ind> 6000</ind><dep> 76.6</dep></entry>
				</table>
			</expression>
		</input>
		<output>/instrumentation/pfd/vs-needle</output>
	</filter>
	
	<filter>
		<name>Vertical Speed Digit Translate</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<table>
					<property>/it-autoflight/internal/vert-speed-fpm</property>
					<entry><ind>-6000</ind><dep> 340</dep></entry>
					<entry><ind>-4000</ind><dep> 302</dep></entry>
					<entry><ind>-2000</ind><dep> 269</dep></entry>
					<entry><ind>-1500</ind><dep> 230</dep></entry>
					<entry><ind>-1000</ind><dep> 197</dep></entry>
					<entry><ind> -500</ind><dep> 110</dep></entry>
					<entry><ind> -200</ind><dep>  61</dep></entry>
					<entry><ind>    0</ind><dep>   0</dep></entry>
					<entry><ind>  200</ind><dep> -61</dep></entry>
					<entry><ind>  500</ind><dep>-110</dep></entry>
					<entry><ind> 1000</ind><dep>-197</dep></entry>
					<entry><ind> 1500</ind><dep>-230</dep></entry>
					<entry><ind> 2000</ind><dep>-269</dep></entry>
					<entry><ind> 4000</ind><dep>-302</dep></entry>
					<entry><ind> 6000</ind><dep>-340</dep></entry>
				</table>
			</expression>
		</input>
		<output>/instrumentation/pfd/vs-digit-trans</output>
	</filter>
	
	<filter>
		<name>Slip/Skid Indicator</name>
		<debug>false</debug>
		<type>exponential</type>
		<input>
			<condition>
				<property>/fdm/jsbsim/position/wow</property>
			</condition>
			<expression>
				<product>
					<property>/fdm/jsbsim/accelerations/Ny</property>
					<value>-25</value>
				</product>
			</expression>
		</input>
		<input>/fdm/jsbsim/aero/beta-deg</input>
		<output>/instrumentation/pfd/slip-skid</output>
		<filter-time>0.16</filter-time>
	</filter>
	
	<filter>
		<name>IESI Slip/Skid Indicator</name>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<table>
					<property>/fdm/jsbsim/accelerations/Ny</property>
					<entry><ind>-0.20</ind><dep>-85</dep></entry>
					<entry><ind>-0.01</ind><dep>   0</dep></entry>
					<entry><ind> 0.00</ind><dep>   0</dep></entry>
					<entry><ind> 0.01</ind><dep>   0</dep></entry>
					<entry><ind> 0.20</ind><dep> 85</dep></entry>
				</table>
			</expression>
		</input>
		<output>/instrumentation/iesi/slip-skid</output>
	</filter>
	
	<filter>
		<name>IESI Pitch</name>
		<debug>false</debug>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<table>
					<property>/orientation/pitch-deg</property>
					<entry><ind>-80</ind><dep>-65</dep></entry>
					<entry><ind>-50</ind><dep>-50</dep></entry>
					<entry><ind> 0</ind><dep>   0</dep></entry>
					<entry><ind> 50</ind><dep> 50</dep></entry>
					<entry><ind> 80</ind><dep> 65</dep></entry>
				</table>
			</expression>
		</input>
		<output>/instrumentation/iesi/pitch-deg</output>
	</filter>
	
	<filter>
		<name>Wind East</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<difference>
					<product>
						<property>/velocities/speed-east-fps</property>
						<value>0.592484</value> <!-- fps to kt -->
					</product>
					<product>
						<cos><deg2rad><property>/orientation/pitch-deg</property></deg2rad></cos>
						<sin><deg2rad><property>/orientation/heading-deg</property></deg2rad></sin>
						<!--<floor>-->
							<property>/systems/navigation/adr/output/tas-3</property>
							<!--<value>100</value>
						</floor>-->
					</product>
				</difference>
			</expression>
		</input>
		<output>/instrumentation/pfd/wind-speed-east</output>
		<min>-4096</min>
		<max>4096</max>
	</filter>
	
	<filter>
		<name>Wind North</name>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<expression>
				<difference>
					<product>
						<property>/velocities/speed-north-fps</property>
						<value>0.592484</value> <!-- fps to kt -->
					</product>
					<product>
						<cos><deg2rad><property>/orientation/pitch-deg</property></deg2rad></cos>
						<cos><deg2rad><property>/orientation/heading-deg</property></deg2rad></cos>
						<!--<floor>-->
							<property>/systems/navigation/adr/output/tas-3</property>
							<!--<value>100</value>
						</floor>-->
					</product>
				</difference>
			</expression>
		</input>
		<output>/instrumentation/pfd/wind-speed-north</output>
		<min>-4096</min>
		<max>4096</max>
	</filter>

	<filter>
		<name>Wind Direction</name>
		<type>exponential</type>
		<filter-time>1.28</filter-time>
		<input>
			<expression>
				<sum>
					<rad2deg>
						<atan2>
							<property>/instrumentation/pfd/wind-speed-east</property>
							<property>/instrumentation/pfd/wind-speed-north</property>
						</atan2>
					</rad2deg>
					<value>180</value>
				</sum>
			</expression>
		</input>
		<output>/instrumentation/pfd/wind-direction</output>
		<period>
			<min>0</min>
			<max>360</max>
		</period>
	</filter>

	<filter>
		<name>Wind Speed</name>
		<type>exponential</type>
		<filter-time>1.28</filter-time>
		<input>
			<expression>
				<sqrt>
					<sum>
						<pow>
							<property>/instrumentation/pfd/wind-speed-east</property>
							<value>2</value>
						</pow>
						<pow>
							<property>/instrumentation/pfd/wind-speed-north</property>
							<value>2</value>
						</pow>
					</sum>
				</sqrt>
			</expression>
		</input>
		<output>/instrumentation/pfd/wind-speed</output>
		<min>0</min>
		<max>256</max>
	</filter>
	
</PropertyList>