<?xml version="1.0"?>

<PropertyList>
    <sim>
        <description>Piaggio P180 Avanti II (YASim)</description>
        <status>alpha</status>
        <author>Guillaume Chauvat</author>
        <flight-model>yasim</flight-model>
        <aero>p-180-yasim</aero>
        <fuel-fraction>0.8</fuel-fraction>
        <!--
        <startup>
            <splash-texture>Aircraft/b1900d/b1900dsplash1.rgb</splash-texture>
        </startup>
        -->

    <mk-viii>
        <assemblies>
            <emission>
                <red alias="/sim/model/b1900d/material/instruments/emission/red"/>
                <green alias="/sim/model/b1900d/material/instruments/emission/green"/>
                <blue alias="/sim/model/b1900d/material/instruments/emission/blue"/>
                <factor alias="/controls/lighting/instruments-norm"/>
            </emission>
        </assemblies>
    </mk-viii>

    <model>
        <path>Aircraft/P180/Models/p-180-model.xml</path>
        <p-180>
            <texture n="0">NZAlivery.rgb</texture>
            <texture n="1">CMAlivery.rgb</texture>
            <livery-num type="int">0</livery-num>
            <wiper type="bool">true</wiper>
            <material>
                <instruments>
                    <diffuse>
                        <red type="string">1.0</red>
                        <green type="string">1.0</green>
                        <blue type="string">1.0</blue>
                    </diffuse>
                    <ambient>
                        <red type="string">1.0</red>
                        <green type="string">1.0</green>
                        <blue type="string">1.0</blue>
                    </ambient>
                    <specular>
                        <red type="string">0.0</red>
                        <green type="string">0.0</green>
                        <blue type="string">0.0</blue>
                    </specular>
                    <emission>
                        <red type="string">0.9</red>
                        <green type="string">0.5</green>
                        <blue type="string">0.2</blue>
                    </emission>
                    <transparency>
                        <alpha>1.0</alpha>
                    </transparency>
                    <shininess>0</shininess>
                    <factor>0.0</factor>
                </instruments>
            </material> 
        </p-180>
    </model>

    <view n="0">
        <internal archive="y">true</internal>
        <name>Cockpit</name>
        <type>lookfrom</type>
        <internal type="bool">true</internal>
        <config>
            <x-offset-m type="double">-0.38</x-offset-m>
            <y-offset-m type="double">-0.25</y-offset-m>
            <z-offset-m type="double">-3.65</z-offset-m>
            <pitch-offset-deg>-15</pitch-offset-deg>
            <default-field-of-view-deg>60.0</default-field-of-view-deg>
        </config>
    </view>

    <current-view>
        <field-of-view>60.0</field-of-view>
    </current-view>

    <systems>
        <electrical>
            <path></path>
        </electrical>
        <autopilot>
            <path>Aircraft/b1900d/b1900d-autopilot.xml</path>
        </autopilot>
    </systems>

<!--
    <tutorials>
        <tutorial include="Tutorials/startup_tutorial.xml"/>
    </tutorials>
-->

    <sound>
        <path>Aircraft/b1900d/b1900d-sound.xml</path>
    </sound>

    <flaps>
        <setting>0.000</setting>
        <setting>0.50</setting>
        <setting>1.000</setting>
    </flaps>

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

    <virtual-cockpit>true</virtual-cockpit>
    <allow-toggle-cockpit>true</allow-toggle-cockpit>

    <help>
        <title>Piaggio P180 Avanti II</title>
        <line></line>
    <!--
        <key>
            <name>CTRL-A</name>
            <desc>Toggle autopilot on/off</desc>
        </key>
        <line></line>
        <text>Autopilot on with no flightdirector modes selected
        defaults to Wing-Level;
        </text>
    -->

        <key>
            <name>d</name>
            <desc>Toggle door</desc>
        </key>

    </help>

    <weight n="0">
        <name>Crew</name>
        <weight-lb>180</weight-lb>
        <max-lb>400</max-lb>
        <min-lb>180</min-lb>
    </weight>

    <weight n="1">
        <name>Pax/Baggage</name>
        <weight-lb>2500</weight-lb>
        <max-lb>4000</max-lb>
        <min-lb>0</min-lb>
    </weight>

    <replay>
        <disable>1</disable>
    </replay>

    <multiplay>
        <chat_display>1</chat_display>
    </multiplay>
    
    <yokes-visible type="bool">1</yokes-visible>

