<?xml version="1.0"?>

<!--
 This file is part of FlightGear, the free flight simulator
 http://www.flightgear.org/

 Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de

 This program 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.

 This program 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.
-->
<!--
  Animations for the ki209 vor/loc/gs indicator
  Maintainer: Torsten Dreyer
  Updated by Josh Davidson (Octal450)
-->

<PropertyList>
	
	<path>ki209a.ac</path>
	
	<params>
		<selected-radial>instrumentation/nav[0]/radials/selected-deg</selected-radial>
		<signal-quality>instrumentation/nav[0]/signal-quality-norm</signal-quality>
		<to-flag>instrumentation/nav[0]/to-flag</to-flag>
		<from-flag>instrumentation/nav[0]/from-flag</from-flag>
		<gs-needle-deflection>instrumentation/nav[0]/gs-needle-deflection-norm-lag</gs-needle-deflection>
		<heading-needle-deflection>instrumentation/nav[0]/heading-needle-deflection-norm-lag</heading-needle-deflection>
		<has-gs>instrumentation/nav[0]/has-gs</has-gs>
		<in-range>instrumentation/nav[0]/in-range</in-range>
		<nav-flag>instrumentation/nav[0]/nav-flag</nav-flag>
	</params>
	
	<animation>
		<type>material</type>
		<object-name>BackPlate</object-name>
		<object-name>CompassRose</object-name>
		<object-name>TO</object-name>
		<object-name>FROM</object-name>
		<object-name>LOCIndicator</object-name>
		<object-name>GSIndicator</object-name>
		<object-name>NAV</object-name>
		<object-name>GS</object-name>
		<object-name>Marker</object-name>
		<emission>
			<red>0.6</red>
			<green>0.6</green>
			<blue>0.6</blue>
			<factor-prop>controls/lighting/panel-norm</factor-prop>
		</emission>
	</animation>
	
	<animation>
		<type>rotate</type>
		<object-name>CompassRose</object-name>
		<property alias="../../params/selected-radial"/>
		<factor>1.0</factor>
		<axis>
			<x>1.0</x>
			<y>0.0</y>
			<z>0.0</z>
		</axis>
		<center>
			<x-m>-0.001</x-m>
			<y-m>0</y-m>
			<z-m>0</z-m>
		</center>
	</animation>
	
	<animation>
		<type>rotate</type>
		<object-name>NAV</object-name>
		<property alias="../../params/nav-flag"/>
		<factor>45</factor>
		<axis>
			<x>-1.0</x>
			<y>0.0</y>
			<z>0.0</z>
		</axis>
		<center>
			<x-m>0</x-m>
			<y-m>0</y-m>
			<z-m>0.01713</z-m>
		</center>
	</animation>
	
	<animation>
		<type>rotate</type>
		<object-name>GS</object-name>
		<property alias="../../params/nav-flag"/>
		<factor>45</factor>
		<axis>
			<x>-1.0</x>
			<y>0.0</y>
			<z>0.0</z>
		</axis>
		<center>
			<x-m>0</x-m>
			<y-m>-0.01722</y-m>
			<z-m>0</z-m>
		</center>
	</animation>
	
	<animation>
		<type>translate</type>
		<object-name>TO</object-name>
		<property alias="../../params/to-flag"/>
		<factor>0.00707069</factor>
		<axis>
			<x>0.0</x>
			<y>0.0</y>
			<z>1.0</z>
		</axis>
	</animation>
	
	<animation>
		<type>translate</type>
		<object-name>FROM</object-name>
		<property alias="../../params/from-flag"/>
		<factor>-0.00707069</factor>
		<axis>
			<x>0.0</x>
			<y>0.0</y>
			<z>1.0</z>
		</axis>
	</animation>
	
	<animation>
		<type>translate</type>
		<object-name>LOCIndicator</object-name>
		<property alias="../../params/heading-needle-deflection"/>
		<factor>0.01612</factor>
		<axis>
			<x>0.0</x>
			<y>1.0</y>
			<z>0.0</z>
		</axis>
	</animation>
	
	<animation>
		<type>translate</type>
		<object-name>GSIndicator</object-name>
		<property alias="../../params/gs-needle-deflection"/>
		<factor>0.01612</factor>
		<axis>
			<x>0.0</x>
			<y>0.0</y>
			<z>1.0</z>
		</axis>
	</animation>
	
	<animation>
		<type>rotate</type>
		<object-name>OBSSelector</object-name>
		<property alias="../../params/selected-radial"/>
		<factor>-6.0</factor>
		<axis>
			<x>1.0</x>
			<y>0.0</y>
			<z>0.0</z>
		</axis>
		<center>
			<x-m>0</x-m>
			<y-m>-0.0318071</y-m>
			<z-m>-0.0327009</z-m>
		</center>
	</animation>
	
	<animation>
		<type>pick</type>
		<object-name>OBSSelector</object-name>
		<visible>true</visible>
		<action>
			<button>0</button>
			<button>3</button>
			<repeatable>true</repeatable>
			<binding>
				<condition>
					<not><property>devices/status/keyboard/shift</property></not>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/selected-radial"/>
				<step>1</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<property>devices/status/keyboard/shift</property>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/selected-radial"/>
				<step>10</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
		</action>
		<action>
			<button>1</button>
			<button>4</button>
			<repeatable>true</repeatable>
			<binding>
				<condition>
					<not><property>devices/status/keyboard/shift</property></not>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/selected-radial"/>
				<step>-1</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<property>devices/status/keyboard/shift</property>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/selected-radial"/>
				<step>-10</step>
				<min>1</min>
				<max>361</max>
				<wrap>true</wrap>
			</binding>
		</action>
		<hovered>
			<binding>
				<command>set-tooltip</command>
				<tooltip-id>nav1-obs</tooltip-id>
				<label>Nav 1 Course %3d</label>
				<mapping>nav1obs</mapping>
				<property>instrumentation/nav[0]/radials/selected-deg</property>
			</binding>
		</hovered>
	</animation>

</PropertyList>
