<?xml version="1.0"?>
<!--
*************************************************************************************
AS-332 by HB-GRAL. Original XML/NASAL from bo105 by Melchior Franz, Maik Justus (FDM)
*************************************************************************************
-->

<PropertyList>
	<sim>
		<description>Aerospatiale AS-332 L1</description>
		<author>HB-GRAL (AS-332), Melchior Franz (XML/NASAL from BO105), Maik Justus (FDM)</author>
		<status>development</status>
		<license>GPL v2</license>
		<version>v20091120</version>

		<flight-model>yasim</flight-model>
		<aero>as332</aero>
		<fuel-fraction>1.0</fuel-fraction>

		<startup>
			<splash-texture>Aircraft/as332/splash.png</splash-texture>
		</startup>

		<instrumentation>
			<path>Aircraft/as332/Instruments/instrumentation.xml</path>
		</instrumentation>

		<sound>
			<path>Aircraft/as332/Sounds/sound.xml</path>
		</sound>


		<panel>
			<visibility archive="n">false</visibility>
		</panel>

		<model>
			<path archive="y">Aircraft/as332/Models/as332.xml</path>
			<as332>
				<tail-angle-deg type="int" archive="y">0</tail-angle-deg>
				<state type="int">0</state>
				<rotor-step-deg type="float">-1.0</rotor-step-deg>

				<particles>
					<enabled type="bool">true</enabled>
				</particles>
			</as332>

		</model>

		
		

		<view n="0">
			<internal archive="y">true</internal>
			<config>
				<x-offset-m archive="y">0.55</x-offset-m><!--right-->
				<y-offset-m archive="y">1.1</y-offset-m><!--up-->
				<z-offset-m archive="y">-3.2</z-offset-m><!--back-->
				<pitch-offset-deg>-14</pitch-offset-deg>
				<limits>
					<enabled type="bool">true</enabled>
					<left>
						<heading-max-deg type="double">160</heading-max-deg>
						<x-offset-max-m type="double">0.30</x-offset-max-m>
						<x-offset-threshold-deg type="double">65</x-offset-threshold-deg>
					</left>
					<right>
						<heading-max-deg type="double">140</heading-max-deg>
						<x-offset-max-m type="double">0.15</x-offset-max-m>
						<x-offset-threshold-deg type="double">65</x-offset-threshold-deg>
					</right>
				</limits>
			</config>
		</view>

		<view n="1">
			<config>
				<target-z-offset-m archive="y" type="double">2.5</target-z-offset-m>
			</config>
		</view>

		<view n="2">
			<config>
				<target-z-offset-m archive="y" type="double">2.5</target-z-offset-m>
			</config>
		</view>

		<view n="3">
			<config>
				<target-z-offset-m archive="y" type="double">2.5</target-z-offset-m>
			</config>
		</view>

		<view n="4">
			<config>
				<target-z-offset-m archive="y" type="double">2.5</target-z-offset-m>
			</config>
		</view>

		<view n="5">
			<config>
				<target-z-offset-m archive="y" type="double">2.5</target-z-offset-m>
			</config>
		</view>

		<view n="6">
			<config>
				<target-z-offset-m archive="y" type="double">2.5</target-z-offset-m>
			</config>
		</view>

		<view n="100">
			<name>Belly View</name>
			<enabled type="bool">false</enabled>
			<type>lookfrom</type>
			<internal archive="y">true</internal>
			<config>
				<from-model type="bool">true</from-model>
				<from-model-idx type="int">0</from-model-idx>
				<x-offset-m archive="y">0</x-offset-m>    <!-- right? -->
				<y-offset-m archive="y">-1</y-offset-m>   <!-- up -->
				<z-offset-m archive="y">3.5</z-offset-m>  <!-- back -->
				<pitch-offset-deg>0</pitch-offset-deg>
				<ground-level-nearplane-m type="double">0.05f</ground-level-nearplane-m>
				<default-field-of-view-deg type="double">55.0</default-field-of-view-deg>
				<default-pitch-deg type="double">-15</default-pitch-deg>
				<default-heading-deg type="double">0</default-heading-deg>
				<front-direction-deg type="double">0</front-direction-deg>
				<front-left-direction-deg type="double">45</front-left-direction-deg>
				<left-direction-deg type="double">90</left-direction-deg>
				<back-left-direction-deg type="double">135</back-left-direction-deg>
				<back-direction-deg type="double">180</back-direction-deg>
				<back-right-direction-deg type="double">225</back-right-direction-deg>
				<right-direction-deg type="double">270</right-direction-deg>
				<front-right-direction-deg type="double">315</front-right-direction-deg>
				<default-field-of-view-deg>55</default-field-of-view-deg>
			</config>
		</view>

		<hud>
			<enable3d>false</enable3d>
		</hud>

		<weight n="0">
			<name>Pilot</name>
			<weight-lb>180</weight-lb>
			<max-lb>300</max-lb>
		</weight>

		<weight n="1">
			<name>Co-Pilot</name>
			<weight-lb>180</weight-lb>
			<max-lb>300</max-lb>
		</weight>

		<weight n="5">
			<name>Load</name>
			<weight-lb>0</weight-lb>
			<max-lb>800</max-lb>
		</weight>

		<menubar>
			<default>
				<menu n="100">
					<label>AS-332</label>
					<item>
						<label>Autostart</label>
						<binding>
							<command>nasal</command>
							<script>as332.startup()</script>
						</binding>
					</item>
					<item>
						<label>Autoshutdown</label>
						<binding>
							<command>nasal</command>
							<script>as332.shutdown()</script>
						</binding>
					</item>
				</menu>
			</default>
		</menubar>


		<help>
			<title>as332</title>
			<key>
				<name>{ }</name>
				<desc>shutdown/start turbines</desc>
			</key>
			<key>
				<name>i</name>
				<desc>toggle ignition switch</desc>
			</key>
			<key>
				<name>m/M</name>
				<desc>shift engine balance to right/left engine</desc>
			</key>
			<key>
				<name>n/N</name>
				<desc>engine power adjustment up/down</desc>
			</key>
			<key>
				<name>r</name>
				<desc>apply rotor brake</desc>
			</key>
			<key>
				<name>b</name>
				<desc>brake</desc>
			</key>
			<key>
				<name>B</name>
				<desc>toggle parking brake</desc>
			</key>
			<key>
				<name>R</name>
				<desc>toggle rotor brake</desc>
			</key>
			<key>
				<name>MMB</name>
				<desc>adjust power lever (middle mouse button)</desc>
			</key>
		</help>
	</sim>

	<consumables>
		<fuel>
			<tank>
				<name>Main</name>
				<selected type="bool" write="n">1</selected>
				<density-ppg type="double" write="n">6.682</density-ppg>
			</tank>

			<tank>
				<name>Supply</name>
				<selected type="bool" write="n">1</selected>
				<density-ppg type="double" write="n">6.682</density-ppg>
			</tank>
		</fuel>
	</consumables>

	<controls>
		<rotor>
			<reltarget type="double">0</reltarget>
			<maxreltorque type="double">0</maxreltorque>
		</rotor>
		
		<gear>
            <brake-parking>1</brake-parking>
        </gear>


		<engines>
			<engine n="0">
				<magnetos>1</magnetos>
				<propeller-pitch alias="/controls/engines/power-trim"/>
				<mixture alias="/controls/engines/power-balance"/>
			</engine>
			<engine n="1">
				<magnetos>1</magnetos>
				<propeller-pitch alias="/controls/engines/power-trim"/>
				<mixture alias="/controls/engines/power-balance"/>
				<throttle alias="/controls/engines/engine[0]/throttle"/>
			</engine>
			<power-trim type="double">0</power-trim>
			<power-balance type="double">0</power-balance>
		</engines>

		<lighting>
			<strobe type="bool">true</strobe>
			<beacon type="bool">true</beacon>
			<nav-lights type="bool">true</nav-lights>
		</lighting>
	</controls>


	<input>
		<keyboard>

			




			<key n="82">
				<name>R</name>
				<desc>Toggle rotor brake</desc>
				<binding>
					<command>nasal</command>
					<script>
						var p = "/controls/rotor/brake";
						setprop(p, !getprop(p));
					</script>
				</binding>
			</key>



			<key n="105">
				<name>i</name>
				<desc>Toggle ignition switch</desc>
				<binding>
					<command>nasal</command>
					<script>
						foreach (var e; controls.engines) {
							if (e.selected.getValue()) {
								var i = e.controls.getNode("ignition", 1);
								i.setValue(!i.getValue());
							}
						}
					</script>
				</binding>
			</key>

			<key n="114">
				<name>r</name>
				<desc>Apply rotor brake</desc>
				<binding>
					<command>nasal</command>
					<script>interpolate("/controls/rotor/brake", 1.0, 2)</script>
				</binding>
				<mod-up>
					<binding>
						<command>nasal</command>
						<script>interpolate("/controls/rotor/brake", 0.0, 2)</script>
					</binding>
				</mod-up>
			</key>

			<key n="118">
				<name>Alt-v</name>
				<desc>Toggle dynamic cockpit view</desc>
				<mod-alt>
					<binding>
						<command>property-toggle</command>
						<property>/sim/view/dynamic/enabled</property>
					</binding>
				</mod-alt>
			</key>

			<key n="121">
				<name>y</name>
				<desc>Select next variant</desc>
				<binding>
					<command>nasal</command>
					<script>aircraft.livery.next()</script>
				</binding>
			</key>

			<key n="123">
				<name>{</name>
				<desc>Shutdown Engines</desc>
				<binding>
					<command>nasal</command>
					<script>as332.shutdown()</script>
					<condition>
						<property>/sim/signals/fdm-initialized</property>
					</condition>
				</binding>
			</key>

			<key n="125">
				<name>}</name>
				<desc>Start Engines</desc>
				<binding>
					<command>nasal</command>
					<script>as332.startup()</script>
					<condition>
						<property>/sim/signals/fdm-initialized</property>
					</condition>
				</binding>
			</key>
		</keyboard>
	</input>

	<nasal>
		<as332>
			<file>Aircraft/as332/Models/as332.nas</file>
		</as332>
	</nasal>

	<rotors>
		<main>
			<rpm type="double">0</rpm>
		</main>
	</rotors>
</PropertyList>