</sim>
<!--   power / engines on  -->

    <controls>
        <electric>
            <battery-switch type = "bool">1</battery-switch>
            <avionics-switch type = "bool">1</avionics-switch>
            <external-power type = "bool">1</external-power>
            <engine n="0">
            <generator>true</generator>
            </engine>
            <engine n="1">
            <generator>true</generator>
            </engine>
        </electric>
        <lighting>
            <instrument-lights>1</instrument-lights>
        </lighting>
        <gear>
            <brake-parking>1</brake-parking>
        </gear>
        <engines>
            <engine n="0">
                <condition>1</condition>
                <propeller-pitch>1</propeller-pitch>
            </engine>
            <engine n="1">
                <condition>1</condition>
                <propeller-pitch>1</propeller-pitch>
            </engine>
        </engines>
    </controls>

    <autopilot>
        <locks>
            <passive-mode type="bool">true</passive-mode>
        </locks>
    </autopilot>

    <instrumentation>
        <flightdirector>
            <lnav type = "double">0</lnav>
            <vnav type = "double">0</vnav>
            <alt-offset type = "double">0</alt-offset>
            <alt-alert type = "double">0</alt-alert>
            <course type = "double">0</course>
            <hdg-deg type = "double">0</hdg-deg>
        </flightdirector>
        <gps>
            <serviceable>true</serviceable> 
        </gps>
        <gps-annunciator>
            <mode-string n="0">POWER ON</mode-string>
            <mode-string n="1">POWER ON</mode-string>
        </gps-annunciator>
        
        <nav>
            <slaved-to-gps>false</slaved-to-gps>
        </nav>
        <nav n="1">
            <slaved-to-gps>false</slaved-to-gps>
        </nav>
        <mk-viii>
            <serviceable>true</serviceable>
            <configuration-module>
            <category-1>1</category-1>	<!-- GA Fast, 150' Mode 4B -->
            </configuration-module>
            <inputs>
                <arinc429>
                <decision-height-ncd>false</decision-height-ncd>
                <decision-height>200</decision-height>
                </arinc429>
            </inputs>
        </mk-viii>
    <altimeter>
        <millibars type= "double">1</millibars>
    </altimeter>
    </instrumentation>

    <environment>
        <turbulence>
        <use-cloud-turbulence>true</use-cloud-turbulence>
        </turbulence>
    </environment>

<!--    
    <engines>
    <engine n="0">
    <fuel-flow-pph type="float">0</fuel-flow-pph>
    </engine>
    <engine n="1">
    <fuel-flow-pph type="float">0</fuel-flow-pph>
    </engine>
    </engines>
-->
    
    <input>
        <keyboard>
        <key n="1">
        <name>Ctrl-A</name>
        <desc>Toggle autopilot</desc>
        <binding>
            <command>property-toggle</command>
            <property>autopilot/locks/passive-mode</property>
        </binding>
        </key>

        <key n="100">
        <name>d</name>
        <desc>Toggle door</desc>
	<binding>
		<command>nasal</command>
		<script>p180.doorsystem.door1export();</script>
	</binding>
        </key>
    </keyboard>
    </input>
    
    <nasal>
        <systems>
            <file>Aircraft/b1900d/Nasal/Electrical.nas</file>
            <file>Aircraft/b1900d/Nasal/systems.nas</file>
            <file>Aircraft/b1900d/Nasal/flightdirector.nas</file>
        </systems>
	<p180>
            <file>Aircraft/P180/Nasal/doors.nas</file>
            <file>Aircraft/P180/Nasal/p180.nas</file>
	</p180>
    </nasal>

</PropertyList>
