<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
	<!--
  Bendix/King KX155/165 COMM/NAV radio
  Use this instrument as COMM1/NAV1 radio

  Created by Torsten Dreyer, October 2008

  You might want to use the following code in your aircraft's nasal
  init function to keep the settings of the radio persistent between
  flightgear sessions

  aircraft.data.add(
    "instrumentation/comm[0]/volume",
    "instrumentation/comm[0]/frequencies/selected-mhz",
    "instrumentation/comm[0]/frequencies/standby-mhz",
    "instrumentation/nav[0]/volume",
    "instrumentation/nav[0]/frequencies/selected-mhz",
    "instrumentation/nav[0]/frequencies/standby-mhz",
  );

modified for Garmin GNC255A by D-ECHO, March 2016 
  -->
	<params>
		<power-nav>instrumentation/nav[0]/power-btn</power-nav>
		<power-comm>instrumentation/comm[0]/power-btn</power-comm>
		<comm-frq-swp>instrumentation/comm[0]/frq-swap-btn</comm-frq-swp>
		<comm-frq-selected>instrumentation/comm[0]/frequencies/selected-mhz</comm-frq-selected>
		<comm-frq-standby>instrumentation/comm[0]/frequencies/standby-mhz</comm-frq-standby>
		<comm-volume>instrumentation/comm[0]/volume</comm-volume>
		<nav-frq-swp>instrumentation/nav[0]/frq-swap-btn</nav-frq-swp>
		<nav-frq-selected>instrumentation/nav[0]/frequencies/selected-mhz</nav-frq-selected>
		<nav-frq-standby>instrumentation/nav[0]/frequencies/standby-mhz</nav-frq-standby>
		<nav-volume>instrumentation/nav[0]/volume</nav-volume>
		<mhz-knob>instrumentation/gnc255a/mhz-knob</mhz-knob>
		<khz-knob>instrumentation/gnc255a/khz-knob</khz-knob>
		<dimming>instrumentation/comm[0]/dimming-norm</dimming>
		<red>1</red>
		<green>1</green>
		<blue>1</blue>
	</params>
	<path>gnc255a.ac</path>
	<!--To adjust later-->
	<animation>
		<object-name>gnc255a.base</object-name>
		<object-name>tune.kHz</object-name>
		<object-name>tune.mHz</object-name>
		<object-name>offdisplay</object-name>
		<object-name>mon</object-name>
		<object-name>nav</object-name>
		<object-name>com.volume</object-name>
		<object-name>nav.volume</object-name>
		<object-name>cn</object-name>
		<object-name>obs</object-name>
		<object-name>swap</object-name>
		<object-name>ent</object-name>
		<object-name>clr</object-name>
		<object-name>func</object-name>
		<object-name>tf</object-name>
		<object-name>gnc255a.screen</object-name>
	</animation>
	<!--Comm/Nav Button-->
	<animation>
		<type>pick</type>
		<object-name>cn</object-name>
		<visible>true</visible>
		<action>
			<button>0</button>
			<repeatable>false</repeatable>
			<binding>
				<command>property-toggle</command>
				<property>/instrumentation/gnc255a/comm-mode</property>
			</binding>
			<binding>
				<command>property-toggle</command>
				<property>/instrumentation/gnc255a/cn-btn</property>
			</binding>
			<mod-up>
				<binding>
					<command>property-toggle</command>
					<property>/instrumentation/gnc255a/cn-btn</property>
				</binding>
			</mod-up>
		</action>
	</animation>
	<animation>
		<type>translate</type>
		<object-name>cn</object-name>
		<property>/instrumentation/gnc255a/cn-btn</property>
		<factor>-0.002</factor>
		<axis>
			<x>1</x>
			<y>0</y>
			<z>0</z>
		</axis>
	</animation>
	<!--SWAP button-->
	<animation>
		<type>pick</type>
		<object-name>swap</object-name>
		<visible>true</visible>
		<action>
			<button>0</button>
			<repeatable>false</repeatable>
			<!--if COMM mode-->
			<binding>
				<condition>
					<property>/instrumentation/gnc255a/comm-mode</property>
				</condition>
				<command>property-assign</command>
				<property alias="../../../../params/comm-frq-swp"/>
				<value type="int">1</value>
			</binding>
			<binding>
				<condition>
					<property>/instrumentation/gnc255a/comm-mode</property>
				</condition>
				<command>property-swap</command>
				<property alias="../../../../params/comm-frq-selected"/>
				<property alias="../../../../params/comm-frq-standby"/>
			</binding>
			<mod-up>
				<binding>
					<condition>
						<property>/instrumentation/gnc255a/comm-mode</property>
					</condition>
					<command>property-assign</command>
					<property alias="../../../../../params/comm-frq-swp"/>
					<value type="int">0</value>
				</binding>
			</mod-up>
			<!--If NAV mode-->
			<binding>
				<condition>
					<not>
						<property>/instrumentation/gnc255a/comm-mode</property>
					</not>
				</condition>
				<command>property-swap</command>
				<property alias="../../../../params/nav-frq-selected"/>
				<property alias="../../../../params/nav-frq-standby"/>
			</binding>
		</action>
	</animation>
	<animation>
		<type>translate</type>
		<object-name>swap</object-name>
		<property alias="../../params/comm-frq-swp"/>
		<factor>-0.002</factor>
		<axis>
			<x>1</x>
			<y>0</y>
			<z>0</z>
		</axis>
	</animation>
	<!-- actions -->
	<!-- Comm part -->
	<animation>
		<type>knob</type>
		<object-name>com.volume</object-name>
		<property alias="../../params/comm-volume"/>
		<factor>-65</factor>
		<axis>
			<x>1</x>
			<y>0</y>
			<z>0</z>
		</axis>
		<center>
			<y-m>-0.066748</y-m>
			<z-m>0.011599</z-m>
		</center>
		<action>
			<binding>
				<command>property-adjust</command>
				<property alias="../../../../params/comm-volume"/>
				<factor>-0.1</factor>
				<min>0.0</min>
				<max>1.0</max>
				<wrap>false</wrap>
			</binding>
		</action>
		<hovered>
			<binding>
				<command>set-tooltip</command>
				<tooltip-id>comm-volume</tooltip-id>
				<label>Volume: %3d%%</label>
				<property alias="../../../../params/comm-volume"/>
				<mapping>percent</mapping>
			</binding>
		</hovered>
	</animation>
	<animation>
		<type>knob</type>
		<object-name>tune.kHz</object-name>
		<property alias="../../params/khz-knob"/>
		<factor>1</factor>
		<axis>
			<x>1</x>
			<y>0</y>
			<z>0</z>
		</axis>
		<center>
			<y-m>0.069046</y-m>
			<z-m>-0.010416</z-m>
		</center>
		<action>
			<binding>
				<condition>
					<property>/instrumentation/gnc255a/comm-mode</property>
					<property alias="../../../../../params/power-comm"/>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/comm-frq-standby"/>
				<factor>0.025</factor>
				<min>0.0</min>
				<max>1.0</max>
				<resolution>0.025</resolution>
				<wrap>true</wrap>
				<mask>decimal</mask>
			</binding>
			<binding>
				<condition>
					<not>
						<property>/instrumentation/gnc255a/comm-mode</property>
					</not>
					<property alias="../../../../../params/power-comm"/>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/nav-frq-standby"/>
				<factor>0.025</factor>
				<min>0.0</min>
				<max>1.0</max>
				<resolution>0.025</resolution>
				<wrap>true</wrap>
				<mask>decimal</mask>
			</binding>
			<binding>
				<command>property-adjust</command>
				<property alias="../../../../params/khz-knob"/>
				<factor>-6</factor>
				<min>0</min>
				<max>360</max>
				<wrap>true</wrap>
			</binding>
		</action>
	</animation>
	<animation>
		<type>knob</type>
		<object-name>tune.mHz</object-name>
		<property alias="../../params/mhz-knob"/>
		<factor>1</factor>
		<axis>
			<x>1</x>
			<y>0</y>
			<z>0</z>
		</axis>
		<center>
			<y-m>0.069046</y-m>
			<z-m>-0.010416</z-m>
		</center>
		<action>
			<binding>
				<condition>
					<property>/instrumentation/gnc255a/comm-mode</property>
					<property alias="../../../../../params/power-comm"/>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/comm-frq-standby"/>
				<factor>1</factor>
				<min>118.0</min>
				<max>137.0</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<condition>
					<not>
						<property>/instrumentation/gnc255a/comm-mode</property>
					</not>
					<property alias="../../../../../params/power-comm"/>
				</condition>
				<command>property-adjust</command>
				<property alias="../../../../params/nav-frq-standby"/>
				<factor>1</factor>
				<min>108.0</min>
				<max>118.0</max>
				<wrap>true</wrap>
			</binding>
			<binding>
				<command>property-adjust</command>
				<property alias="../../../../params/mhz-knob"/>
				<factor>-6</factor>
				<min>0</min>
				<max>360</max>
				<wrap>true</wrap>
			</binding>
		</action>
	</animation>
	<!-- Nav part -->
	<animation>
		<type>knob</type>
		<object-name>nav.volume</object-name>
		<property alias="../../params/nav-volume"/>
		<factor>-65</factor>
		<axis>
			<x>1</x>
			<y>0</y>
			<z>0</z>
		</axis>
		<center>
			<y-m>-0.066748</y-m>
			<z-m>-0.01073</z-m>
		</center>
		<action>
			<binding>
				<command>property-adjust</command>
				<property alias="../../../../params/nav-volume"/>
				<factor>-0.1</factor>
				<min>0.0</min>
				<max>1.0</max>
				<wrap>false</wrap>
			</binding>
		</action>
		<hovered>
			<binding>
				<command>set-tooltip</command>
				<tooltip-id>nav-volume</tooltip-id>
				<label>Volume: %3d%%</label>
				<property alias="../../../../params/nav-volume"/>
				<mapping>percent</mapping>
			</binding>
		</hovered>
	</animation>
</PropertyList>
