<?xml version="1.0"?>
<!--
    This file is part of do228

    The do228 is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    The do228 is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with do228.  If not, see <http://www.gnu.org/licenses/>.

    Dornier DO228 simulation by Bea Wolf (D-ECHO)
    Started 06/2020
-->

<!--	Universal EFI-890R simulation
		References:	http://www.uasc.com/home/shop/avionics/efi-890r
				https://www.uasc.com/docs/default-source/documents/brochures/uasc_efi-890r_brochure.pdf?sfvrsn=9e13985c_4
				Dornier 228-212 POH (ref. [1], see do228-212.xml)
				-->
				
<PropertyList>

	<path>pfdcp.ac</path>
	
	<params>
		<baro type="string">instrumentation/altimeter[0]/setting-hpa</baro>
		<baro-min-knob type="string">instrumentation/efi-890r[0]/baro-minimums-knob</baro-min-knob>
		<nav-src-current type="string">instrumentation/efi-890r[0]/nav-source-current-selection</nav-src-current>
		<nav-src-knob type="string">instrumentation/efi-890r[0]/nav-source-knob</nav-src-knob>
		<nav-src type="string" n="0">instrumentation/efi-890r[0]/nav-source[0]</nav-src>
		<nav-src type="string" n="1">instrumentation/efi-890r[0]/nav-source[1]</nav-src>
		<nav-src type="string" n="2">instrumentation/efi-890r[0]/nav-source[2]</nav-src>
		<nav-src type="string" n="3">instrumentation/efi-890r[0]/nav-source[3]</nav-src>
		<minimums-setting type="string">instrumentation/efi-890r[0]/minimums</minimums-setting>
		<ra type="string">instrumentation/efi-890r[0]/radio-alt-minimums</ra>
		<da type="string">instrumentation/efi-890r[0]/decision-alt</da>
	</params>
	
	<!--
	#######################
		Animations	
	####################### -->
	<!--	Lighting	-->
	<animation>
		<type>material</type>
		<object-name>pfdcp.lit</object-name>
		<object-name>pfdcp.knob.range_opt.lit</object-name>
		<object-name>pfdcp.knob.nav_brg.lit</object-name>
		<object-name>pfdcp.knob.baro.lit</object-name>
		<object-name>pfdcp.btn.display_revert.lit</object-name>
		<object-name>pfdcp.btn.ra_da.lit</object-name>
		<object-name>pfdcp.btn.att_hdg_revert.lit</object-name>
		<object-name>pfdcp.btn.blank.lit</object-name>
		<object-name>pfdcp.btn.tfc.lit</object-name>
		<object-name>pfdcp.btn.adc_revert.lit</object-name>
		<object-name>pfdcp.btn.src_xfer.lit</object-name>
		<object-name>pfdcp.btn.terr.lit</object-name>
		<object-name>pfdcp.btn.wx.lit</object-name>
		<emission>
			<red>1</red>
			<green>1</green>
			<blue>1</blue>
			<factor-prop>systems/electrical/lights/panel-lights[1]</factor-prop>
		</emission>
	</animation>
	<animation>
		<object-name>pfdcp</object-name>
		<object-name>pfdcp.knob.range_opt</object-name>
		<object-name>pfdcp.knob.nav_brg</object-name>
		<object-name>pfdcp.knob.baro</object-name>
		<object-name>pfdcp.btn.display_revert</object-name>
		<object-name>pfdcp.btn.ra_da</object-name>
		<object-name>pfdcp.btn.att_hdg_revert</object-name>
		<object-name>pfdcp.btn.blank</object-name>
		<object-name>pfdcp.btn.tfc</object-name>
		<object-name>pfdcp.btn.adc_revert</object-name>
		<object-name>pfdcp.btn.src_xfer</object-name>
		<object-name>pfdcp.btn.terr</object-name>
		<object-name>pfdcp.btn.wx</object-name>
	</animation>
	
	<effect>
		<inherits-from>Effects/model-transparent</inherits-from>
		<object-name>pfdcp.lit</object-name>
		<object-name>pfdcp.knob.range_opt.lit</object-name>
		<object-name>pfdcp.knob.nav_brg.lit</object-name>
		<object-name>pfdcp.knob.baro.lit</object-name>
		<object-name>pfdcp.btn.display_revert.lit</object-name>
		<object-name>pfdcp.btn.ra_da.lit</object-name>
		<object-name>pfdcp.btn.att_hdg_revert.lit</object-name>
		<object-name>pfdcp.btn.blank.lit</object-name>
		<object-name>pfdcp.btn.tfc.lit</object-name>
		<object-name>pfdcp.btn.adc_revert.lit</object-name>
		<object-name>pfdcp.btn.src_xfer.lit</object-name>
		<object-name>pfdcp.btn.terr.lit</object-name>
		<object-name>pfdcp.btn.wx.lit</object-name>
	</effect>
	
	<!-- Ref. [1], p.7-155ff. -->
	<animation>
		<type>knob</type>
		<object-name>pfdcp.knob.baro</object-name>
		<property alias="/params/baro-min-knob"/>
		<factor>-1</factor>
		<axis>
			<x>1</x>
		</axis>
		<center>
			<y-m>0.042478</y-m>
			<z-m>0.006491</z-m>
		</center>
		<action>
			<binding>
				<command>property-adjust</command>
				<property alias="/params/baro-min-knob"/>
				<min>0</min>
				<max>360</max>
				<factor>5</factor>
				<wrap>1</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/minimums-setting" />
						<value>0</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/baro"/>
				<min>700</min>
				<max>1050</max>
				<factor>1</factor>
				<wrap>0</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/minimums-setting" />
						<value>1</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/ra"/>
				<min>0</min>
				<max>500</max>
				<factor>1</factor>
				<wrap>0</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/minimums-setting" />
						<value>2</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/da"/>
				<min>0</min>
				<max>50000</max>
				<factor>100</factor>
				<wrap>0</wrap>
			</binding>
		</action>
	</animation>
	<animation>
		<type>pick</type>
		<object-name>pfdcp.btn.ra_da</object-name>
		<action>
			<button>0</button>
			<binding>
				<command>property-cycle</command>
				<property alias="/params/minimums-setting" />
				<value>1</value>
				<value>2</value>
				<value>0</value>
			</binding>
		</action>
	</animation>

	<!-- Ref. [1], p.7-163f. -->
	<animation>
		<type>knob</type>
		<object-name>pfdcp.knob.nav_brg</object-name>
		<property alias="/params/nav-src-knob"/>
		<factor>-1</factor>
		<axis>
			<x>1</x>
		</axis>
		<center>
			<y-m>0.0     </y-m>
			<z-m>0.006491</z-m>
		</center>
		<action>
			<binding>
				<command>property-adjust</command>
				<property alias="/params/nav-src-knob"/>
				<min>0</min>
				<max>360</max>
				<factor>5</factor>
				<wrap>1</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/nav-src-current" />
						<value>1</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/nav-src[0]"/>
				<min>0</min>
				<max>4</max>
				<factor>1</factor>
				<wrap>0</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/nav-src-current" />
						<value>2</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/nav-src[1]"/>
				<min>0</min>
				<max>4</max>
				<factor>1</factor>
				<wrap>0</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/nav-src-current" />
						<value>3</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/nav-src[2]"/>
				<min>0</min>
				<max>4</max>
				<factor>1</factor>
				<wrap>0</wrap>
			</binding>
			<binding>
				<condition>
					<equals>
						<property alias="/params/nav-src-current" />
						<value>4</value>
					</equals>
				</condition>
				<command>property-adjust</command>
				<property alias="/params/nav-src[3]"/>
				<min>0</min>
				<max>4</max>
				<factor>1</factor>
				<wrap>0</wrap>
			</binding>
		</action>
	</animation>
	<animation>
		<type>pick</type>
		<object-name>pfdcp.knob.nav_brg.lit</object-name>
		<action>
			<button>0</button>
			<binding>
				<command>property-adjust</command>
				<property alias="/params/nav-src-current" />
				<step>1</step>
				<min>0</min>
				<max>4.01</max>
				<wrap>1</wrap>
			</binding>
		</action>
	</animation>
    
</PropertyList>
