Board index FlightGear Development Aircraft

Westland Lynx AH7

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Re: Westland Lynx AH7

Postby cobe571 » Sat Jun 08, 2019 12:15 pm

Main-Rotor directory includes

Image

the file 'main-rotor.xml'

Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
     ==========================================================
            Main Rotor "Westland-Lynx-AH7" Animation file
         
                    Patrizio MELIS : Apr. 2019
         
                        CC-BY-NC-SA 4.0
                               
     Strictly NOT allowed commercial projects with these files

    ===========================================================
-->

  <PropertyList>

    <path>main-rotor.ac</path>

  <animation>
    <!-- Opaque Objects List -->
    <object-name>BLADE-A</object-name>
    <object-name>BLADE-A-BOLTS.000</object-name>
    <object-name>BLADE-A-BOLTS.001</object-name>
    <object-name>BLADE-A-BOLTS.002</object-name>
    <object-name>BLADE-A-BOLTS.003</object-name>
    <object-name>BLADE-A-JOINT.000</object-name>
    <object-name>BLADE-A-JOINT.001</object-name>
    <object-name>BLADE-A-JOINT.002</object-name>
    <object-name>BLADE-A-JOINT.003</object-name>
    <object-name>BLADE-A-JOINT.004</object-name>
    <object-name>BLADE-A-JOINT.005</object-name>
    <object-name>BLADE-A-SUPPORT</object-name>
   
    <object-name>BLADE-B</object-name>
    <object-name>BLADE-B-BOLTS.000</object-name>
    <object-name>BLADE-B-BOLTS.001</object-name>
    <object-name>BLADE-B-BOLTS.002</object-name>
    <object-name>BLADE-B-BOLTS.003</object-name>
    <object-name>BLADE-B-JOINT.000</object-name>
    <object-name>BLADE-B-JOINT.001</object-name>
    <object-name>BLADE-B-JOINT.002</object-name>
    <object-name>BLADE-B-JOINT.003</object-name>
    <object-name>BLADE-B-JOINT.004</object-name>
    <object-name>BLADE-B-JOINT.005</object-name>
    <object-name>BLADE-B-SUPPORT</object-name>
   
    <object-name>BLADE-C</object-name>
    <object-name>BLADE-C-BOLTS.000</object-name>
    <object-name>BLADE-C-BOLTS.001</object-name>
    <object-name>BLADE-C-BOLTS.002</object-name>
    <object-name>BLADE-C-BOLTS.003</object-name>
    <object-name>BLADE-C-JOINT.000</object-name>
    <object-name>BLADE-C-JOINT.001</object-name>
    <object-name>BLADE-C-JOINT.002</object-name>
    <object-name>BLADE-C-JOINT.003</object-name>
    <object-name>BLADE-C-JOINT.004</object-name>
    <object-name>BLADE-C-JOINT.005</object-name>
    <object-name>BLADE-C-SUPPORT</object-name>
   
    <object-name>BLADE-D</object-name>
    <object-name>BLADE-D-BOLTS.000</object-name>
    <object-name>BLADE-D-BOLTS.001</object-name>
    <object-name>BLADE-D-BOLTS.002</object-name>
    <object-name>BLADE-D-BOLTS.003</object-name>
    <object-name>BLADE-D-JOINT.000</object-name>
    <object-name>BLADE-D-JOINT.001</object-name>
    <object-name>BLADE-D-JOINT.002</object-name>
    <object-name>BLADE-D-JOINT.003</object-name>
    <object-name>BLADE-D-JOINT.004</object-name>
    <object-name>BLADE-D-JOINT.005</object-name>
    <object-name>BLADE-D-SUPPORT</object-name>
   
    <object-name>MAIN-HUB-TENS.000</object-name>
    <object-name>MAIN-HUB-TENS.001</object-name>
    <object-name>MAIN-HUB-TENS.002</object-name>
    <object-name>MAIN-HUB-TENS.003</object-name>
    <object-name>MAIN-HUB.000</object-name>
    <object-name>MAIN-HUB.001</object-name>
    <object-name>MAIN-HUB.002</object-name>
    <object-name>MAIN-HUB.003</object-name>
    <object-name>MAIN-HUB.004</object-name>
    <object-name>MAIN-HUB.005</object-name>
    <object-name>MAIN-HUB.006</object-name>
    <object-name>ROTOR-BASE.000</object-name>
    <object-name>ROTOR-BASE.001</object-name>
    <object-name>ROTOR-BASE.002</object-name>

    <!-- Transparent Objects List -->
    <object-name>blurred1</object-name>
    <object-name>blurred2</object-name>
    <object-name>blurred3</object-name>
    <object-name>blurred4</object-name>
  </animation>

    <!-- REMBRANDT support for transparent objects -->
    <effect>
        <inherits-from>Effects/model-transparent</inherits-from>
        <condition>
            <property>sim/rendering/rembrandt/enabled</property>
        </condition>
        <object-name>blurred1</object-name>
        <object-name>blurred2</object-name>
        <object-name>blurred3</object-name>
        <object-name>blurred4</object-name>
    </effect>

    <!-- Objects Linked To Texture -->
  <animation>
    <type>material</type>
    <object-name>BLADE-A</object-name>
    <object-name>BLADE-A-BOLTS.000</object-name>
    <object-name>BLADE-A-BOLTS.001</object-name>
    <object-name>BLADE-A-BOLTS.002</object-name>
    <object-name>BLADE-A-BOLTS.003</object-name>
    <object-name>BLADE-A-JOINT.000</object-name>
    <object-name>BLADE-A-JOINT.001</object-name>
    <object-name>BLADE-A-JOINT.002</object-name>
    <object-name>BLADE-A-JOINT.003</object-name>
    <object-name>BLADE-A-JOINT.004</object-name>
    <object-name>BLADE-A-JOINT.005</object-name>
    <object-name>BLADE-A-SUPPORT</object-name>
   
    <object-name>BLADE-B</object-name>
    <object-name>BLADE-B-BOLTS.000</object-name>
    <object-name>BLADE-B-BOLTS.001</object-name>
    <object-name>BLADE-B-BOLTS.002</object-name>
    <object-name>BLADE-B-BOLTS.003</object-name>
    <object-name>BLADE-B-JOINT.000</object-name>
    <object-name>BLADE-B-JOINT.001</object-name>
    <object-name>BLADE-B-JOINT.002</object-name>
    <object-name>BLADE-B-JOINT.003</object-name>
    <object-name>BLADE-B-JOINT.004</object-name>
    <object-name>BLADE-B-JOINT.005</object-name>
    <object-name>BLADE-B-SUPPORT</object-name>
   
    <object-name>BLADE-C</object-name>
    <object-name>BLADE-C-BOLTS.000</object-name>
    <object-name>BLADE-C-BOLTS.001</object-name>
    <object-name>BLADE-C-BOLTS.002</object-name>
    <object-name>BLADE-C-BOLTS.003</object-name>
    <object-name>BLADE-C-JOINT.000</object-name>
    <object-name>BLADE-C-JOINT.001</object-name>
    <object-name>BLADE-C-JOINT.002</object-name>
    <object-name>BLADE-C-JOINT.003</object-name>
    <object-name>BLADE-C-JOINT.004</object-name>
    <object-name>BLADE-C-JOINT.005</object-name>
    <object-name>BLADE-C-SUPPORT</object-name>
   
    <object-name>BLADE-D</object-name>
    <object-name>BLADE-D-BOLTS.000</object-name>
    <object-name>BLADE-D-BOLTS.001</object-name>
    <object-name>BLADE-D-BOLTS.002</object-name>
    <object-name>BLADE-D-BOLTS.003</object-name>
    <object-name>BLADE-D-JOINT.000</object-name>
    <object-name>BLADE-D-JOINT.001</object-name>
    <object-name>BLADE-D-JOINT.002</object-name>
    <object-name>BLADE-D-JOINT.003</object-name>
    <object-name>BLADE-D-JOINT.004</object-name>
    <object-name>BLADE-D-JOINT.005</object-name>
    <object-name>BLADE-D-SUPPORT</object-name>
   
    <object-name>MAIN-HUB-TENS.000</object-name>
    <object-name>MAIN-HUB-TENS.001</object-name>
    <object-name>MAIN-HUB-TENS.002</object-name>
    <object-name>MAIN-HUB-TENS.003</object-name>
    <object-name>MAIN-HUB.000</object-name>
    <object-name>MAIN-HUB.001</object-name>
    <object-name>MAIN-HUB.002</object-name>
    <object-name>MAIN-HUB.003</object-name>
    <object-name>MAIN-HUB.004</object-name>
    <object-name>MAIN-HUB.005</object-name>
    <object-name>MAIN-HUB.006</object-name>
    <object-name>ROTOR-BASE.000</object-name>
    <object-name>ROTOR-BASE.001</object-name>
    <object-name>ROTOR-BASE.002</object-name>
   
    <property-base>sim/model/livery</property-base>
    <texture-prop>main-rotor</texture-prop>
    <texture>main-rotor.jpg</texture>
        <specular>
         <red-prop>specular/red</red-prop>
         <green-prop>specular/green</green-prop>
         <blue-prop>specular/blue</blue-prop>
        </specular>
  </animation>

  <animation>
    <type>material</type>
    <object-name>BLADE-A</object-name>
    <object-name>BLADE-A-BOLTS.000</object-name>
    <object-name>BLADE-A-BOLTS.001</object-name>
    <object-name>BLADE-A-BOLTS.002</object-name>
    <object-name>BLADE-A-BOLTS.003</object-name>
    <object-name>BLADE-A-JOINT.000</object-name>
    <object-name>BLADE-A-JOINT.001</object-name>
    <object-name>BLADE-A-JOINT.002</object-name>
    <object-name>BLADE-A-JOINT.003</object-name>
    <object-name>BLADE-A-JOINT.004</object-name>
    <object-name>BLADE-A-JOINT.005</object-name>
    <object-name>BLADE-A-SUPPORT</object-name>
   
    <object-name>BLADE-B</object-name>
    <object-name>BLADE-B-BOLTS.000</object-name>
    <object-name>BLADE-B-BOLTS.001</object-name>
    <object-name>BLADE-B-BOLTS.002</object-name>
    <object-name>BLADE-B-BOLTS.003</object-name>
    <object-name>BLADE-B-JOINT.000</object-name>
    <object-name>BLADE-B-JOINT.001</object-name>
    <object-name>BLADE-B-JOINT.002</object-name>
    <object-name>BLADE-B-JOINT.003</object-name>
    <object-name>BLADE-B-JOINT.004</object-name>
    <object-name>BLADE-B-JOINT.005</object-name>
    <object-name>BLADE-B-SUPPORT</object-name>
   
    <object-name>BLADE-C</object-name>
    <object-name>BLADE-C-BOLTS.000</object-name>
    <object-name>BLADE-C-BOLTS.001</object-name>
    <object-name>BLADE-C-BOLTS.002</object-name>
    <object-name>BLADE-C-BOLTS.003</object-name>
    <object-name>BLADE-C-JOINT.000</object-name>
    <object-name>BLADE-C-JOINT.001</object-name>
    <object-name>BLADE-C-JOINT.002</object-name>
    <object-name>BLADE-C-JOINT.003</object-name>
    <object-name>BLADE-C-JOINT.004</object-name>
    <object-name>BLADE-C-JOINT.005</object-name>
    <object-name>BLADE-C-SUPPORT</object-name>
   
    <object-name>BLADE-D</object-name>
    <object-name>BLADE-D-BOLTS.000</object-name>
    <object-name>BLADE-D-BOLTS.001</object-name>
    <object-name>BLADE-D-BOLTS.002</object-name>
    <object-name>BLADE-D-BOLTS.003</object-name>
    <object-name>BLADE-D-JOINT.000</object-name>
    <object-name>BLADE-D-JOINT.001</object-name>
    <object-name>BLADE-D-JOINT.002</object-name>
    <object-name>BLADE-D-JOINT.003</object-name>
    <object-name>BLADE-D-JOINT.004</object-name>
    <object-name>BLADE-D-JOINT.005</object-name>
    <object-name>BLADE-D-SUPPORT</object-name>
   
    <global type="bool">true</global>
        <transparency>
        <alpha-prop>rotors/main/rpm</alpha-prop>
        <factor>-0.0045</factor>
        <offset>1</offset>
        <max>1</max>
        </transparency>
  </animation>
   
  <!-- Main Rotor tilt/pitch-deg -->
  <animation>
    <type>rotate</type>
    <object-name>BLADE-A</object-name>
    <object-name>BLADE-A-BOLTS.000</object-name>
    <object-name>BLADE-A-BOLTS.001</object-name>
    <object-name>BLADE-A-BOLTS.002</object-name>
    <object-name>BLADE-A-BOLTS.003</object-name>
    <object-name>BLADE-A-JOINT.000</object-name>
    <object-name>BLADE-A-JOINT.001</object-name>
    <object-name>BLADE-A-JOINT.002</object-name>
    <object-name>BLADE-A-JOINT.003</object-name>
    <object-name>BLADE-A-JOINT.004</object-name>
    <object-name>BLADE-A-JOINT.005</object-name>
    <object-name>BLADE-A-SUPPORT</object-name>
   
    <object-name>BLADE-B</object-name>
    <object-name>BLADE-B-BOLTS.000</object-name>
    <object-name>BLADE-B-BOLTS.001</object-name>
    <object-name>BLADE-B-BOLTS.002</object-name>
    <object-name>BLADE-B-BOLTS.003</object-name>
    <object-name>BLADE-B-JOINT.000</object-name>
    <object-name>BLADE-B-JOINT.001</object-name>
    <object-name>BLADE-B-JOINT.002</object-name>
    <object-name>BLADE-B-JOINT.003</object-name>
    <object-name>BLADE-B-JOINT.004</object-name>
    <object-name>BLADE-B-JOINT.005</object-name>
    <object-name>BLADE-B-SUPPORT</object-name>
   
    <object-name>BLADE-C</object-name>
    <object-name>BLADE-C-BOLTS.000</object-name>
    <object-name>BLADE-C-BOLTS.001</object-name>
    <object-name>BLADE-C-BOLTS.002</object-name>
    <object-name>BLADE-C-BOLTS.003</object-name>
    <object-name>BLADE-C-JOINT.000</object-name>
    <object-name>BLADE-C-JOINT.001</object-name>
    <object-name>BLADE-C-JOINT.002</object-name>
    <object-name>BLADE-C-JOINT.003</object-name>
    <object-name>BLADE-C-JOINT.004</object-name>
    <object-name>BLADE-C-JOINT.005</object-name>
    <object-name>BLADE-C-SUPPORT</object-name>
   
    <object-name>BLADE-D</object-name>
    <object-name>BLADE-D-BOLTS.000</object-name>
    <object-name>BLADE-D-BOLTS.001</object-name>
    <object-name>BLADE-D-BOLTS.002</object-name>
    <object-name>BLADE-D-BOLTS.003</object-name>
    <object-name>BLADE-D-JOINT.000</object-name>
    <object-name>BLADE-D-JOINT.001</object-name>
    <object-name>BLADE-D-JOINT.002</object-name>
    <object-name>BLADE-D-JOINT.003</object-name>
    <object-name>BLADE-D-JOINT.004</object-name>
    <object-name>BLADE-D-JOINT.005</object-name>
    <object-name>BLADE-D-SUPPORT</object-name>
   
    <object-name>MAIN-HUB-TENS.000</object-name>
    <object-name>MAIN-HUB-TENS.001</object-name>
    <object-name>MAIN-HUB-TENS.002</object-name>
    <object-name>MAIN-HUB-TENS.003</object-name>
    <object-name>MAIN-HUB.000</object-name>
    <object-name>MAIN-HUB.001</object-name>
    <object-name>MAIN-HUB.002</object-name>
    <object-name>MAIN-HUB.003</object-name>
    <object-name>MAIN-HUB.004</object-name>
    <object-name>MAIN-HUB.005</object-name>
    <object-name>MAIN-HUB.006</object-name>
    <object-name>ROTOR-BASE.000</object-name>
    <object-name>ROTOR-BASE.001</object-name>
    <object-name>ROTOR-BASE.002</object-name>

    <property>rotors/main/tilt/pitch-deg</property>
        <factor>-1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
            <z-m>1.75</z-m>
        </center>
        <axis>
            <x>0.0</x>
            <y>1.0</y>
            <z>0.0</z>
        </axis>
  </animation>

  <!-- blurred parts tilt/pitch-deg -->
  <animation>
    <type>rotate</type>
    <object-name>blurred1</object-name>
    <object-name>blurred2</object-name>
    <object-name>blurred3</object-name>
    <object-name>blurred4</object-name>   
   
    <property>rotors/main/tilt/pitch-deg</property>
        <factor>-1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
            <z-m>1.75</z-m>
        </center>
        <axis>
            <x>0.0</x>
            <y>1.0</y>
            <z>0.0</z>
        </axis>
  </animation>

  <!-- blurred parts + HUB spin -->
  <animation>
    <type>spin</type>
    <object-name>blurred1</object-name>
    <object-name>blurred2</object-name>
    <object-name>blurred3</object-name>
    <object-name>blurred4</object-name>

    <object-name>MAIN-HUB-TENS.000</object-name>
    <object-name>MAIN-HUB-TENS.001</object-name>
    <object-name>MAIN-HUB-TENS.002</object-name>
    <object-name>MAIN-HUB-TENS.003</object-name>
    <object-name>MAIN-HUB.000</object-name>
    <object-name>MAIN-HUB.001</object-name>
    <object-name>MAIN-HUB.002</object-name>
    <object-name>MAIN-HUB.003</object-name>
    <object-name>MAIN-HUB.004</object-name>
    <object-name>MAIN-HUB.005</object-name>
    <object-name>MAIN-HUB.006</object-name>
    <object-name>ROTOR-BASE.000</object-name>
    <object-name>ROTOR-BASE.001</object-name>
    <object-name>ROTOR-BASE.002</object-name>

    <property>rotors/main/rpm</property>
    <factor>1</factor>
    <center>
        <!--x-m>0.009</x-m>
        <y-m>-0.005</y-m>
        <z-m>2.025</z-m-->
        <x-m> 0.00</x-m>
        <y-m>-0.00</y-m>
        <z-m>1.75</z-m>
    </center>

    <axis>
        <x>0.0</x>
        <y>0.0</y>
        <z>1.0</z>
       <!--x2-m> 0.009</x2-m>
       <y2-m>-0.005</y2-m>
        <z2-m> 2.185</z2-m>
        <x1-m> 0.019</x1-m>
        <y1-m>-0.005</y1-m>
        <z1-m> 2.185</z1-m-->
    </axis>
  </animation>
 
  <animation>
    <type>select</type>
    <object-name>BLADE-A</object-name>
    <object-name>BLADE-A-BOLTS.000</object-name>
    <object-name>BLADE-A-BOLTS.001</object-name>
    <object-name>BLADE-A-BOLTS.002</object-name>
    <object-name>BLADE-A-BOLTS.003</object-name>
    <object-name>BLADE-A-JOINT.000</object-name>
    <object-name>BLADE-A-JOINT.001</object-name>
    <object-name>BLADE-A-JOINT.002</object-name>
    <object-name>BLADE-A-JOINT.003</object-name>
    <object-name>BLADE-A-JOINT.004</object-name>
    <object-name>BLADE-A-JOINT.005</object-name>
    <object-name>BLADE-A-SUPPORT</object-name>
   
    <object-name>BLADE-B</object-name>
    <object-name>BLADE-B-BOLTS.000</object-name>
    <object-name>BLADE-B-BOLTS.001</object-name>
    <object-name>BLADE-B-BOLTS.002</object-name>
    <object-name>BLADE-B-BOLTS.003</object-name>
    <object-name>BLADE-B-JOINT.000</object-name>
    <object-name>BLADE-B-JOINT.001</object-name>
    <object-name>BLADE-B-JOINT.002</object-name>
    <object-name>BLADE-B-JOINT.003</object-name>
    <object-name>BLADE-B-JOINT.004</object-name>
    <object-name>BLADE-B-JOINT.005</object-name>
    <object-name>BLADE-B-SUPPORT</object-name>
   
    <object-name>BLADE-C</object-name>
    <object-name>BLADE-C-BOLTS.000</object-name>
    <object-name>BLADE-C-BOLTS.001</object-name>
    <object-name>BLADE-C-BOLTS.002</object-name>
    <object-name>BLADE-C-BOLTS.003</object-name>
    <object-name>BLADE-C-JOINT.000</object-name>
    <object-name>BLADE-C-JOINT.001</object-name>
    <object-name>BLADE-C-JOINT.002</object-name>
    <object-name>BLADE-C-JOINT.003</object-name>
    <object-name>BLADE-C-JOINT.004</object-name>
    <object-name>BLADE-C-JOINT.005</object-name>
    <object-name>BLADE-C-SUPPORT</object-name>
   
    <object-name>BLADE-D</object-name>
    <object-name>BLADE-D-BOLTS.000</object-name>
    <object-name>BLADE-D-BOLTS.001</object-name>
    <object-name>BLADE-D-BOLTS.002</object-name>
    <object-name>BLADE-D-BOLTS.003</object-name>
    <object-name>BLADE-D-JOINT.000</object-name>
    <object-name>BLADE-D-JOINT.001</object-name>
    <object-name>BLADE-D-JOINT.002</object-name>
    <object-name>BLADE-D-JOINT.003</object-name>
    <object-name>BLADE-D-JOINT.004</object-name>
    <object-name>BLADE-D-JOINT.005</object-name>
    <object-name>BLADE-D-SUPPORT</object-name>

    <condition>
            <less-than>
                <property>rotors/main/rpm</property>
                <value>201</value>
            </less-than>
        </condition>
  </animation>

  <animation>
    <type>select</type>
    <object-name>blurred1</object-name>
    <object-name>blurred2</object-name>
    <object-name>blurred3</object-name>
    <object-name>blurred4</object-name>

    <condition>
            <greater-than>
                <property>rotors/main/rpm</property>
                <value>200.999</value>
            </greater-than>
        </condition>
  </animation>

    <!--  Blade 1 -->
  <animation>
        <type>rotate</type>
        <object-name>BLADE-A</object-name>
        <object-name>BLADE-A-BOLTS.000</object-name>
        <object-name>BLADE-A-BOLTS.001</object-name>
        <object-name>BLADE-A-BOLTS.002</object-name>
        <object-name>BLADE-A-BOLTS.003</object-name>
        <object-name>BLADE-A-JOINT.000</object-name>
        <object-name>BLADE-A-JOINT.001</object-name>
        <object-name>BLADE-A-JOINT.002</object-name>
        <object-name>BLADE-A-JOINT.003</object-name>
        <object-name>BLADE-A-JOINT.004</object-name>
        <object-name>BLADE-A-JOINT.005</object-name>
        <object-name>BLADE-A-SUPPORT</object-name>
      
        <property>rotors/main/blade/position-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
            <z-m>1.75</z-m>
        </center>

        <axis>
            <x>0.0</x>
            <y>0.0</y>
            <z>1.0</z>
        </axis>   
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-A</object-name>
        <object-name>BLADE-A-BOLTS.000</object-name>
        <object-name>BLADE-A-BOLTS.001</object-name>
        <object-name>BLADE-A-BOLTS.002</object-name>
        <object-name>BLADE-A-BOLTS.003</object-name>
        <object-name>BLADE-A-JOINT.000</object-name>
        <object-name>BLADE-A-JOINT.001</object-name>
        <object-name>BLADE-A-JOINT.002</object-name>
        <object-name>BLADE-A-JOINT.003</object-name>
        <object-name>BLADE-A-JOINT.004</object-name>
        <object-name>BLADE-A-JOINT.005</object-name>
        <object-name>BLADE-A-SUPPORT</object-name>
      
        <property>rotors/main/blade/incidence-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-A</object-name>
        <object-name>BLADE-A-BOLTS.000</object-name>
        <object-name>BLADE-A-BOLTS.001</object-name>
        <object-name>BLADE-A-BOLTS.002</object-name>
        <object-name>BLADE-A-BOLTS.003</object-name>
        <object-name>BLADE-A-JOINT.000</object-name>
        <object-name>BLADE-A-JOINT.001</object-name>
        <object-name>BLADE-A-JOINT.002</object-name>
        <object-name>BLADE-A-JOINT.003</object-name>
        <object-name>BLADE-A-JOINT.004</object-name>
        <object-name>BLADE-A-JOINT.005</object-name>
        <object-name>BLADE-A-SUPPORT</object-name>

        <property>rotors/main/blade/flap-deg</property>
        <factor>0.3</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>
 
 
    <!--  Blade 2 -->
  <animation>
        <type>rotate</type>
        <object-name>BLADE-B</object-name>
        <object-name>BLADE-B-BOLTS.000</object-name>
        <object-name>BLADE-B-BOLTS.001</object-name>
        <object-name>BLADE-B-BOLTS.002</object-name>
        <object-name>BLADE-B-BOLTS.003</object-name>
        <object-name>BLADE-B-JOINT.000</object-name>
        <object-name>BLADE-B-JOINT.001</object-name>
        <object-name>BLADE-B-JOINT.002</object-name>
        <object-name>BLADE-B-JOINT.003</object-name>
        <object-name>BLADE-B-JOINT.004</object-name>
        <object-name>BLADE-B-JOINT.005</object-name>
        <object-name>BLADE-B-SUPPORT</object-name>
      
        <property>rotors/main/blade[1]/position-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
            <z-m>1.75</z-m>
        </center>

        <axis>
            <x>0.0</x>
            <y>0.0</y>
            <z>1.0</z>
        </axis>   
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-B</object-name>
        <object-name>BLADE-B-BOLTS.000</object-name>
        <object-name>BLADE-B-BOLTS.001</object-name>
        <object-name>BLADE-B-BOLTS.002</object-name>
        <object-name>BLADE-B-BOLTS.003</object-name>
        <object-name>BLADE-B-JOINT.000</object-name>
        <object-name>BLADE-B-JOINT.001</object-name>
        <object-name>BLADE-B-JOINT.002</object-name>
        <object-name>BLADE-B-JOINT.003</object-name>
        <object-name>BLADE-B-JOINT.004</object-name>
        <object-name>BLADE-B-JOINT.005</object-name>
        <object-name>BLADE-B-SUPPORT</object-name>
      
        <property>rotors/main/blade[1]/incidence-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-B</object-name>
        <object-name>BLADE-B-BOLTS.000</object-name>
        <object-name>BLADE-B-BOLTS.001</object-name>
        <object-name>BLADE-B-BOLTS.002</object-name>
        <object-name>BLADE-B-BOLTS.003</object-name>
        <object-name>BLADE-B-JOINT.000</object-name>
        <object-name>BLADE-B-JOINT.001</object-name>
        <object-name>BLADE-B-JOINT.002</object-name>
        <object-name>BLADE-B-JOINT.003</object-name>
        <object-name>BLADE-B-JOINT.004</object-name>
        <object-name>BLADE-B-JOINT.005</object-name>
        <object-name>BLADE-B-SUPPORT</object-name>

        <property>rotors/main/blade/flap-deg</property>
        <factor>0.3</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>
 
 
    <!--  Blade 3 -->
  <animation>
        <type>rotate</type>
        <object-name>BLADE-C</object-name>
        <object-name>BLADE-C-BOLTS.000</object-name>
        <object-name>BLADE-C-BOLTS.001</object-name>
        <object-name>BLADE-C-BOLTS.002</object-name>
        <object-name>BLADE-C-BOLTS.003</object-name>
        <object-name>BLADE-C-JOINT.000</object-name>
        <object-name>BLADE-C-JOINT.001</object-name>
        <object-name>BLADE-C-JOINT.002</object-name>
        <object-name>BLADE-C-JOINT.003</object-name>
        <object-name>BLADE-C-JOINT.004</object-name>
        <object-name>BLADE-C-JOINT.005</object-name>
        <object-name>BLADE-C-SUPPORT</object-name>
      
        <property>rotors/main/blade[2]/position-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
            <z-m>1.75</z-m>
        </center>

        <axis>
            <x>0.0</x>
            <y>0.0</y>
            <z>1.0</z>
        </axis>   
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-C</object-name>
        <object-name>BLADE-C-BOLTS.000</object-name>
        <object-name>BLADE-C-BOLTS.001</object-name>
        <object-name>BLADE-C-BOLTS.002</object-name>
        <object-name>BLADE-C-BOLTS.003</object-name>
        <object-name>BLADE-C-JOINT.000</object-name>
        <object-name>BLADE-C-JOINT.001</object-name>
        <object-name>BLADE-C-JOINT.002</object-name>
        <object-name>BLADE-C-JOINT.003</object-name>
        <object-name>BLADE-C-JOINT.004</object-name>
        <object-name>BLADE-C-JOINT.005</object-name>
        <object-name>BLADE-C-SUPPORT</object-name>
      
        <property>rotors/main/blade[2]/incidence-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-C</object-name>
        <object-name>BLADE-C-BOLTS.000</object-name>
        <object-name>BLADE-C-BOLTS.001</object-name>
        <object-name>BLADE-C-BOLTS.002</object-name>
        <object-name>BLADE-C-BOLTS.003</object-name>
        <object-name>BLADE-C-JOINT.000</object-name>
        <object-name>BLADE-C-JOINT.001</object-name>
        <object-name>BLADE-C-JOINT.002</object-name>
        <object-name>BLADE-C-JOINT.003</object-name>
        <object-name>BLADE-C-JOINT.004</object-name>
        <object-name>BLADE-C-JOINT.005</object-name>
        <object-name>BLADE-C-SUPPORT</object-name>

        <property>rotors/main/blade/flap-deg</property>
        <factor>0.3</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>
 
 
  <!--  Blade 4 -->
  <animation>
        <type>rotate</type>
        <object-name>BLADE-D</object-name>
        <object-name>BLADE-D-BOLTS.000</object-name>
        <object-name>BLADE-D-BOLTS.001</object-name>
        <object-name>BLADE-D-BOLTS.002</object-name>
        <object-name>BLADE-D-BOLTS.003</object-name>
        <object-name>BLADE-D-JOINT.000</object-name>
        <object-name>BLADE-D-JOINT.001</object-name>
        <object-name>BLADE-D-JOINT.002</object-name>
        <object-name>BLADE-D-JOINT.003</object-name>
        <object-name>BLADE-D-JOINT.004</object-name>
        <object-name>BLADE-D-JOINT.005</object-name>
        <object-name>BLADE-D-SUPPORT</object-name>
      
        <property>rotors/main/blade[3]/position-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
            <z-m>1.75</z-m>
        </center>

        <axis>
            <x>0.0</x>
            <y>0.0</y>
            <z>1.0</z>
        </axis>   
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-D</object-name>
        <object-name>BLADE-D-BOLTS.000</object-name>
        <object-name>BLADE-D-BOLTS.001</object-name>
        <object-name>BLADE-D-BOLTS.002</object-name>
        <object-name>BLADE-D-BOLTS.003</object-name>
        <object-name>BLADE-D-JOINT.000</object-name>
        <object-name>BLADE-D-JOINT.001</object-name>
        <object-name>BLADE-D-JOINT.002</object-name>
        <object-name>BLADE-D-JOINT.003</object-name>
        <object-name>BLADE-D-JOINT.004</object-name>
        <object-name>BLADE-D-JOINT.005</object-name>
        <object-name>BLADE-D-SUPPORT</object-name>
      
        <property>rotors/main/blade[3]/incidence-deg</property>
        <factor>1</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>

  <animation>
        <type>rotate</type>
        <object-name>BLADE-D</object-name>
        <object-name>BLADE-D-BOLTS.000</object-name>
        <object-name>BLADE-D-BOLTS.001</object-name>
        <object-name>BLADE-D-BOLTS.002</object-name>
        <object-name>BLADE-D-BOLTS.003</object-name>
        <object-name>BLADE-D-JOINT.000</object-name>
        <object-name>BLADE-D-JOINT.001</object-name>
        <object-name>BLADE-D-JOINT.002</object-name>
        <object-name>BLADE-D-JOINT.003</object-name>
        <object-name>BLADE-D-JOINT.004</object-name>
        <object-name>BLADE-D-JOINT.005</object-name>
        <object-name>BLADE-D-SUPPORT</object-name>

        <property>rotors/main/blade/flap-deg</property>
        <factor>0.3</factor>
        <center>
            <x-m>0</x-m>
            <y-m>0</y-m>
             <z-m>1.75</z-m>
        </center>

        <axis>
            <x>1.0</x>
            <y>-0.0</y>
            <z>0.0</z>
        </axis>
  </animation>

</PropertyList>


main-rotor.jpg

Image

blur.png

Image
Last edited by cobe571 on Sat Jun 08, 2019 12:59 pm, edited 2 times in total.
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Sat Jun 08, 2019 12:26 pm

Tail-Rotor directory includes

Image

the file 'tail-rotor.xml'

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<!--
     ==========================================================
            Tail Rotor "Westland-Lynx-AH7" Animation file
         
                    Patrizio MELIS : Apr. 2019
         
                        CC-BY-NC-SA 4.0
                               
     Strictly NOT allowed commercial projects with these files

    ===========================================================
-->

<PropertyList>

  <path>tail-rotor.ac</path>

<!--  REMBRANDT support for transparent objects-->
  <effect>
     <inherits-from>Effects/model-transparent</inherits-from>
        <condition>
         <property>sim/rendering/rembrandt/enabled</property>
        </condition>
        <object-name>tail-blurred</object-name>
  </effect>

  <animation>
    <type>material</type>
    <object-name>T-ROTOR.001</object-name>
    <object-name>T-ROTOR.002</object-name>
    <object-name>tail-hub</object-name>
    <object-name>tail-blades</object-name>
      <global type="bool">true</global>
      <transparency>
         <alpha-prop>rotors/main/rpm</alpha-prop>
         <factor>-0.0045</factor>
         <offset>1</offset>
         <max>1</max>
      </transparency>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>T-ROTOR.001</object-name>
    <object-name>T-ROTOR.002</object-name>
    <object-name>tail-hub</object-name>
    <object-name>tail-blades</object-name>
    <object-name>tail-blurred</object-name>
    <property>rotors/tail/blade[0]/position-deg</property>
      <factor>1</factor>
    <center>
       <x-m> 8.10813</x-m>
       <y-m>-0.15322</y-m>
       <z-m> 1.42155</z-m>
    </center>

    <axis>
      <x>  0.000 </x>
      <y>  1.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>
 
  <animation>
    <type>spin</type>
    <object-name>T-ROTOR.001</object-name>
    <object-name>T-ROTOR.002</object-name>
    <object-name>tail-hub</object-name>
    <object-name>tail-blades</object-name>
    <object-name>tail-blurred</object-name>
    <property>rotors/tail/rpm</property>
      <factor>1</factor>
    <center>
      <x-m> 8.10813</x-m>
      <y-m>-0.15322</y-m>
      <z-m> 1.42155</z-m>
    </center>

    <axis>
      <x>  0.000 </x>
      <y>  1.000 </y>
      <z>  0.000 </z>
    </axis>
  </animation>

  <animation>
    <type>select</type>
    <object-name>T-ROTOR.001</object-name>
    <object-name>T-ROTOR.002</object-name>
    <object-name>tail-hub</object-name>
    <object-name>tail-blades</object-name>
        <condition>
         <less-than>
          <property>rotors/main/rpm</property>
          <value>100</value>
         </less-than>
        </condition>
  </animation>

  <animation>
    <type>select</type>
      <object-name>tail-blurred</object-name>
        <condition>
         <greater-than>
          <property>rotors/main/rpm</property>
          <value>99.999</value>
         </greater-than>
        </condition>
  </animation>

</PropertyList>


tail-rotor.jpg

Image

tail-blur.jpg

Image
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Wed Jun 12, 2019 8:05 pm

Interior directory includes many files and folders

Image

the file 'interior.xml'

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!--
     ==========================================================
            Interior "Westland-Lynx-AH7" Animation file
         
                    Patrizio MELIS : Apr. 2019
         
                        CC-BY-NC-SA 4.0
                               
     Strictly NOT allowed commercial projects with these files

    ===========================================================
-->

<PropertyList>

  <path>interior.ac</path>

  <animation>
    <!-- Opaque Objects -->
    <object-name>DOOR-GARNISH-IN-L</object-name>
    <object-name>DOOR-GARNISH-IN-R</object-name>
    <object-name>DOOR-HANDLE-L</object-name>
    <object-name>DOOR-HANDLE-R</object-name>
    <object-name>DOOR-IN-L</object-name>
    <object-name>DOOR-IN-R</object-name>
    <object-name>DOOR-MID-L</object-name>
    <object-name>DOOR-MID-R</object-name>
    <object-name>HATCH-GARNISH-IN-L</object-name>
    <object-name>HATCH-GARNISH-IN-R</object-name>
    <object-name>HATCH-HANDLE-L.000</object-name>
    <object-name>HATCH-HANDLE-R.000</object-name>
    <object-name>HATCH-IN-L</object-name>
    <object-name>HATCH-IN-R</object-name>
    <object-name>HATCH-MID-L</object-name>
    <object-name>HATCH-MID-R</object-name>
    <object-name>INTERIOR-BACK</object-name>
    <object-name>INTERIOR-FLOOR</object-name>
    <object-name>INTERIOR-HEAD</object-name>
    <object-name>INTERIOR-SIDES</object-name>
    <object-name>INTERIOR-TICKNESS</object-name>
    <object-name>INTERIOR-TOP</object-name>
    <object-name>INTERIOR-TOP-LAMP</object-name>
   
    <!-- Trasparent Objects -->
    <object-name>DOOR-GLASS-IN-L.000</object-name>
    <object-name>DOOR-GLASS-IN-L.001</object-name>
    <object-name>DOOR-GLASS-IN-R.000</object-name>
    <object-name>DOOR-GLASS-IN-R.001</object-name>
    <object-name>GLASS-HATCH-IN-L</object-name>
    <object-name>GLASS-HATCH-IN-R</object-name>
    <object-name>GLASS-NOSE-IN</object-name>
    <object-name>GLASS-TOP-IN</object-name>
    <object-name>GLASS-WSCREEN-IN</object-name>
   
  </animation>
 
  <animation>
    <!-- Objects Linked To Texture -->
    <type>material</type>
    <object-name>DOOR-GARNISH-IN-L</object-name>
    <object-name>DOOR-GARNISH-IN-R</object-name>
    <object-name>DOOR-HANDLE-L</object-name>
    <object-name>DOOR-HANDLE-R</object-name>
    <object-name>DOOR-IN-L</object-name>
    <object-name>DOOR-IN-R</object-name>
    <object-name>DOOR-MID-L</object-name>
    <object-name>DOOR-MID-R</object-name>
    <object-name>HATCH-GARNISH-IN-L</object-name>
    <object-name>HATCH-GARNISH-IN-R</object-name>
    <object-name>HATCH-HANDLE-L.000</object-name>
    <object-name>HATCH-HANDLE-R.000</object-name>
    <object-name>HATCH-IN-L</object-name>
    <object-name>HATCH-IN-R</object-name>
    <object-name>HATCH-MID-L</object-name>
    <object-name>HATCH-MID-R</object-name>
    <object-name>INTERIOR-BACK</object-name>
    <object-name>INTERIOR-FLOOR</object-name>
    <object-name>INTERIOR-HEAD</object-name>
    <object-name>INTERIOR-SIDES</object-name>
    <object-name>INTERIOR-TICKNESS</object-name>
    <object-name>INTERIOR-TOP</object-name>
    <object-name>INTERIOR-TOP-LAMP</object-name>
   
    <property-base>sim/model/livery</property-base>
    <texture-prop>interior</texture-prop>
    <texture>interior.jpg</texture>
  <!-- <specular>
       <red-prop>specular/red</red-prop>
       <green-prop>specular/green</green-prop>
       <blue-prop>specular/blue</blue-prop>
       </specular> -->
  </animation>

  <!-- Working for Rembrandt -->
  <effect>
    <inherits-from>Aircraft/Westland_Lynx-AH7/Models/Effects/Glass/glass</inherits-from>
    <object-name>DOOR-GLASS-IN-L.000</object-name>
    <object-name>DOOR-GLASS-IN-L.001</object-name>
    <object-name>DOOR-GLASS-IN-R.000</object-name>
    <object-name>DOOR-GLASS-IN-R.001</object-name>
    <object-name>GLASS-HATCH-IN-L</object-name>
    <object-name>GLASS-HATCH-IN-R</object-name>
    <object-name>GLASS-NOSE-IN</object-name>
    <object-name>GLASS-TOP-IN</object-name>
    <object-name>GLASS-WSCREEN-IN</object-name>
  </effect>
 
  <!-- Pilots
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Pilot/w-lynx-pilot.xml</path>
    <offsets>
      <x-m>  0.87732 </x-m>
      <y-m> -0.56130 </y-m>
      <z-m> -0.29525 </z-m>
    </offsets>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Pilot/w-lynx-pilot.xml</path>
    <offsets>
      <x-m>  0.87964 </x-m>
      <y-m>  0.55335 </y-m>
      <z-m> -0.29525 </z-m>
    </offsets>
  </model> -->
 
  <!-- Seat -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Seats/Seat/seat.xml</path>
    <offsets>
      <x-m> -2.41903 </x-m>
      <y-m>  0.53581 </y-m>
      <z-m> -0.73499 </z-m>
    </offsets>
  </model>
 
  <!-- Seat -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Seats/Seat/seat.xml</path>
    <offsets>
      <x-m> -2.41903 </x-m>
      <y-m> -0.53581 </y-m>
      <z-m> -0.73499 </z-m>
    </offsets>
  </model>
 
  <!-- Seat Crew -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Seats/Seat-Crew/seat-crew.xml</path>
    <offsets>
      <x-m> 0.000 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.000 </z-m>
    </offsets>
  </model>
 
  <!-- Panel -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/panel.xml</path>
    <offsets>
      <x-m> 0.000 </x-m>
      <y-m> 0.000 </y-m>
      <z-m> 0.000 </z-m>
    </offsets>
  </model>
 
  <!-- Cyclic -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Cyclic/cyclic.xml</path>
    <offsets>
      <x-m> -2.80618 </x-m>
      <y-m> -0.53581 </y-m>
      <z-m> -0.73411 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Cyclic/cyclic.xml</path>
    <offsets>
      <x-m> -2.80618 </x-m>
      <y-m>  0.53581 </y-m>
      <z-m> -0.73411 </z-m>
    </offsets>
  </model>

  <!-- Collective -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Collective/collective.xml</path>
    <offsets>
      <x-m> -2.35452 </x-m>
      <y-m> -0.79258 </y-m>
      <z-m> -0.63643 </z-m>
    </offsets>   
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Collective/collective.xml</path>
    <offsets>
      <x-m> -2.35452 </x-m>
      <y-m>  0.18920 </y-m>
      <z-m> -0.63643 </z-m>
    </offsets>
  </model>

  <!-- Pedals -->

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Pedals/pedals.xml</path>
    <offsets>
      <x-m> -3.24056 </x-m>
      <y-m> -0.53581 </y-m>
      <z-m> -0.64376 </z-m>
    </offsets>
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Pedals/pedals.xml</path>
    <offsets>
      <x-m> -3.24056 </x-m>
      <y-m>  0.53581 </y-m>
      <z-m> -0.64376 </z-m>
    </offsets>
  </model>

  <!-- Overhead panel -->

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/overhead/overhead.xml</path>
    <offsets>
      <x-m> -0.120 </x-m>
      <y-m> -0.000 </y-m>
      <z-m> -0.078 </z-m>
    </offsets>
  </model>

  <!-- Doors animation
  <animation>
    <name>DoorInLeft</name>
    <object-name>intporteG</object-name>
    <object-name>intvitreG</object-name>
    <object-name>inttourporteG</object-name>
  </animation>
 
  <animation>
    <type>pick</type>
    <object-name>DoorInLeft</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>nasal</command>
        <script>doors.crew.toggle();</script>
      </binding>
    </action>
  </animation>
 
  <animation>
    <type>rotate</type>
    <object-name>DoorInLeft</object-name>
    <property>sim/model/door-positions/crew/position-norm</property>
    <factor> -70 </factor>
    <center>
      <x-m> -2.57720 </x-m>
      <y-m> -0.58568 </y-m>
      <z-m> -0.48420 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation>
 
  <animation>
    <name>DoorInRight</name>
    <object-name>intporteD</object-name>
    <object-name>intvitreD</object-name>
    <object-name>inttourporteD</object-name>
  </animation>
 
  <animation>
    <type>pick</type>
    <object-name>DoorInRight</object-name>
    <visible>true</visible>
    <action>
      <button>0</button>
      <repeatable>false</repeatable>
      <binding>
        <command>nasal</command>
        <script>doors.passenger.toggle();</script>
      </binding>
    </action>
  </animation>
 
  <animation>
    <type>rotate</type>
    <object-name>DoorInRight</object-name>
    <property>sim/model/door-positions/passenger/position-norm</property>
    <factor> 80 </factor>
    <center>
      <x-m> -1.66389 </x-m>
      <y-m>  0.60889 </y-m>
      <z-m> -0.42408 </z-m>
    </center>
    <axis>
      <x> 0 </x>
      <y> 0 </y>
      <z> 1 </z>
    </axis>
  </animation> -->
 
</PropertyList>




interior.jpg

Image
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Wed Jun 12, 2019 8:19 pm

Collective directory includes collective.ac; collective.jpg; collective.xml files. Switchs & buttons still need animations.

Image

collective.xml file

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!--
    ===========================================================
           Collective "Westland-Lynx-AH7" Animation file

                  Patrizio MELIS : Apr. 2019

                     CC-BY-NC-SA 4.0

     Strictly NOT allowed commercial projects with these files

    ===========================================================
-->

<PropertyList>
 
  <path>collective.ac</path>
 
  <animation>
    <!-- Objects List -->
    <object-name>COL-AFCS-CUTOUT</object-name>
    <object-name>COL-BASE</object-name>
    <object-name>COL-BASE-SWITCH.000</object-name>
    <object-name>COL-BASE-SWITCH.001</object-name>
    <object-name>COL-BOLTS</object-name>
    <object-name>COL-CAC-CUTOUT</object-name>
    <object-name>COL-CWP-CANCEL</object-name>
    <object-name>COL-FIRE</object-name>
    <object-name>COL-FIRE-COVER</object-name>
    <object-name>COL-GEAR</object-name>
    <object-name>COL-HANDLE.000</object-name>
    <object-name>COL-HANDLE.001</object-name>
    <object-name>COL-POINTER</object-name>
    <object-name>COL-PTT</object-name>
    <object-name>COL-SHIELD</object-name>
    <object-name>COL-STICK</object-name>
    <object-name>COL-SWITCH.000</object-name>
    <object-name>COL-SWITCH.001</object-name>
  </animation>
 
  <animation>
    <!-- Objects Linked To Texture -->
    <object-name>COL-AFCS-CUTOUT</object-name>
    <object-name>COL-BASE</object-name>
    <object-name>COL-BASE-SWITCH.000</object-name>
    <object-name>COL-BASE-SWITCH.001</object-name>
    <object-name>COL-BOLTS</object-name>
    <object-name>COL-CAC-CUTOUT</object-name>
    <object-name>COL-CWP-CANCEL</object-name>
    <object-name>COL-FIRE</object-name>
    <object-name>COL-FIRE-COVER</object-name>
    <object-name>COL-GEAR</object-name>
    <object-name>COL-HANDLE.000</object-name>
    <object-name>COL-HANDLE.001</object-name>
    <object-name>COL-POINTER</object-name>
    <object-name>COL-PTT</object-name>
    <object-name>COL-SHIELD</object-name>
    <object-name>COL-STICK</object-name>
    <object-name>COL-SWITCH.000</object-name>
    <object-name>COL-SWITCH.001</object-name>
   
    <property-base>sim/model/livery</property-base>
    <texture-prop>collective</texture-prop>
    <texture>collective.jpg</texture>
    <specular>
      <red-prop>specular/red</red-prop>
      <green-prop>specular/green</green-prop>
      <blue-prop>specular/blue</blue-prop>
    </specular>
  </animation>
 
  <animation>
    <name>Collective-FULL</name>
    <!-- Objects Put On List For Main Animation -->
    <object-name>COL-AFCS-CUTOUT</object-name>
    <object-name>COL-BASE-SWITCH.000</object-name>
    <object-name>COL-BASE-SWITCH.001</object-name>
    <object-name>COL-BOLTS</object-name>
    <object-name>COL-CAC-CUTOUT</object-name>
    <object-name>COL-CWP-CANCEL</object-name>
    <object-name>COL-FIRE</object-name>
    <object-name>COL-FIRE-COVER</object-name>
    <object-name>COL-GEAR</object-name>
    <object-name>COL-HANDLE.000</object-name>
    <object-name>COL-HANDLE.001</object-name>
    <object-name>COL-POINTER</object-name>
    <object-name>COL-PTT</object-name>
    <object-name>COL-SHIELD</object-name>
    <object-name>COL-STICK</object-name>
    <object-name>COL-SWITCH.000</object-name>
    <object-name>COL-SWITCH.001</object-name>
  </animation>
 
  <animation>
    <type>rotate</type>
    <object-name>Collective-FULL</object-name>
   
    <property>controls/engines/engine[0]/throttle</property>
    <factor> -20</factor>
    <offsets>
      <x-m> 0 </x-m>
      <y-m> 0 </y-m>
      <z-m> 0 </z-m>
    </offsets>
    <axis>
      <x>  0 </x>
      <y>  1 </y>
      <z>  0 </z>
    </axis>
  </animation>

</PropertyList>





Image
Last edited by cobe571 on Wed Jun 12, 2019 8:27 pm, edited 1 time in total.
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Wed Jun 12, 2019 8:26 pm

Cyclic directory includes cyclic.ac; cyclic.jpg; cyclic.xml files. Switchs & buttons still need animations.

Image

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!--
     =========================================================
            Cyclic "Westland-Lynx-AH7" Animation file
         
                    Patrizio MELIS : Apr. 2019
         
                        CC-BY-NC-SA 4.0
                               
     Strictly NOT allowed commercial projects with these files

     =========================================================
-->

<PropertyList>

  <path>cyclic.ac</path>

  <animation>
    <type>range</type>
    <min-m>  0 </min-m>
    <max-m> 35 </max-m>
  </animation>
   
  <animation>
    <!-- Objects List -->
    <object-name>CYC-AFCS-CUTOUT</object-name>   
    <object-name>CYC-BOLTS</object-name>
    <object-name>CYC-CAC-CUTOUT</object-name>   
    <object-name>CYC-CWP-CANCEL</object-name>
    <object-name>CYC-FIRE</object-name>
    <object-name>CYC-FIRE-COVER</object-name>   
    <object-name>CYC-HANDLE</object-name>
    <object-name>CYC-POINTER</object-name>
    <object-name>CYC-PTT</object-name>
    <object-name>CYC-REL</object-name>
    <object-name>CYC-STICK</object-name>
  </animation>

  <animation>
    <!-- Objects Linked To Texture -->
    <type>material</type>
    <object-name>CYC-AFCS-CUTOUT</object-name>   
    <object-name>CYC-BOLTS</object-name>
    <object-name>CYC-CAC-CUTOUT</object-name>   
    <object-name>CYC-CWP-CANCEL</object-name>
    <object-name>CYC-FIRE</object-name>
    <object-name>CYC-FIRE-COVER</object-name>   
    <object-name>CYC-HANDLE</object-name>
    <object-name>CYC-POINTER</object-name>
    <object-name>CYC-PTT</object-name>
    <object-name>CYC-REL</object-name>
    <object-name>CYC-STICK</object-name>

    <property-base>sim/model/livery</property-base>
    <texture-prop>cyclic</texture-prop>
    <texture>cyclic.jpg</texture>
    <specular>
      <red-prop>specular/red</red-prop>
      <green-prop>specular/green</green-prop>
      <blue-prop>specular/blue</blue-prop>
    </specular>
  </animation>

  <animation>
    <name>Complete-Cyclic</name>
    <!-- Objects Put On List For Main Animation -->
    <object-name>CYC-AFCS-CUTOUT</object-name>   
    <object-name>CYC-BOLTS</object-name>
    <object-name>CYC-CAC-CUTOUT</object-name>   
    <object-name>CYC-CWP-CANCEL</object-name>
    <object-name>CYC-FIRE</object-name>
    <object-name>CYC-FIRE-COVER</object-name>   
    <object-name>CYC-HANDLE</object-name>
    <object-name>CYC-POINTER</object-name>
    <object-name>CYC-PTT</object-name>
    <object-name>CYC-REL</object-name>
    <object-name>CYC-STICK</object-name>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Complete-Cyclic</object-name>
    <property>controls/flight/elevator</property>
    <factor>9</factor>
    <center>
          <x-m> 0.00 </x-m>
          <y-m> 0.00 </y-m>
          <z-m> 0.00 </z-m>
    </center>
        <axis>
          <x>  0 </x>
          <y> -1 </y>
          <z>  0 </z>
        </axis>
  </animation>

  <animation>
    <type>rotate</type>
    <object-name>Complete-Cyclic</object-name>
    <property>controls/flight/aileron</property>
    <factor>9</factor>
    <center>
          <x-m> 0.00 </x-m>
          <y-m> 0.00 </y-m>
          <z-m> 0.00 </z-m>
    </center>
        <axis>
          <x> -1 </x>
          <y>  0 </y>
          <z>  0 </z>
        </axis>
  </animation>

</PropertyList>



Image
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Wed Jun 12, 2019 9:08 pm

Panel directory includes the Instruments folder

Image

the file panel.xml which defines, among the various functions, also the position of the instruments.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!--
     =========================================================
            Panel "Westland-Lynx-AH7" Animation file

                    Patrizio MELIS : Apr. 2019
         
                        CC-BY-NC-SA 4.0

     Strictly NOT allowed commercial projects with these files

     =========================================================
-->

<PropertyList>

 <path>panel.ac</path>
 
  <animation>
    <!-- Opaque Objects List -->
    <object-name>PANEL-CENTER</object-name>
    <object-name>PANEL-LEFT</object-name>
    <object-name>PANEL-MAIN</object-name>
    <object-name>PANEL-RIGHT</object-name>
    <object-name>SHIELD</object-name>   
  </animation>
 
  <animation>
    <!-- Objects Linked To Texture -->
    <type>material</type>
    <object-name>PANEL-CENTER</object-name>
    <object-name>PANEL-LEFT</object-name>
    <object-name>PANEL-MAIN</object-name>
    <object-name>PANEL-RIGHT</object-name>
    <object-name>SHIELD</object-name>
   
    <property-base>sim/model/livery</property-base>
    <texture-prop>panel</texture-prop>
    <texture>panel.jpg</texture>
    <specular>
      <red-prop>specular/red</red-prop>
      <green-prop>specular/green</green-prop>
      <blue-prop>specular/blue</blue-prop>
    </specular>
  </animation>

  <animation>
        <type>range</type>
        <min-m>0</min-m>
        <max-m>75</max-m>
  </animation>
 
 <!-- Switches -->
  <model>
   <name>Landing lights</name>
   <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/switches/landing-lights.xml</path>
    <offsets>
        <x-m>-3.176</x-m>
        <y-m>-0.098</y-m>
        <z-m>0.045</z-m>
        <pitch-deg>10</pitch-deg>
        <roll-deg>-180</roll-deg>
    </offsets>
   <overlay>
    <animation n="100">
    <type>scale</type>
    <property>constants/zero</property>
    <x-offset>1.35</x-offset>
    <y-offset>1.35</y-offset>
    <z-offset>1.5</z-offset>
    </animation>
    </overlay>
   </model>
   
  <animation>
    <type>select</type>
    <object-name>NoseGearLandinglight</object-name>
    <object-name>Taxi-Light-Left</object-name>
         
    <condition>
      <equals>
        <property>controls/switches/landing-lights-switch</property>
        <value> 0 </value>
      </equals>
    </condition>
  </animation>
 
  <model>
    <name>beacon Lights</name>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/switches/beacon.xml</path>
    <offsets>
        <x-m>-3.179</x-m>
        <y-m>-0.098</y-m>
        <z-m>0.075</z-m>
        <pitch-deg>10</pitch-deg>
        <roll-deg>-180</roll-deg>
    </offsets>
   <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1.35</x-offset>
        <y-offset>1.35</y-offset>
        <z-offset>1.5</z-offset>
        </animation>
    </overlay>
  </model>
   
  <animation>
        <type>select</type>
        <object-name>BeaconFlare</object-name>
        <object-name>BeaconRemb</object-name>
        <condition>
          <equals>
          <property>controls/switches/beacon-switch</property>
          <value> 0 </value>
          </equals>
        </condition>
  </animation>    
   
  <!-- Instruments -->
 
     <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/MagCompass/magcompass.xml</path>
        <offsets>
          <x-m>-3.243</x-m>
          <y-m>-0.025</y-m>
          <z-m>0.29</z-m>
        <pitch-deg>0</pitch-deg>
        </offsets>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/ai/ai-gaz.xml</path>
        <offsets>
          <x-m>-3.216</x-m>
          <y-m>0.5</y-m>
          <z-m>-0.079</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
   
   <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>0.3</x-offset>
        <y-offset>1.38</y-offset>
        <z-offset>1.5</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/ai/ai-gaz.xml</path>
        <offsets>
          <x-m>-3.2135</x-m>
          <y-m>-0.491</y-m>
          <z-m>-0.092</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>0.3</x-offset>
        <y-offset>1.38</y-offset>
        <z-offset>1.5</z-offset>
        </animation>
    </overlay>   
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/alt/alt-gaz.xml</path>
        <offsets>
          <x-m>-3.215</x-m>
          <y-m>0.635</y-m>
          <z-m>-0.096</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.45</y-offset>
        <z-offset>1.45</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/alt/alt-gaz.xml</path>
        <offsets>
          <x-m>-3.217</x-m>
          <y-m>-0.352</y-m>
          <z-m>-0.088</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.45</y-offset>
        <z-offset>1.45</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/asi/asi-gaz.xml</path>
        <offsets>
          <x-m>-3.221</x-m>
          <y-m>0.37</y-m>
          <z-m>-0.0735</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.4</y-offset>
        <z-offset>1.4</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/asi/asi-gaz.xml</path>
        <offsets>
          <x-m>-3.214</x-m>
          <y-m>-0.62-5</y-m>
          <z-m>-0.106</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.4</y-offset>
        <z-offset>1.4</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/chronograph/chronograph.xml</path>
        <offsets>
          <x-m>-3.175</x-m>
          <y-m>0.35</y-m>
          <z-m>0.055</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.25</y-offset>
        <z-offset>1.25</z-offset>
        </animation>
    </overlay>
  </model>
 
   <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/MASS/MASS.xml</path>
        <offsets>
          <x-m>-3.183</x-m>
          <y-m>0.202</y-m>
          <z-m>-0.162</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.5</y-offset>
        <z-offset>1.65</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/torque-gaz/torque-gaz.xml</path>
        <offsets>
          <x-m>-3.203</x-m>
          <y-m>0.37</y-m>
          <z-m>-0.178</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.4</y-offset>
        <z-offset>1.4</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/torque-gaz/torque-gaz.xml</path>
        <offsets>
          <x-m>-3.196</x-m>
          <y-m>-0.6215</y-m>
          <z-m>-0.215</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.4</y-offset>
        <z-offset>1.4</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/ai/ai.xml</path>
        <offsets>
          <x-m>-3.219</x-m>
          <y-m>0.37</y-m>
          <z-m>-0.275</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1</y-offset>
        <z-offset>1</z-offset>
        </animation>
    </overlay>
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/gyrocomp/gyro-compass.xml</path>
        <offsets>
           <x-m>-3.19</x-m>
           <y-m>0.494</y-m>
           <z-m>-0.224</z-m>
           <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1</y-offset>
        <z-offset>1</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/gyrocomp/gyro-compass.xml</path>
        <offsets>
           <x-m>-3.196</x-m>
           <y-m>-0.496</y-m>
           <z-m>-0.233</z-m>
           <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1</y-offset>
        <z-offset>1</z-offset>
        </animation>
    </overlay>
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/ralt/ralt.xml</path>
        <offsets>
           <x-m>-3.198</x-m>
           <y-m>0.629</y-m>
           <z-m>-0.207</z-m>
           <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.1</y-offset>
        <z-offset>1.1</z-offset>
        </animation>
    </overlay>
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/ralt/ralt.xml</path>
        <offsets>
           <x-m>-3.201</x-m>
           <y-m>-0.357</y-m>
           <z-m>-0.191</z-m>
           <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.1</y-offset>
        <z-offset>1.1</z-offset>
        </animation>
    </overlay>
  </model>
   
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/vsi/vsi-gaz.xml</path>
        <offsets>
           <x-m>-3.18</x-m>
           <y-m>0.628</y-m>
           <z-m>-0.306</z-m>
           <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1</y-offset>
        <z-offset>1</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/vsi/vsi-gaz.xml</path>
        <offsets>
           <x-m>-3.184</x-m>
           <y-m>-0.355</y-m>
           <z-m>-0.28</z-m>
           <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1</y-offset>
        <z-offset>1</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/tach/tach.xml</path>
        <offsets>
          <x-m>-3.186</x-m>
          <y-m>0.25</y-m>
          <z-m>-0.286</z-m>
          <pitch-deg>-10</pitch-deg>
          </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.08</y-offset>
        <z-offset>1.08</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/n1_1.xml</path>
        <offsets>
          <x-m>-3.185</x-m>
          <y-m>0.10</y-m>
          <z-m>-0.275</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.3</y-offset>
        <z-offset>1.3</z-offset>
        </animation>
    </overlay>
  </model>

  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/n1_2.xml</path>
        <offsets>
          <x-m>-3.185</x-m>
          <y-m>0.164</y-m>
          <z-m>-0.275</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.3</y-offset>
        <z-offset>1.3</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/n2_1.xml</path>
        <offsets>
          <x-m>-3.1755</x-m>
          <y-m>0.10</y-m>
          <z-m>-0.346</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.3</y-offset>
        <z-offset>1.3</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/n2_2.xml</path>
        <offsets>
          <x-m>-3.1755</x-m>
          <y-m>0.164</y-m>
          <z-m>-0.346</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.3</y-offset>
        <z-offset>1.3</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/fuel/fuelqty.xml</path>
        <offsets>
          <x-m>-3.1899</x-m>
          <y-m>0.011</y-m>
          <z-m>-0.275</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.0</y-offset>
        <z-offset>1.0</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/epr_1.xml</path>
        <offsets>
          <x-m>-3.184</x-m>
          <y-m>-0.117</y-m>
          <z-m>-0.2975</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.13</y-offset>
        <z-offset>1.13</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/epr_2.xml</path>
        <offsets>
          <x-m>-3.184</x-m>
          <y-m>-0.065</y-m>
          <z-m>-0.2975</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.13</y-offset>
        <z-offset>1.13</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/exh_1.xml</path>
        <offsets>
          <x-m>-3.175</x-m>
          <y-m>-0.117</y-m>
          <z-m>-0.35</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.13</y-offset>
        <z-offset>1.13</z-offset>
        </animation>
    </overlay>
  </model>
 
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/eng_control/exh_2.xml</path>
        <offsets>
          <x-m>-3.175</x-m>
          <y-m>-0.065</y-m>
          <z-m>-0.35</z-m>
          <pitch-deg>-10</pitch-deg>
        </offsets>
    <overlay>
        <animation n="100">
        <type>scale</type>
        <property>constants/zero</property>
        <x-offset>1</x-offset>
        <y-offset>1.13</y-offset>
        <z-offset>1.13</z-offset>
        </animation>
    </overlay>
  </model>

<!-- warning panel ligts -->
  <model>
    <path>Aircraft/Westland_Lynx-AH7/Models/Interior/Panel/Instruments/cwp.xml</path>
        <offsets>
          <x-m> -0.220 </x-m>
          <y-m> -0.024 </y-m>
          <z-m>  0.056 </z-m>
          <pitch-deg>0</pitch-deg>
        </offsets>
  </model>
   
</PropertyList>



Image
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby Michat » Thu Jun 13, 2019 8:27 pm

I like to watch this threat * while listening to some techno music. Results are even better.

Edit. Don't want to create confusion instead of threat I meant thread. Sorry iI'm using virtual keyboard. Not easy. No typing memory gestures, just rude mouse job

As I tried to say, enjoy this thread with music.

29.92
User avatar
Michat
 
Posts: 958
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Westland Lynx AH7

Postby cobe571 » Tue Jun 18, 2019 9:20 am

The music that keeps me company when I draw is certainly not the techno music that is not music for sure. I prefer Hard Rock music.

I mean this kind of Rock

https://www.youtube.com/watch?v=gQwg4wmRNBA
Last edited by cobe571 on Tue Jun 25, 2019 9:40 pm, edited 1 time in total.
"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Wed Jun 19, 2019 7:40 pm

Inside the NASAL folder...

Image


engine.nas file

Code: Select all

# engine.nas by geed

var pi = 3.14159;
var PWR2TRQ = 60 / 2 / pi * 6.931;
var PWR2TRQPCT = PWR2TRQ / 986 * 100;

var max = func(a, b) a > b ? a : b;
var min = func(a, b) a < b ? a : b;

#set caution ranges for enigines oil temp and press gauges
setprop("/engines/oilt-caution-lo-degc",30);
setprop("/engines/oilt-caution-hi-degc",120);
setprop("/engines/oilp-caution-lo-bar",1.5);
setprop("/engines/oilp-caution-hi-bar",8);
setprop("/engines/oilp-ratio-bar-to-psi",21); # this is the ratio for the OIL PSI instrument to show the right value, not the real life ratio (which is 14.5038)

var oilpressure =  func(n){

  oilpres_low = props.globals.getNode("/engines/engine[" ~ n ~ "]/oil-pressure-low", 1);
  oilpres_norm = props.globals.getNode("/engines/engine[" ~ n ~ "]/oil-pressure-norm", 1);
  oilpres_bar = props.globals.getNode("/engines/engine[" ~ n ~ "]/oil-pressure-bar", 1);

  var rpm = props.globals.getValue("/engines/engine[" ~ n ~ "]/n2-rpm") or 0;

  if ( rpm > 0 ) oilpres_low.setDoubleValue((15-22000/rpm)*0.0689);
  if ( rpm > 0 ) oilpres_norm.setDoubleValue((60-22000/rpm)*0.0689);

  settimer(func { oilpressure(n) }, 0);
}

oilpressure(0);
oilpressure(1);

##############

var oilpressurebar = func(n){

  oilpres_bar = props.globals.getNode("/engines/engine[" ~ n ~ "]/oil-pressure-bar", 1);

  var rpm = props.globals.getValue("/engines/engine[" ~ n ~ "]/n2-rpm") or 0;
  var oilpres_low = props.globals.getValue("/engines/engine[" ~ n ~ "]/oil-pressure-low") or 0;
  var oilpres_norm = props.globals.getValue("/engines/engine[" ~ n ~ "]/oil-pressure-norm") or 0;

  # by litzi clamp oilpressure >= 0
 
  if ((rpm > 0) and (rpm < 23000)){
    interpolate ("/engines/engine[" ~ n ~ "]/oil-pressure-bar", max(oilpres_low, 0) , 1.5);
  }elsif (rpm > 23000) {
    interpolate ("/engines/engine[" ~ n ~ "]/oil-pressure-bar", max(oilpres_norm, 0) , 2);
  }

  settimer(func { oilpressurebar(n) }, 0.1);
}

oilpressurebar(0);
oilpressurebar(1);

##################

var oiltemp = func(n){

  var OAT = props.globals.getValue("/environment/temperature-degc") or 0;
  var oilpres_bar = props.globals.getValue("/engines/engine[" ~ n ~ "]/oil-pressure-bar") or 0;
  var rpm = props.globals.getValue("/engines/engine[" ~ n ~ "]/n2-rpm") or 0;
  ot = props.globals.getNode("/engines/engine[" ~ n ~ "]/oil-temperature-degc", 1);

 
  if (oilpres_bar >1){
    interpolate ("/engines/engine[" ~ n ~ "]/oil-temperature-degc", ((25-22000/rpm)*oilpres_bar)+OAT , 20);
  } else {
    interpolate ("/engines/engine[" ~ n ~ "]/oil-temperature-degc", OAT , 20);
  }

  settimer( func { oiltemp(n) }, 0);
}

oiltemp(0);
oiltemp(1);

#########################################

###main gear box oil pressure###
var mgbp =  func {

  #create oilpressure#
  mgb_oilpres_low = props.globals.getNode("/rotors/gear/mgb-oil-pressure-low", 1);
  mgb_oilpres_norm = props.globals.getNode("/rotors/gear/mgb-oil-pressure-norm", 1);
  mgb_oilpres_bar = props.globals.getNode("/rotors/gear/mgb-oil-pressure-bar", 1);

  var rpm = props.globals.getValue("/rotors/main/rpm") or 0;

  if ( rpm > 0 ) mgb_oilpres_low.setDoubleValue((15-230/rpm)*0.0689);
  if ( rpm > 0 ) mgb_oilpres_norm.setDoubleValue((60-230/rpm)*0.0689);

  settimer(mgbp, 0);
}

mgbp();

##############

var mgbp_bar = func{

  mgb_oilpres_bar = props.globals.getNode("/rotors/gear/mgb-oil-pressure-bar", 1);

  var rpm = props.globals.getValue("/rotors/main/rpm") or 0;
  mgb_oilpres_low = props.globals.getValue("/rotors/gear/mgb-oil-pressure-low") or 0;
  mgb_oilpres_norm = props.globals.getValue("/rotors/gear/mgb-oil-pressure-norm") or 0;

  if ((rpm > 0) and (rpm < 280)){
    interpolate ("/rotors/gear/mgb-oil-pressure-bar",max(mgb_oilpres_low,0), 1.5);
  }elsif (rpm > 280) {
    interpolate ("/rotors/gear/mgb-oil-pressure-bar",max(mgb_oilpres_norm,0), 2);
  }

  settimer(mgbp_bar, 0.1);
}

mgbp_bar();



FGUKinit.nas file by FGUK team

Code: Select all

#Radio Power Logic
var radiopower = {
   update : func {
        var batswitch = getprop("/controls/electric/directbat-switch");
        var generator = getprop("/controls/electric/engine/generator");
        if (batswitch == 1 or generator == 1) {
            setprop("/controls/electric/radiopower", 1);
        } else {
            setprop("/controls/electric/radiopower", 0);
        }
    },
};

#Radio Power Logic
var hydraulic1 = {
   update : func {
        var alternator = getprop("/systems/electrical/serviceable");
        if (alternator == 1) {
            setprop("/controls/hydraulic/system/engine-pump", 1);
        } else {
            setprop("/controls/hydraulic/system/engine-pump", 0);
        }
    },
};

setlistener("/controls/electric/directbat-switch", func {radiopower.update();});
setlistener("/controls/electric/engine/generator", func {radiopower.update();});
setlistener("/systems/electrical/serviceable", func {hydraulic1.update();});



flir.nas file - flir camera control

Code: Select all

# flir camera control
# 12/2017 by G-EED

var sar_selected = 0;

var nodeFlir=nil;
var numWeight=0;
var options = std.Vector.new();
var numView = 0;

stringContainWords = func(s,words){
   var found = 0;
   foreach(var w; words.vector) {
      if( string.match(s,w) ){
         found=1;
         break;
      }
   }
   return found;
}

activate_flir_shader = func(a){
   if(getprop("sim/rendering/rembrandt/enabled")==0){
      setprop("sim/rendering/als-filters/use-filtering", a);
      setprop("sim/rendering/als-filters/use-IR-vision", a);
   }else{
      setprop("sim/rendering/rembrandt/night-vision", a);
   }
}

check_view_for_flir = func(n){
   print("check_view_for_flir",n,"");

   var viewnum = 0;
   foreach(var w; props.globals.getNode("sim").getChildren("view")) {
      if(n==viewnum){
           var selected = w.getNode("flir");
           if(selected != nil) {
               print("view ",viewnum," has a FLIR");
               activate_flir_shader(1);
           }else{
              print("view ",viewnum," has no FLIR");
              activate_flir_shader(0);
           }
        }
        viewnum=viewnum+1;
    }
}

setlistener("sim/signals/fdm-initialized", func {

   nodeFlir = props.globals.getNode("sim/flir");
   if(nodeFlir != nil){
      numWeight = nodeFlir.getValue("weight");
      if(numWeight!=nil){
         numView = nodeFlir.getValue("view");
         if(numWeight!=nil){

            foreach(var w; nodeFlir.getNode("options").getChildren("name")) {
               options.append(w.getValue());
             }
            
             if(options.size() > 0){

               setlistener("sim/weight["~numWeight~"]/selected", func(s) {
                  if( stringContainWords( getprop("sim/weight["~numWeight~"]/selected") , options ) == 1 ){
                     print("SAR selected");
                     setprop("sim/view["~numView~"]/enabled",1);
                     #activate_flir_shader(1);
                  }else{
                     print("SAR deselected");
                     setprop("sim/view["~numView~"]/enabled",0);
                     #activate_flir_shader(0);
                  }
               }, 1);

               setlistener("/sim/current-view/view-number", func(n) {
                  check_view_for_flir(n.getValue());
               }, 1);

               print("Flir: SUCCESS! view control ......... Initialized");
             }else{
                print("Flir: FAILED! Error: No options have been defined for the weight",numWeight);
             }

         }else{
            print("Flir: FAILED! Error: No FLIR view has been defined");
         }
      }else{
         print("Flir: FAILED! Error: Could not find property node sim/flir/_attr_/weight");
      }
   }else{
      print("Flir: FAILED! Error: Could not find property node sim/flir");
   }
});



Lights.nas file

Code: Select all

#Universal light systems by Tomaskom

var lightsPath = "lightpack/"; #path to the property node, where all internal values are placed

#list of switches for lights - if you don't intend to use some light, assign it nil value instead, like whateverSwitch = nil; and you don't need to care about anything else
var navSwitch = "/controls/switches/nav-lights-switch";
var beaconSwitch = "/controls/switches/beacon-switch";
var strobeSwitch = "/controls/switches/strobe-switch";
var landingSwitch = "/controls/switches/landing-lights-switch";
var taxiSwitch = nil;
var probeSwitch = nil;
var whiteSwitch = "/controls/switches/nav-lights-switch";

#switch this from 1 to 0 if you want to use advanced cyclical fading animation of the the nav lights instead of being stable on when the switch is on
navStillOn = 1;
#switch this from 0 to 1 if you want to bind the landing and taxi lights to the landing gear
gearBind = 0;



#### NAV LIGHTS ####

#class for a periodic fade in/out animation - for flashing, use rather standard aircraft.light.new(), as in Beacon and Strobe section
var lightCycle = {
   #constructor
   new: func(propSwitch, propOut) {
      m = { parents: [lightCycle] };
      props.globals.initNode(propOut, 0, "DOUBLE");
      props.globals.initNode(propSwitch, 1, "BOOL");
      m.fadeIn = 0.4; #fade in time
      m.fadeOut = 0.4; #fade out time
      m.stayOn = 1.5; #stable on period
      m.stayOff = 1; #stable off period
      m.turnOff = 0.12; #fade out time when turned off
      m.phase = 0; #phase to be run on next timer call: 0 -> fade in, 1 -> stay on, 2 -> fade out, 3 -> stay off
      m.cycleTimer = maketimer(0.1, func {
         if(getprop(propSwitch)) {
            if(m.phase == 0) {
               interpolate(propOut, 1, m.fadeIn);
               m.phase = 1;
               m.cycleTimer.restart(m.fadeIn);
            }
            else if(m.phase == 1){
               m.phase = 2;
               m.cycleTimer.restart(m.stayOn);
            }
            else if(m.phase == 2){
               interpolate(propOut, 0, m.fadeOut);
               m.phase = 3;
               m.cycleTimer.restart(m.fadeOut);
            }
            else if(m.phase == 3){
               m.phase = 0;
               m.cycleTimer.restart(m.stayOff);
            }
         }
         else {
            interpolate(propOut, 0, m.turnOff); #kills any currently ongoing interpolation
            m.phase = 0;
         }
      });
      m.cycleTimer.singleShot = 1;
      if(propSwitch==nil) {
         m.listen = nil;
         return m;
      }
      m.listen = setlistener(propSwitch, func{m.cycleTimer.restart(0);}); #handle switch changes
      m.cycleTimer.restart(0); #start the looping
      return m;
   },
   #destructor
   del: func {
      if(me.listen!=nil) removelistener(me.listen);
      me.cycleTimer.stop();
   },
};

#By default, the switch property is initialized to 1 (only if no value is already assigned). Don't change the class implementation! To override this, set the property manually. You don't need to care if any other code already does it for you.
var navLights = nil;
if(!navStillOn) {
   navLights = lightCycle.new(navSwitch, lightsPath~"nav-lights-intensity");
   ### Uncomment and tune those to customize times ###
   #navLights.fadeIn = 0.4; #fade in time
   #navLights.fadeOut = 0.4; #fade out time
   #navLights.stayOn = 3; #stable on period
   #navLights.stayOff = 0.6; #stable off period
   #navLights.turnOff = 0.12; #fade out time when turned off
}


### BEACON ###
var beacon = nil;
if(beaconSwitch!=nil) {
   props.globals.initNode(beaconSwitch, 1, "BOOL");
   beacon = aircraft.light.new(lightsPath~"beacon-state",
      [0.0, 1.0], beaconSwitch);
}
   
   
### STROBE ###
var strobe = nil;
if(strobeSwitch!=nil) {
   props.globals.initNode(strobeSwitch, 1, "BOOL");
   strobe = aircraft.light.new(lightsPath~"strobe-state",
      [0.0, 0.87], strobeSwitch);
}


### LIGHT FADING ###

#class for controlling fade in/out behavior - propIn is a control property (handled as a boolean) and propOut is interpolated
#all light brightness animations in xmls depend on propOut (Rembrandt brightness, material emission, flares transparency, ...)
var lightFadeInOut = {
   #constructor
   new: func(propSwitch, propOut) {
      m = { parents: [lightFadeInOut] };
      m.fadeIn = 0.3; #some sane defaults
      m.fadeOut = 0.4;
      if(propSwitch==nil) {
         m.listen = nil;
         return m;
      }
      props.globals.initNode(propSwitch, 1, "BOOL");
      m.isOn = getprop(propSwitch);
      props.globals.initNode(propOut, m.isOn, "DOUBLE");
      m.listen = setlistener(propSwitch,
         func {
            if(m.isOn and !getprop(propSwitch)) {
               interpolate(propOut, 0, m.fadeOut);
               m.isOn = 0;
            }
            if(!m.isOn and getprop(propSwitch)) {
               interpolate(propOut, 1, m.fadeIn);
               m.isOn = 1;
            }
         }
      );
      return m;
   },
   #destructor
   del: func {
      if(me.listen!=nil) removelistener(me.listen);
   },
};

fadeLanding = lightFadeInOut.new(landingSwitch, lightsPath~"landing-lights-intensity");
fadeTaxi = lightFadeInOut.new(taxiSwitch, lightsPath~"taxi-light-intensity");
fadeProbe = lightFadeInOut.new(probeSwitch, lightsPath~"probe-light-intensity");
fadeWhite = lightFadeInOut.new(whiteSwitch, lightsPath~"white-light-intensity");
if(navStillOn) {
   navLights = lightFadeInOut.new(navSwitch, lightsPath~"nav-lights-intensity");
   navLights.fadeIn = 0.1;
   navLights.fadeOut = 0.12;
}
#manipulate times if defaults don't fit your needs:
#fadeLanding.fadeIn = 0.5;
#fadeLanding.fadeOut = 0.8;


#enable binding to gear
if(gearBind) {
   setlistener("/controls/gear/gear-down", func {
      gearDown = getprop("/controls/gear/gear-down");
      if(gearDown) {
         if(landingSwitch!=nil) setprop(landingSwitch, 1);
         if(taxiSwitch!=nil) setprop(taxiSwitch, 1);
      }
      else{
         if(landingSwitch!=nil) setprop(landingSwitch, 0);
         if(taxiSwitch!=nil) setprop(taxiSwitch, 0);
      }
   });
}

print("Lightpack light system initialized");



liveries.nas file

Code: Select all

aircraft.livery.init("Aircraft/Westland_Lynx-AH7/Models/Liveries");



ralt.nas by StuartC

Code: Select all

# RALT control
# 10/2018 by StuartC

setprop("/instrumentation/radar-altimeter/decision-height", 200);
setprop("/instrumentation/radar-altimeter/decision-height-light", 0);

var OurAlt            = props.globals.getNode("position/altitude-ft");
var DecisionHeight    = props.globals.getNode("/instrumentation/radar-altimeter/decision-height");

setprop("/instrumentation/radar-altimeter/decision-height-light", 0);

# Main loop ###############
var rdr_loop = func() {
   var alt = OurAlt.getValue();
   var decHeight = DecisionHeight.getValue();

   if( alt < decHeight ){
      setprop("/instrumentation/radar-altimeter/decision-height-light", 1);
   }else{
      setprop("/instrumentation/radar-altimeter/decision-height-light", 0);
   }   

   settimer(rdr_loop, 1.0);
}

settimer(rdr_loop, 1.0);



sound-helper.nas file

Code: Select all

var view_level_inside = props.globals.initNode("/sound/view-level-inside");
var view_level_outside = props.globals.initNode("/sound/view-level-outside");

setlistener("sim/current-view/internal", func{
      if(getprop("sim/current-view/internal")==1){
         view_level_inside.setValue(1.0);
         view_level_outside.setValue(0.0);
      }else{
         view_level_inside.setValue(0.0);
         view_level_outside.setValue(1.0);
      }
}, 1);



westland_lynx-ah7.nas file

Code: Select all

# (c) Melchior FRANZ  < mfranz # flightgear : org >




if (!contains(globals, "cprint"))
   var cprint = func nil;

var devel = !!getprop("devel");
var quickstart = !!getprop("quickstart");

var sin = func(a) math.sin(a * D2R);
var cos = func(a) math.cos(a * D2R);
var pow = func(v, w) math.exp(math.ln(v) * w);
var npow = func(v, w) v ? math.exp(math.ln(abs(v)) * w) * (v < 0 ? -1 : 1) : 0;
var clamp = func(v, min = 0, max = 1) v < min ? min : v > max ? max : v;
var normatan = func(x, slope = 1) math.atan2(x, slope) * 2 / math.pi;
var bell = func(x, spread = 2) pow(math.e, -(x * x) / spread);
var max = func(a, b) a > b ? a : b;
var min = func(a, b) a < b ? a : b;


# doors =============================================================
var Doors = {
   new: func {
      var m = { parents: [Doors] };
      m.active = 0;
      m.list = [];
      foreach (var d; props.globals.getNode("sim/model/westland_lynx-ah7/doors").getChildren("door"))
         append(m.list, aircraft.door.new(d, 2.5));
      return m;
   },
   next: func {
      me.select(me.active + 1);
   },
   previous: func {
      me.select(me.active - 1);
   },
   select: func(which) {
      me.active = which;
      if (me.active < 0)
         me.active = size(me.list) - 1;
      elsif (me.active >= size(me.list))
         me.active = 0;
      gui.popupTip("Selecting " ~ me.list[me.active].node.getNode("name").getValue());
   },
   toggle: func {
      me.list[me.active].toggle();
   },
   reset: func {
      foreach (var d; me.list)
         d.setpos(0);
   },
};



# fuel ==============================================================

# density = 6.682 lb/gal [Flight Manual Section 9.2]
# avtur/JET A-1/JP-8
var FUEL_DENSITY = getprop("/consumables/fuel/tank/density-ppg"); # pound per gallon
var GAL2LB = FUEL_DENSITY;
var LB2GAL = 1 / GAL2LB;
var KG2GAL = KG2LB * LB2GAL;
var GAL2KG = 1 / KG2GAL;



var Tank = {
   new: func(n) {
      var m = { parents: [Tank] };
      m.capacity = n.getNode("capacity-gal_us").getValue();
      m.level_galN = n.initNode("level-gal_us", m.capacity);
      m.level_lbN = n.getNode("level-lbs");
      m.consume(0);
      return m;
   },
   level: func {
      return me.level_galN.getValue();
   },
   consume: func(amount) { # US gal (neg. values for feeding)
      var level = me.level();
      if (amount > level)
         amount = level;
      level -= amount;
      if (level > me.capacity)
         level = me.capacity;
      me.level_galN.setDoubleValue(level);
      me.level_lbN.setDoubleValue(level * GAL2LB);
      return amount;
   },
};



var fuel = {
   init: func {
      var fuel = props.globals.getNode("/consumables/fuel");
      me.pump_capacity = 6.6 * L2GAL / 60; # same pumps for transfer and supply; from ec135: 6.6 l/min
      me.total_galN = fuel.getNode("total-fuel-gals", 1);
      me.total_lbN = fuel.getNode("total-fuel-lbs", 1);
      me.total_normN = fuel.getNode("total-fuel-norm", 1);
      me.main = Tank.new(fuel.getNode("tank[0]"));
      me.supply = Tank.new(fuel.getNode("tank[1]"));

      var sw = props.globals.getNode("/controls/switches");
      setlistener(sw.initNode("fuel/transfer-pump[10]", 1, "BOOL"), func(n) me.trans1 = n.getValue(), 1);
      setlistener(sw.initNode("fuel/transfer-pump[1]", 1, "BOOL"), func(n) me.trans2 = n.getValue(), 1);
      setlistener("/sim/freeze/fuel", func(n) me.freeze = n.getBoolValue(), 1);
      me.capacity = me.main.capacity + me.supply.capacity;
      me.warntime = 0;
      me.update(0);
   },
   update: func(dt) {
      # transfer pumps (feed supply from main)
      var free = me.supply.capacity - me.supply.level();
      if (free > 0) {
         var trans_flow = (me.trans1 + me.trans2) * me.pump_capacity;
         me.supply.consume(-me.main.consume(min(trans_flow * dt, free)));
      }

      

      var level = me.main.level() + me.supply.level();
      me.total_galN.setDoubleValue(level);
      me.total_lbN.setDoubleValue(level * GAL2LB);
      me.total_normN.setDoubleValue(level / me.capacity);
   },
   level: func {
      return me.supply.level();
   },
   consume: func(amount) {
      return me.freeze ? 0 : me.supply.consume(amount);
   },
};



# engines/rotor =====================================================
var rotor_rpm = props.globals.getNode("rotors/main/rpm");
var torque = props.globals.getNode("rotors/gear/total-torque", 1);
var collective = props.globals.getNode("controls/engines/engine[0]/throttle");
var turbine = props.globals.getNode("sim/model/westland_lynx-ah7/turbine-rpm-pct", 1);
var torque_pct = props.globals.getNode("sim/model/westland_lynx-ah7/torque-pct", 1);
var target_rel_rpm = props.globals.getNode("controls/rotor/reltarget", 1);
var max_rel_torque = props.globals.getNode("controls/rotor/maxreltorque", 1);



var Engine = {
   new: func(n) {
      var m = { parents: [Engine] };
      m.in = props.globals.getNode("controls/engines", 1).getChild("engine", n, 1);
      m.out = props.globals.getNode("engines", 1).getChild("engine", n, 1);
      m.airtempN = props.globals.getNode("/environment/temperature-degc");

      # input
      m.ignitionN = m.in.initNode("ignition", 0, "BOOL");
      m.starterN = m.in.initNode("starter", 0, "BOOL");
      m.powerN = m.in.initNode("power", 0);
      m.magnetoN = m.in.initNode("magnetos", 1, "INT");

      # output
      m.runningN = m.out.initNode("running", 0, "BOOL");
      m.n1_pctN = m.out.initNode("n1-pct", 0);
      m.n2_pctN = m.out.initNode("n2-pct", 0);
      m.n1N = m.out.initNode("n1-rpm", 0);
      m.n2N = m.out.initNode("n2-rpm", 0);
      m.totN = m.out.initNode("tot-degc", m.airtempN.getValue());

      m.starterLP = aircraft.lowpass.new(3);
      m.n1LP = aircraft.lowpass.new(4);
      m.n2LP = aircraft.lowpass.new(4);
      setlistener("/sim/signals/reinit", func(n) n.getValue() or m.reset(), 1);
      m.timer = aircraft.timer.new("/sim/time/hobbs/turbines[" ~ n ~ "]", 10);
      m.running = 0;
      m.fuelflow = 0;
      m.n1 = -1;
      m.up = -1;
      return m;
   },
   reset: func {
      me.magnetoN.setIntValue(1);
      me.ignitionN.setBoolValue(0);
      me.starterN.setBoolValue(0);
      me.powerN.setDoubleValue(0);
      me.runningN.setBoolValue(me.running = 0);
      me.starterLP.set(0);
      me.n1LP.set(me.n1 = 0);
      me.n2LP.set(me.n2 = 0);
   },
   update: func(dt, trim = 0) {
      var starter = me.starterLP.filter(me.starterN.getValue() * 0.19);   # starter 15-20% N1max
      me.powerN.setValue(me.power = clamp(me.powerN.getValue()));
      var power = me.power * 0.97 + trim;               # 97% = N2% in flight position

      if (me.running)
         power += (1 - collective.getValue()) * 0.03;         # droop compensator
      if (power > 1.12)
         power = 1.12;                     # overspeed restrictor

      me.fuelflow = 0;
      if (!me.running) {
         if (me.n1 > 0.05 and power > 0.05 and me.ignitionN.getValue()) {
            me.runningN.setBoolValue(me.running = 1);
            me.timer.start();
         }

      } elsif (power < 0.05 or !fuel.level()) {
         me.runningN.setBoolValue(me.running = 0);
         me.timer.stop();

      } else {
         me.fuelflow = power;
      }

      var lastn1 = me.n1;
      me.n1 = me.n1LP.filter(max(me.fuelflow, starter));
      me.n2 = me.n2LP.filter(me.n1);
      me.up = me.n1 - lastn1;

      # temperature
      if (me.fuelflow > me.pos.idle)
         var target = 440 + (779 - 440) * (0.03 + me.fuelflow - me.pos.idle) / (me.pos.flight - me.pos.idle);
      else
         var target = 440 * (0.03 + me.fuelflow) / me.pos.idle;

      if (me.n1 < 0.4 and me.fuelflow - me.n1 > 0.001) {
         target += (me.fuelflow - me.n1) * 7000;
         if (target > 980)
            target = 980;
      }

      var airtemp = me.airtempN.getValue();
      if (target < airtemp)
         target = airtemp;

      var decay = (me.up > 0 ? 10 : me.n1 > 0.02 ? 0.01 : 0.001) * dt;
      me.totN.setValue((me.totN.getValue() + decay * target) / (1 + decay));

      # constant 150 kg/h for now (both turbines)
      fuel.consume(75 * KG2GAL * me.fuelflow * dt / 3600);

      # derived gauge values
      me.n1_pctN.setDoubleValue(me.n1 * 100);
      me.n2_pctN.setDoubleValue(me.n2 * 100);
      me.n1N.setDoubleValue(me.n1 * 50970);
      me.n2N.setDoubleValue(me.n2 * 33290);
   },
   setpower: func(v) {
      var target = (int((me.power + 0.15) * 3) + v) / 3;
      var time = abs(me.power - target) * 4;
      interpolate(me.powerN, target, time);
   },
   adjust_power: func(delta, mode = 0) {
      if (delta) {
         var power = me.powerN.getValue();
         if (me.power_min == nil) {
            if (delta > 0) {
               if (power < me.pos.idle) {
                  me.power_min = me.pos.cutoff;
                  me.power_max = me.pos.idle;
               } else {
                  me.power_min = me.pos.idle;
                  me.power_max = me.pos.flight;
               }
            } else {
               if (power > me.pos.idle) {
                  me.power_max = me.pos.flight;
                  me.power_min = me.pos.idle;
               } else {
                  me.power_max = me.pos.idle;
                  me.power_min = me.pos.cutoff;
               }
            }
         }
         me.powerN.setValue(power = clamp(power + delta, me.power_min, me.power_max));
         return power;
      } elsif (mode) {
         me.power_min = me.power_max = nil;
      }
   },
   pos: { cutoff: 0, idle: 0.63, flight: 1 },
};



var engines = {
   init: func {
      me.engine = [Engine.new(0), Engine.new(1)];
      me.trimN = props.globals.initNode("/controls/engines/power-trim");
      me.balanceN = props.globals.initNode("/controls/engines/power-balance");
      me.commonrpmN = props.globals.initNode("/engines/engine/rpm");
   },
   reset: func {
      me.engine[0].reset();
      me.engine[1].reset();
   },
   update: func(dt) {
      # each starter button disables ignition switch of opposite engine
      if (me.engine[0].starterN.getValue())
         me.engine[1].ignitionN.setBoolValue(0);
      if (me.engine[1].starterN.getValue())
         me.engine[0].ignitionN.setBoolValue(0);

      # update engines
      var trim = me.trimN.getValue() * 0.1;
      var balance = me.balanceN.getValue() * 0.1;
      me.engine[0].update(dt, trim - balance);
      me.engine[1].update(dt, trim + balance);

      # set rotor
      var n2relrpm = max(me.engine[0].n2, me.engine[1].n2);
      var n2max = (me.engine[0].n2 +  me.engine[1].n2) / 2;
      target_rel_rpm.setValue(n2relrpm);
      max_rel_torque.setValue(n2max);

      me.commonrpmN.setValue(n2max * 33290); # attitude indicator needs pressure

      # Warning Box Type K-DW02/01
      if (n2max > 0.67) { # 0.63?
         setprop("sim/sound/warn2600", n2max > 1.08);
         setprop("sim/sound/warn650", abs(me.engine[0].n2 - me.engine[1].n2) > 0.12
               or n2max > 0.75 and n2max < 0.95);
      } else {
         setprop("sim/sound/warn2600", 0);
         setprop("sim/sound/warn650", 0);
      }
   },
   adjust_power: func(delta, mode = 0) {
      if (!delta) {
         engines.engine[0].adjust_power(0, mode);
         engines.engine[1].adjust_power(0, mode);
      } else {
         var p = [0, 0];
         for (var i = 0; i < 2; i += 1)
            if (controls.engines[i].selected.getValue())
               p[i] = engines.engine[i].adjust_power(delta);
         gui.popupTip(sprintf("power lever %d%%", 100 * max(p[0], p[1])));
      }
   },
   quickstart: func { # development only
      me.engine[0].n1LP.set(1);
      me.engine[0].n2LP.set(1);
      me.engine[1].n1LP.set(1);
      me.engine[1].n2LP.set(1);
      procedure.step = 1;
      procedure.next();
   },
};



var vert_speed_fpm = props.globals.initNode("/velocities/vertical-speed-fpm");

if (devel) {
   setprop("/instrumentation/altimeter/setting-inhg", getprop("/environment/pressure-inhg"));

   setlistener("/sim/signals/fdm-initialized", func {
      settimer(func {
         screen.property_display.x = 760;
         screen.property_display.y = 200;
         screen.property_display.format = "%.3g";
         screen.property_display.add(
            rotor_rpm,
            torque_pct,
            target_rel_rpm,
            max_rel_torque,
            "/controls/engines/power-trim",
            "/controls/engines/power-balance",
            "/consumables/fuel/total-fuel-gals",
            "L",
            engines.engine[0].runningN,
            engines.engine[0].ignitionN,
            "/controls/engines/engine[0]/power",
            engines.engine[0].n1_pctN,
            engines.engine[0].n2_pctN,
            engines.engine[0].totN,
            #engines.engine[0].n1N,
            #engines.engine[0].n2N,
            "R",
            engines.engine[1].runningN,
            engines.engine[1].ignitionN,
            "/controls/engines/engine[1]/power",
            engines.engine[1].n1_pctN,
            engines.engine[1].n2_pctN,
            engines.engine[1].totN,
            #engines.engine[1].n1N,
            #engines.engine[1].n2N,
            "X",
            "/sim/model/gross-weight-kg",
            "/position/altitude-ft",
            "/position/altitude-agl-ft",
            "/instrumentation/altimeter/indicated-altitude-ft",
            "/environment/temperature-degc",
            vert_speed_fpm,
            "/velocities/airspeed-kt",
         );
      }, 1);
   });
}



var mouse = {
   init: func {
      me.x = me.y = nil;
      me.savex = nil;
      me.savey = nil;
      setlistener("/sim/startup/xsize", func(n) me.centerx = int(n.getValue() / 2), 1);
      setlistener("/sim/startup/ysize", func(n) me.centery = int(n.getValue() / 2), 1);
      setlistener("/devices/status/mice/mouse/mode", func(n) me.mode = n.getValue(), 1);
      setlistener("/devices/status/mice/mouse/button[1]", func(n) {
         me.mmb = n.getValue();
         if (me.mode)
            return;
         if (me.mmb) {
            engines.adjust_power(0, 1);
            me.savex = me.x;
            me.savey = me.y;
            gui.setCursor(me.centerx, me.centery, "none");
         } else {
            gui.setCursor(me.savex, me.savey, "pointer");
         }
      }, 1);
      setlistener("/devices/status/mice/mouse/x", func(n) me.x = n.getValue(), 1);
      setlistener("/devices/status/mice/mouse/y", func(n) me.update(me.y = n.getValue()), 1);
   },
   update: func {
      if (me.mode or !me.mmb)
         return;

      if (var dy = -me.y + me.centery)
         engines.adjust_power(dy * 0.005);

      gui.setCursor(me.centerx, me.centery);
   },
};



var power = func(v) {
   if (controls.engines[0].selected.getValue())
      engines.engine[0].setpower(v);
   if (controls.engines[1].selected.getValue())
      engines.engine[1].setpower(v);
}



var startup = func {
   if (procedure.stage < 0) {
      procedure.step = 1;
      procedure.next();
   }
}


var shutdown = func {
   if (procedure.stage > 0) {
      procedure.step = -1;
      procedure.next();
   }
}


var procedure = {
   stage: -999,
   step: nil,
   loopid: 0,
   reset: func {
      me.loopid += 1;
      me.stage = -999;
      step = nil;
      engines.reset();
   },
   next: func(delay = 0) {
      if (crashed)
         return;
      if (me.stage < 0 and me.step > 0 or me.stage > 0 and me.step < 0)
         me.stage = 0;

      settimer(func { me.stage += me.step; me.process(me.loopid) }, delay * !quickstart);
   },
   process: func(id) {
      id == me.loopid or return;
      # startup
      if (me.stage == 1) {
         cprint("", "1: press start button #1 -> spool up turbine #1 to N1 8.6--15%");
         setprop("/controls/rotor/brake", 0);
         engines.engine[0].ignitionN.setValue(1);
         engines.engine[0].starterN.setValue(1);
         me.next(4);

      } elsif (me.stage == 2) {
         cprint("", "2: move power lever #1 forward -> fuel injection");
         engines.engine[0].powerN.setValue(0.13);
         me.next(2.5);

      } elsif (me.stage == 3) {
         cprint("", "3: turbine #1 ignition (wait for EGT stabilization)");
         me.next(4.5);

      } elsif (me.stage == 4) {
         cprint("", "4: move power lever #1 to idle position -> engine #1 spools up to N1 63%");
         engines.engine[0].powerN.setValue(0.63);
         me.next(5);

      } elsif (me.stage == 5) {
         cprint("", "5: release start button #1\n");
         engines.engine[0].starterN.setValue(0);
         engines.engine[0].ignitionN.setValue(0);
         me.next(3);

      } elsif (me.stage == 6) {
         cprint("", "6: press start button #2 -> spool up turbine #2 to N1 8.6--15%");
         engines.engine[1].ignitionN.setValue(1);
         engines.engine[1].starterN.setValue(1);
         me.next(5);

      } elsif (me.stage == 7) {
         cprint("", "7: move power lever #2 forward -> fuel injection");
         engines.engine[1].powerN.setValue(0.13);
         me.next(2);

      } elsif (me.stage == 8) {
         cprint("", "8: turbine #2 ignition (wait for EGT stabilization)");
         me.next(5);

      } elsif (me.stage == 9) {
         cprint("", "9: move power lever #2 to idle position -> engine #2 spools up to N1 63%");
         engines.engine[1].powerN.setValue(0.63);
         me.next(8);

      } elsif (me.stage == 10) {
         cprint("", "10: release start button #2\n");
         engines.engine[1].starterN.setValue(0);
         engines.engine[1].ignitionN.setValue(0);
         me.next(1);

      } elsif (me.stage == 11) {
         cprint("", "11: move both power levers forward -> turbines spool up to 100%");
         engines.engine[0].powerN.setValue(1);
         engines.engine[1].powerN.setValue(1);

      # shutdown
      } elsif (me.stage == -1) {
         cprint("", "-1: power lever in idle position; cool engines");
         engines.engine[0].starterN.setValue(0);
         engines.engine[1].starterN.setValue(0);
         engines.engine[0].ignitionN.setValue(0);
         engines.engine[1].ignitionN.setValue(0);
         engines.engine[0].powerN.setValue(0.63);
         engines.engine[1].powerN.setValue(0.63);
         me.next(40);

      } elsif (me.stage == -2) {
         cprint("", "-2: engines shut down");
         engines.engine[0].powerN.setValue(0);
         engines.engine[1].powerN.setValue(0);
         me.next(40);

      } elsif (me.stage == -3) {
         cprint("", "-3: rotor brake\n");
         setprop("/controls/rotor/brake", 1);
      }
   },
};



# torquemeter
var torque_val = 0;
torque.setDoubleValue(0);

var update_torque = func(dt) {
   var f = dt / (0.2 + dt);
   torque_val = torque.getValue() * f + torque_val * (1 - f);
   torque_pct.setDoubleValue(torque_val / 5300);
}



# blade vibration absorber pendulum
var pendulum = props.globals.getNode("/sim/model/westland_lynx-ah7/absorber-angle-deg", 1);
var update_absorber = func {
   pendulum.setDoubleValue(90 * clamp(abs(rotor_rpm.getValue()) / 90));
}



var vibration = { # and noise ...
   init: func {
      me.lonN = props.globals.initNode("/rotors/main/vibration/longitudinal");
      me.latN = props.globals.initNode("/rotors/main/vibration/lateral");
      me.soundN = props.globals.initNode("/sim/sound/vibration");
      me.airspeedN = props.globals.getNode("/velocities/airspeed-kt");
      me.vertspeedN = props.globals.getNode("/velocities/vertical-speed-fps");

      me.groundspeedN = props.globals.getNode("/velocities/groundspeed-kt");
      me.speeddownN = props.globals.getNode("/velocities/speed-down-fps");
      me.angleN = props.globals.initNode("/velocities/descent-angle-deg");
      me.dir = 0;
   },
   update: func(dt) {
      var airspeed = me.airspeedN.getValue();
      if (airspeed > 161) { # overspeed vibration
         var frequency = 2000 + 500 * rand();
         var v = 0.49 + 0.5 * normatan(airspeed - 161, 10);
         var intensity = v;
         var noise = v * internal;

      } elsif (airspeed > 30) { # Blade Vortex Interaction (BVI)    8 deg, 65 kts max?
         var frequency = rotor_rpm.getValue() * 4 * 60;
         var down = me.speeddownN.getValue() * FT2M;
         var level = me.groundspeedN.getValue() * NM2M / 3600;
         me.angleN.setDoubleValue(var angle = math.atan2(down, level) * R2D);
         var speed = math.sqrt(level * level + down * down) * MPS2KT;
         angle = bell(angle - 9, 13);
         speed = bell(speed - 65, 450);
         var v = angle * speed;
         var intensity = v * 0.10;
         var noise = v * (1 - internal * 0.4);

      } else { # hover
         var rpm = rotor_rpm.getValue();
         var frequency = rpm * 4 * 60;
         var coll = bell(collective.getValue(), 0.5);
         var ias = bell(airspeed, 600);
         var vert = bell(me.vertspeedN.getValue() * 0.5, 400);
         var rpm = 0.477 + 0.5 * normatan(rpm - 350, 30) * 1.025;
         var v = coll * ias * vert * rpm;
         var intensity = v * 0.10;
         var noise = v * (1 - internal * 0.4);
      }

      me.dir += dt * frequency;
      me.lonN.setValue(cos(me.dir) * intensity);
      me.latN.setValue(sin(me.dir) * intensity);
      me.soundN.setValue(noise);
   },
};




# sound =============================================================

# stall sound
var stall = props.globals.getNode("rotors/main/stall", 1);
var stall_filtered = props.globals.getNode("rotors/main/stall-filtered", 1);

var stall_val = 0;
stall.setDoubleValue(0);

var update_stall = func(dt) {
   var s = stall.getValue();
   if (s < stall_val) {
      var f = dt / (0.3 + dt);
      stall_val = s * f + stall_val * (1 - f);
   } else {
      stall_val = s;
   }
   var c = collective.getValue();
   stall_filtered.setDoubleValue(stall_val + 0.006 * (1 - c));
}



# skid slide sound
var Skid = {
   new: func(n) {
      var m = { parents: [Skid] };
      var soundN = props.globals.getNode("sim/model/westland_lynx-ah7/sound", 1).getChild("slide", n, 1);
      var gearN = props.globals.getNode("gear", 1).getChild("gear", n, 1);

      m.compressionN = gearN.getNode("compression-norm", 1);
      m.rollspeedN = gearN.getNode("rollspeed-ms", 1);
      m.frictionN = gearN.getNode("ground-friction-factor", 1);
      m.wowN = gearN.getNode("wow", 1);
      m.volumeN = soundN.getNode("volume", 1);
      m.pitchN = soundN.getNode("pitch", 1);

      m.compressionN.setDoubleValue(0);
      m.rollspeedN.setDoubleValue(0);
      m.frictionN.setDoubleValue(0);
      m.volumeN.setDoubleValue(0);
      m.pitchN.setDoubleValue(0);
      m.wowN.setBoolValue(1);
      m.self = n;
      return m;
   },
   update: func {
      me.wow = me.wowN.getValue();
      if (me.wow < 0.5)
         return me.volumeN.setDoubleValue(0);

      var rollspeed = abs(me.rollspeedN.getValue());
      me.pitchN.setDoubleValue(rollspeed * 0.6);

      var s = normatan(20 * rollspeed);
      var f = clamp((me.frictionN.getValue() - 0.5) * 2);
      var c = clamp(me.compressionN.getValue() * 2);
      var vol = s * f * c;
      me.volumeN.setDoubleValue(vol > 0.1 ? vol : 0);
      
   },
};

var skids = [];
for (var i = 0; i < 4; i += 1)
   append(skids, Skid.new(i));


var update_slide = func {
   foreach (var s; skids)
      s.update();
}


var internal = 1;
setlistener("sim/current-view/view-number", func {
   internal = getprop("sim/current-view/internal");
}, 1);


var volume = props.globals.getNode("sim/model/westland_lynx-ah7/sound/volume", 1);
var update_volume = func {
   var door_open = 0;
   foreach (var d; doors.list) {
      if (!d.enabledN.getValue() or d.positionN.getValue() > 0.001) {
         door_open = 1;
         break;
      }
   }
   volume.setDoubleValue(1 - (0.8 - 0.6 * door_open) * internal);
}



# crash handler =====================================================
var crash = func {
   if (arg[0]) {
      # crash
      setprop("sim/model/westland_lynx-ah7/tail-angle-deg", 35);
      setprop("sim/model/westland_lynx-ah7/shadow", 0);
      setprop("sim/model/westland_lynx-ah7/doors/door[0]/position-norm", 0.2);
      setprop("sim/model/westland_lynx-ah7/doors/door[1]/position-norm", 0.9);
      setprop("sim/model/westland_lynx-ah7/doors/door[2]/position-norm", 0.2);
      setprop("sim/model/westland_lynx-ah7/doors/door[3]/position-norm", 0.6);
      setprop("sim/model/westland_lynx-ah7/doors/door[4]/position-norm", 0.1);
      setprop("sim/model/westland_lynx-ah7/doors/door[5]/position-norm", 0.05);
      setprop("rotors/main/rpm", 0);
      setprop("rotors/main/blade[0]/flap-deg", -60);
      setprop("rotors/main/blade[1]/flap-deg", -50);
      setprop("rotors/main/blade[2]/flap-deg", -40);
      setprop("rotors/main/blade[3]/flap-deg", -30);
      setprop("rotors/main/blade[0]/incidence-deg", -30);
      setprop("rotors/main/blade[1]/incidence-deg", -20);
      setprop("rotors/main/blade[2]/incidence-deg", -50);
      setprop("rotors/main/blade[3]/incidence-deg", -55);
      setprop("rotors/tail/rpm", 0);
      strobe_switch.setValue(0);
      beacon_switch.setValue(0);
      nav_light_switch.setValue(0);
      engines.engine[0].n2_pctN.setValue(0);
      engines.engine[1].n2_pctN.setValue(0);
      torque_pct.setValue(torque_val = 0);
      stall_filtered.setValue(stall_val = 0);

   } else {
      # uncrash (for replay)
      setprop("sim/model/westland_lynx-ah7/tail-angle-deg", 0);
      setprop("sim/model/westland_lynx-ah7/shadow", 1);
      doors.reset();
      setprop("rotors/tail/rpm", 2219);
      setprop("rotors/main/rpm", 442);
      for (i = 0; i < 4; i += 1) {
         setprop("rotors/main/blade[" ~ i ~ "]/flap-deg", 0);
         setprop("rotors/main/blade[" ~ i ~ "]/incidence-deg", 0);
      }
      strobe_switch.setValue(1);
      beacon_switch.setValue(1);
      engines.engine[0].n2_pct.setValue(100);
      engines.engine[1].n2_pct.setValue(100);
   }
}




# "manual" rotor animation for flight data recorder replay ============
var rotor_step = props.globals.getNode("sim/model/westland_lynx-ah7/rotor-step-deg");
var blade1_pos = props.globals.getNode("rotors/main/blade[0]/position-deg", 1);
var blade2_pos = props.globals.getNode("rotors/main/blade[1]/position-deg", 1);
var blade3_pos = props.globals.getNode("rotors/main/blade[2]/position-deg", 1);
var blade4_pos = props.globals.getNode("rotors/main/blade[3]/position-deg", 1);
var rotorangle = 0;

var rotoranim_loop = func {
   var i = rotor_step.getValue();
   if (i >= 0.0) {
      blade1_pos.setValue(rotorangle);
      blade2_pos.setValue(rotorangle + 90);
      blade3_pos.setValue(rotorangle + 180);
      blade4_pos.setValue(rotorangle + 270);
      rotorangle += i;
      settimer(rotoranim_loop, 0.1);
   }
}

var init_rotoranim = func {
   if (rotor_step.getValue() >= 0.0)
      settimer(rotoranim_loop, 0.1);
}






# view management ===================================================

var elapsedN = props.globals.getNode("/sim/time/elapsed-sec", 1);
var flap_mode = 0;
var down_time = 0;
controls.flapsDown = func(v) {
   if (!flap_mode) {
      if (v < 0) {
         down_time = elapsedN.getValue();
         flap_mode = 1;
         dynamic_view.lookat(
               5,     # heading left
               -20,   # pitch up
               0,     # roll right
               0.2,   # right
               0.6,   # up
               0.85,  # back
               0.2,   # time
               55,    # field of view
         );
      } elsif (v > 0) {
         flap_mode = 2;
         gui.popupTip("AUTOTRIM", 1e10);
         aircraft.autotrim.start();
      }

   } else {
      if (flap_mode == 1) {
         if (elapsedN.getValue() < down_time + 0.2)
            return;

         dynamic_view.resume();
      } elsif (flap_mode == 2) {
         aircraft.autotrim.stop();
         gui.popdown();
      }
      flap_mode = 0;
   }
}


# register function that may set me.heading_offset, me.pitch_offset, me.roll_offset,
# me.x_offset, me.y_offset, me.z_offset, and me.fov_offset
#
dynamic_view.register(func {
   var lowspeed = 1 - normatan(me.speedN.getValue() / 50);
   var r = sin(me.roll) * cos(me.pitch);

   me.heading_offset =                  # heading change due to
      (me.roll < 0 ? -50 : -30) * r * abs(r);         #    roll left/right

   me.pitch_offset =                  # pitch change due to
      (me.pitch < 0 ? -50 : -50) * sin(me.pitch) * lowspeed   #    pitch down/up
      + 15 * sin(me.roll) * sin(me.roll);         #    roll

   me.roll_offset =                  # roll change due to
      -15 * r * lowspeed;               #    roll
});


var adjust_fov = func {
   var w = getprop("/sim/startup/xsize");
   var h = getprop("/sim/startup/ysize");
   var ar = clamp(max(w, h) / min(w, h), 0, 2);
   var fov = 60 + (ar - (4 / 3)) * 10 / (16 / 9 - 4 / 3);
   setprop("/sim/view/config/default-field-of-view-deg", fov);
   if (internal)
      setprop("/sim/current-view/config/default-field-of-view-deg", fov);
}

setlistener("/sim/startup/xsize", adjust_fov);
setlistener("/sim/startup/ysize", adjust_fov, 1);







# main() ============================================================
var delta_time = props.globals.getNode("/sim/time/delta-sec", 1);
var hi_heading = props.globals.getNode("/instrumentation/heading-indicator/indicated-heading-deg", 1);
var vertspeed = props.globals.initNode("/velocities/vertical-speed-fps");
var gross_weight_lb = props.globals.initNode("/yasim/gross-weight-lbs");
var gross_weight_kg = props.globals.initNode("/sim/model/gross-weight-kg");
props.globals.getNode("/instrumentation/adf/rotation-deg", 1).alias(hi_heading);


var main_loop = func {
   props.globals.removeChild("autopilot");
   if (replay)
      setprop("/position/gear-agl-m", getprop("/position/altitude-agl-ft") * 0.3 - 1.2);
   vert_speed_fpm.setDoubleValue(vertspeed.getValue() * 60);
   #gross_weight_kg.setDoubleValue(gross_weight_lb.getValue() * LB2KG);


   var dt = delta_time.getValue();
   update_torque(dt);
   update_stall(dt);
   update_slide();
   update_volume();
   update_absorber();
   fuel.update(dt);
   engines.update(dt);
   vibration.update(dt);
   settimer(main_loop, 0);
}


var replay = 0;
var crashed = 0;

var doors = Doors.new();


var first_init = 1;

setlistener("/sim/signals/fdm-initialized", func {
   if (!first_init) return;
   first_init = 0;

   gui.menuEnable("autopilot", 1);
   init_rotoranim();
   vibration.init();
   engines.init();
   fuel.init();
   mouse.init();

   

   collective.setDoubleValue(1);

   setlistener("/sim/signals/reinit", func(n) {
      n.getBoolValue() and return;
      cprint("32;1", "reinit");
      procedure.reset();
      collective.setDoubleValue(1);
      #aircraft.livery.rescan();
      reconfigure();
      if (crashed)
         crash(crashed = 0);
   });

   setlistener("sim/crashed", func(n) {
      cprint("31;1", "crashed ", n.getValue());
      engines.engine[0].timer.stop();
      engines.engine[1].timer.stop();
      if (n.getBoolValue())
         crash(crashed = 1);
   });

   setlistener("/sim/freeze/replay-state", func(n) {
      replay = n.getValue();
      cprint("33;1", replay ? "replay" : "pause");
      if (crashed)
         crash(!n.getBoolValue())
   });

   main_loop();
   if (devel and quickstart)
      engines.quickstart();
});



wiper.nas file

Code: Select all

var wiper = func{
  var pos = getprop( "controls/wiper/pos" ) or 0;
  var ws = getprop( "controls/wiper/speed" );
  var side = getprop( "controls/wiper/side" );

  if( ws == 1 ){
    if( side >= 0 ) interpolate( "/controls/wiper/poscp", 90, 1, 0, 1 );
    if( side <= 0 ) interpolate( "/controls/wiper/posp",  90, 1, 0, 1 );
    settimer( wiper, 8.0 );
  }else if( ws == 2 ){
    if( side >= 0 ) interpolate( "/controls/wiper/poscp", 90, 1, 0, 1 );
    if( side <= 0 ) interpolate( "/controls/wiper/posp",  90, 1, 0, 1 );
    settimer( wiper, 2.5 );
  }else if( ws == 3 ){
    if( side >= 0 ) interpolate( "/controls/wiper/poscp", 90, 0.5, 0, 0.5 );
    if( side <= 0 ) interpolate( "/controls/wiper/posp",  90, 0.5, 0, 0.5 );
    settimer( wiper, 1.6 );
#  }else if( ws == -1 ){
 #   if( side >= 0 ) interpolate( "/controls/wiper/poscp", 90, 1 );
 #   if( side <= 0 ) interpolate( "/controls/wiper/posp",  90, 1 );
  #  settimer( wiper, 1 );
  }else{
    interpolate( "/controls/wiper/poscp", 0, 1 );
    interpolate( "/controls/wiper/psop",  0, 1 );
  }
} #wiper()


setlistener( "controls/wiper/speed", func{ bo105.wiper(); } );

"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Tue Jun 25, 2019 9:06 pm

The folder Sounds include

Image


mp-sound.xml file

Code: Select all

<?xml version="1.0"?>
<!--
   thanks to the SAR simulation (GPL) for the helicopter sounds,
   and the Urban game (LGPL) for the weapon sounds

   +x = aft
   +y = left
   +z = up
-->

<PropertyList>
   <fx>
      <!-- Starting Engines -->

      <starter>
         <name>starter0_start</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/startup_exterior.wav</path>
         <condition>
            <property>controls/engines/engine/master-bat</property>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter0_start_interior</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/startup_interior.wav</path>
         <property>sim/current-view/internal</property>
         <condition>
            <property>controls/engines/engine/master-bat</property>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter0_loop</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_loop.wav</path>
         <condition>
            <property>controls/engines/engine[0]/starter</property>
         </condition>
         <delay-sec>11.6</delay-sec>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter0_stop</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_stop.wav</path>
         <condition>
            <not>
               <property>controls/engines/engine[0]/starter</property>
            </not>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter1_start</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_start.wav</path>
         <condition>
            <property>controls/engines/engine[1]/starter</property>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>-0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter1_loop</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_loop.wav</path>
         <condition>
            <property>controls/engines/engine[1]/starter</property>
         </condition>
         <delay-sec>11.6</delay-sec>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>-0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter1_stop</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_stop.wav</path>
         <condition>
            <not>
               <property>controls/engines/engine[1]/starter</property>
            </not>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>-0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <engine>
         <name>turbine0-start</name>
         <mode>once</mode>
         <path>Sounds/turbine_start.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>turbine0-loop</name>
         <mode>looped</mode>
         <path>Sounds/turbine_loop.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <delay-sec>7.5</delay-sec>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>turbine0-shutdown</name>
         <mode>once</mode>
         <path>Sounds/turbine_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[0]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>turbine1-start</name>
         <mode>once</mode>
         <path>Sounds/turbine_start.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>turbine1-loop</name>
         <mode>looped</mode>
         <path>Sounds/turbine_loop.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <delay-sec>7.5</delay-sec>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>turbine1-shutdown</name>
         <mode>once</mode>
         <path>Sounds/turbine_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[1]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>exhaust0-start</name>
         <mode>once</mode>
         <path>Sounds/exhaust_start.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>exhaust0-loop</name>
         <mode>looped</mode>
         <path>Sounds/exhaust_loop.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <delay-sec>11.5</delay-sec>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>exhaust0-shutdown</name>
         <mode>once</mode>
         <path>Sounds/exhaust_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[0]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>exhaust1-start</name>
         <mode>once</mode>
         <path>Sounds/exhaust_start.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>exhaust1-loop</name>
         <mode>looped</mode>
         <path>Sounds/exhaust_loop.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <delay-sec>11.5</delay-sec>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <engine>
         <name>exhaust1-shutdown</name>
         <mode>once</mode>
         <path>Sounds/exhaust_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[1]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>1000</max-dist>
      </engine>

      <rotor>
         <name>rotor-outside</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/lynx_rotor_highspeed.wav</path>
         <condition>
            <and>
               <not>
                  <property>sim/current-view/internal</property>
               </not>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <property>rotors/main/rpm</property>
            <factor>0.008</factor>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0.33</offset>
            <min>0</min>
            <max>1.5</max>
         </pitch>
         <reference-dist>5</reference-dist>
         <max-dist>2000</max-dist>
      </rotor>

      

      <rotor>
         <name>stall</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/rotor_stall.wav</path>
         <condition>
            <and>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>0.8</factor>
         </volume>
         <volume>
            <property>rotors/main/stall-filtered</property>
            <factor>75</factor>
            <max>1.0</max>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0</offset>
            <max>1.75</max>
         </pitch>
         <reference-dist>1000</reference-dist>
         <max-dist>3000</max-dist>
      </rotor>

      <rotor>
         <name>blade-vortex-interaction</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/blade_vortex.wav</path>
         <condition>
            <greater-than>
               <property>sim/sound/vibration</property>
               <value>0.01</value>
            </greater-than>
         </condition>
         <volume>
            <property>sim/sound/vibration</property>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0</offset>
            <min>0</min>
            <max>1.5</max>
         </pitch>
         <reference-dist>1000</reference-dist>
         <max-dist>5000</max-dist>
      </rotor>

      
   </fx>
</PropertyList>




sound.xml file

Code: Select all

<?xml version="1.0"?>
<!--
   thanks to the SAR simulation (GPL) for the helicopter sounds,
   and the Urban game (LGPL) for the weapon sounds

   +x = aft
   +y = left
   +z = up
-->

<PropertyList>
   <fx>
      <!-- Starting Engines -->

      <starter>
         <name>starter0_start</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/startup_exterior.wav</path>
         <property>sim/current-view/external</property>
         <condition>
            <property>controls/engines/engine[0]/starter</property>
         </condition>
         <volume>
            <factor>0.9</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>50</max-dist>
      </starter>

      <starter>
         <name>starter0_start_interior</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/startup_interior.wav</path>
         <property>sim/current-view/internal</property>
         <condition>
            <property>controls/engines/engine[0]/starter</property>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>







      <starter>
         <name>starter0_loop</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_loop.wav</path>
         <condition>
            <property>controls/engines/engine[0]/starter</property>
         </condition>
         <delay-sec>11.6</delay-sec>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter0_stop</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_stop.wav</path>
         <condition>
            <not>
               <property>controls/engines/engine[0]/starter</property>
            </not>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>
      
      <starter>
         <name>starter1_start</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/startup_exterior.wav</path>
         <property>sim/current-view/external</property>
         <condition>
            <property>controls/engines/engine[1]/starter</property>
         </condition>
         <volume>
            <factor>0.9</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>50</max-dist>
      </starter>

      <starter>
         <name>starter1_start_interior</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/startup_interior.wav</path>
         <condition>
            <property>controls/engines/engine[1]/starter</property>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>-0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter1_loop</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_loop.wav</path>
         <condition>
            <property>controls/engines/engine[1]/starter</property>
         </condition>
         <delay-sec>11.6</delay-sec>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>-0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <starter>
         <name>starter1_stop</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/starter_stop.wav</path>
         <condition>
            <not>
               <property>controls/engines/engine[1]/starter</property>
            </not>
         </condition>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.88</x>
            <y>-0.40</y>
            <z>0.5</z>
         </position>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </starter>

      <engine>
         <name>turbine0-start</name>
         <mode>once</mode>
         <path>Sounds/turbine_start.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>turbine0-loop</name>
         <mode>looped</mode>
         <path>Sounds/turbine_loop.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <delay-sec>7.5</delay-sec>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>turbine0-shutdown</name>
         <mode>once</mode>
         <path>Sounds/turbine_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[0]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>turbine1-start</name>
         <mode>once</mode>
         <path>Sounds/turbine_start.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>turbine1-loop</name>
         <mode>looped</mode>
         <path>Sounds/turbine_loop.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <delay-sec>7.5</delay-sec>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>turbine1-shutdown</name>
         <mode>once</mode>
         <path>Sounds/turbine_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[1]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.03</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>5</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>exhaust0-start</name>
         <mode>once</mode>
         <path>Sounds/exhaust_start.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>exhaust0-loop</name>
         <mode>looped</mode>
         <path>Sounds/exhaust_loop.wav</path>
         <condition>
            <property>engines/engine[0]/running</property>
         </condition>
         <delay-sec>11.5</delay-sec>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>exhaust0-shutdown</name>
         <mode>once</mode>
         <path>Sounds/exhaust_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[0]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>exhaust1-start</name>
         <mode>once</mode>
         <path>Sounds/exhaust_start.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>exhaust1-loop</name>
         <mode>looped</mode>
         <path>Sounds/exhaust_loop.wav</path>
         <condition>
            <property>engines/engine[1]/running</property>
         </condition>
         <delay-sec>11.5</delay-sec>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <engine>
         <name>exhaust1-shutdown</name>
         <mode>once</mode>
         <path>Sounds/exhaust_shutdown.wav</path>
         <condition>
            <not>
               <property>engines/engine[1]/running</property>
            </not>
         </condition>
         <volume>
            <factor>0.02</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>10</factor>
         </volume>
         <reference-dist>50</reference-dist>
         <max-dist>200</max-dist>
      </engine>

      <rotor>
         <name>rotor-outside</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/lynx_rotor_highspeed.wav</path>
         <condition>
            <and>
               <not>
                  <property>sim/current-view/internal</property>
               </not>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <property>rotors/main/rpm</property>
            <factor>0.008</factor>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0.33</offset>
            <min>0</min>
            <max>1.5</max>
         </pitch>
         <reference-dist>5</reference-dist>
         <max-dist>2000</max-dist>
      </rotor>

      <rotor>
         <name>rotor-inside</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/lynx_rotor_highspeed_inside.wav</path>
         <condition>
            <and>
               <property>sim/current-view/internal</property>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <factor>0.5</factor>
         </volume>
         <volume>
            <property>rotors/main/rpm</property>
            <factor>0.008</factor>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0.33</offset>
            <min>0</min>
            <max>1.5</max>
         </pitch>
         <reference-dist>100</reference-dist>
         <max-dist>1000</max-dist>
      </rotor>

      <rotor>
         <name>stall</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/rotor_stall.wav</path>
         <condition>
            <and>
               <not>
                  <property>sim/current-view/internal</property>
               </not>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <!--volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>0.8</factor>
         </volume-->
         <volume>
            <property>rotors/main/stall-filtered</property>
            <factor>75</factor>
            <max>0.6</max>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0</offset>
            <max>1.75</max>
         </pitch>
         <reference-dist>1000</reference-dist>
         <max-dist>3000</max-dist>
      </rotor>

      <rotor>
         <name>stall-interior</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/rotor_stall_inside.wav</path>
         <condition>
            <and>
               <property>sim/current-view/internal</property>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <!--volume>
            <property>sim/model/Westland_Lynx-AH7/sound/volume</property>
            <factor>0.8</factor>
         </volume-->
         <volume>
            <property>rotors/main/stall-filtered</property>
            <factor>85</factor>
            <max>0.85</max>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0</offset>
            <max>1.75</max>
         </pitch>
         <reference-dist>1000</reference-dist>
         <max-dist>3000</max-dist>
      </rotor>


      <rotor>
         <name>blade-vortex-interaction</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/blade_vortex.wav</path>
         <condition>
            <greater-than>
               <property>sim/sound/vibration</property>
               <value>0.01</value>
            </greater-than>
         </condition>
         <volume>
            <property>sim/sound/vibration</property>
         </volume>
         <pitch>
            <property>rotors/main/rpm</property>
            <factor>0.002262</factor>
            <offset>0</offset>
            <min>0</min>
            <max>1.5</max>
         </pitch>
         <reference-dist>1000</reference-dist>
         <max-dist>3000</max-dist>
      </rotor>
      
      <overspeed>
         <name>overspeed</name>
         <mode>looped</mode>
         <path>Sounds/overspeed.wav</path>
         <condition>
            <greater-than>
               <property>velocities/airspeed-kt</property>
               <value>142</value>
            </greater-than>
            <equals>
               <property>sim/current-view/view-number</property>
               <value>0</value>
            </equals>
         </condition>
         <volume>
            <factor>1.0</factor>
         </volume>
         <pitch>
            <factor>0.1</factor>
         </pitch>
         <reference-dist>1.0</reference-dist>
         <max-dist>2.0</max-dist>
      </overspeed>

      <warning>
         <name>650 Hz</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/warn650.wav</path>
         <condition>
            <property>sim/sound/warn650</property>
         </condition>
         <reference-dist>0.5</reference-dist>
         <max-dist>1.0</max-dist>
      </warning>

      <warning>
         <name>2600 Hz</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/warn2600.wav</path>
         <condition>
            <property>sim/sound/warn2600</property>
         </condition>
         <reference-dist>0.5</reference-dist>
         <max-dist>1.0</max-dist>
      </warning>

      <contact>
         <name>ground contact</name>
         <mode>once</mode>
         <path>Sounds/helicopter-skid.wav</path>
         <condition>
            <property>gear/gear[0]/wow</property>
         </condition>
         <volume>
            <factor>0.8</factor>
         </volume>
         <pitch>
            <factor>0.01</factor>
         </pitch>
         <reference-dist>5.0</reference-dist>
         <max-dist>10.0</max-dist>
      </contact>

      <contact>
         <name>ground contact</name>
         <mode>once</mode>
         <path>Sounds/helicopter-skid.wav</path>
         <condition>
            <property>gear/gear[1]/wow</property>
         </condition>
         <volume>
            <factor>0.8</factor>
         </volume>
         <pitch>
            <factor>0.01</factor>
         </pitch>
         <reference-dist>5.0</reference-dist>
         <max-dist>10.0</max-dist>
      </contact>

      <contact>
         <name>ground contact</name>
         <mode>once</mode>
         <path>Sounds/helicopter-skid.wav</path>
         <condition>
            <property>gear/gear[2]/wow</property>
         </condition>
         <volume>
            <factor>0.8</factor>
         </volume>
         <pitch>
            <factor>0.01</factor>
         </pitch>
         <reference-dist>5.0</reference-dist>
         <max-dist>10.0</max-dist>
      </contact>

      <contact>
         <name>ground contact</name>
         <mode>once</mode>
         <path>Sounds/helicopter-skid.wav</path>
         <condition>
            <property>gear/gear[3]/wow</property>
         </condition>
         <volume>
            <factor>0.8</factor>
         </volume>
         <pitch>
            <factor>0.01</factor>
         </pitch>
         <reference-dist>5.0</reference-dist>
         <max-dist>10.0</max-dist>
      </contact>

      <contact>
         <name>ground contact</name>
         <mode>once</mode>
         <path>Sounds/helicopter-skid.wav</path>
         <condition>
            <property>gear/gear[4]/wow</property>
         </condition>
         <volume>
            <factor>0.8</factor>
         </volume>
         <pitch>
            <factor>0.01</factor>
         </pitch>
         <reference-dist>5.0</reference-dist>
         <max-dist>10.0</max-dist>
      </contact>

      <slide>
         <name>skid sliding1</name>
         <mode>looped</mode>
         <path>Sounds/rumble.wav</path>
         <condition>
            <and>
               <property>gear/gear[0]/wow</property>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <factor>0.5</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[0]/volume</property>
            <max>1</max>
         </volume>
         <pitch>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[0]/pitch</property>
         </pitch>
      </slide>

      <slide>
         <name>skid sliding2</name>
         <mode>looped</mode>
         <path>Sounds/rumble.wav</path>
         <condition>
            <and>
               <property>gear/gear[1]/wow</property>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <factor>0.5</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[1]/volume</property>
            <max>1</max>
         </volume>
         <pitch>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[1]/pitch</property>
         </pitch>
      </slide>

      <slide>
         <name>skid sliding3</name>
         <mode>looped</mode>
         <path>Sounds/rumble.wav</path>
         <condition>
            <and>
               <property>gear/gear[2]/wow</property>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <factor>0.5</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[2]/volume</property>
            <max>1</max>
         </volume>
         <pitch>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[2]/pitch</property>
         </pitch>
      </slide>

      <slide>
         <name>skid sliding4</name>
         <mode>looped</mode>
         <path>Sounds/rumble.wav</path>
         <condition>
            <and>
               <property>gear/gear[3]/wow</property>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <factor>0.5</factor>
         </volume>
         <volume>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[3]/volume</property>
            <max>1</max>
         </volume>
         <pitch>
            <property>sim/model/Westland_Lynx-AH7/sound/slide[3]/pitch</property>
         </pitch>
      </slide>

      <wind>
         <name>wind</name>
         <mode>looped</mode>
         <path>Sounds/wind.wav</path>
         <condition>
            <and>
               <property>velocities/airspeed-kt</property>
               <not>
                  <property>sim/crashed</property>
               </not>
               <not>
                  <property>sim/current-view/internal</property>
               </not>
            </and>
         </condition>
         <volume>
            <property>position/altitude-ft</property>
            <factor>-0.000015</factor>
            <offset>1.0</offset>
            <min>0.1</min>
            <max>1.0</max>
         </volume>
         <volume>
            <property>velocities/airspeed-kt</property>
            <factor>0.0015</factor>
            <min>0.03</min>
            <max>0.25</max>
         </volume>
         <pitch>
            <property>velocities/airspeed-kt</property>
            <factor>0.01</factor>
            <offset>1.25</offset>
         </pitch>
         <reference-dist>3</reference-dist>
         <max-dist>4</max-dist>
      </wind>

      <crash>
         <name>intense ground contact</name>
         <mode>once</mode>
         <path>Sounds/crash.wav</path>
         <property>sim/crashed</property>
         <volume>
            <factor>1</factor>
         </volume>
         <pitch>
            <factor>0.1</factor>
         </pitch>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </crash>

      <gun>
         <name>GE M134 right</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/GE-M134.wav</path>
         <condition>
            <and>
               <property>sim/model/Westland_Lynx-AH7/weapons/MG[0]/trigger</property>
               <property>ai/submodels/submodel[0]/count</property>
            </and>
         </condition>
         <position>
            <x>0.88</x>
            <y>-0.19</y>
            <z>-0.2</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </gun>

      <gun>
         <name>GE M134 left</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/GE-M134.wav</path>
         <condition>
            <and>
               <property>sim/model/Westland_Lynx-AH7/weapons/MG[1]/trigger</property>
               <property>ai/submodels/submodel[1]/count</property>
            </and>
         </condition>
         <position>
            <x>-0.88</x>
            <y>-0.19</y>
            <z>-0.2</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </gun>

      <HOT>
         <name>HOT_OR</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/HOT.wav</path>
         <property>sim/model/Westland_Lynx-AH7/weapons/HOT[0]/trigger</property>
         <position>
            <x>1.58</x>
            <y>-0.25</y>
            <z>0.13</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </HOT>

      <HOT>
         <name>HOT_OL</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/HOT.wav</path>
         <property>sim/model/Westland_Lynx-AH7/weapons/HOT[1]/trigger</property>
         <position>
            <x>-1.58</x>
            <y>-0.25</y>
            <z>0.13</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </HOT>

      <HOT>
         <name>HOT_MR</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/HOT.wav</path>
         <property>sim/model/Westland_Lynx-AH7/weapons/HOT[2]/trigger</property>
         <position>
            <x>1.39</x>
            <y>-0.07</y>
            <z>0.13</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </HOT>

      <HOT>
         <name>HOT_ML</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/HOT.wav</path>
         <property>sim/model/Westland_Lynx-AH7/weapons/HOT[3]/trigger</property>
         <position>
            <x>-1.39</x>
            <y>-0.07</y>
            <z>0.13</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </HOT>

      <HOT>
         <name>HOT_IR</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/HOT.wav</path>
         <property>sim/model/Westland_Lynx-AH7/weapons/HOT[4]/trigger</property>
         <position>
            <x>1.21</x>
            <y>0.08</y>
            <z>0.13</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </HOT>

      <HOT>
         <name>HOT_IL</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/HOT.wav</path>
         <property>sim/model/Westland_Lynx-AH7/weapons/HOT[5]/trigger</property>
         <position>
            <x>-1.21</x>
            <y>0.08</y>
            <z>0.13</z>
         </position>
         <reference-dist>100</reference-dist>
         <max-dist>500</max-dist>
      </HOT>



      <door>
         <name>open left bay doors</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/door_slide_open.wav</path>
         <condition>
            <equals>
               <property>sim/model/bo105/doors/door[3]/position-norm</property>
               <value>true</value>
            </equals>
         </condition>
         <position>
            <x>1.0</x>
            <y>1.5</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>1.0</factor>
         </volume>
         <reference-dist>3</reference-dist>
         <max-dist>10</max-dist>
      </door>
      <door>
         <name>open right bay doors</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/door_slide_open.wav</path>
         <condition>
            <equals>
                <property>sim/model/bo105/doors/door[2]/position-norm</property>
               <value>true</value>
            </equals>
         </condition>
         <position>
            <x>1.0</x>
            <y>-1.5</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>1.0</factor>
         </volume>
         <reference-dist>3</reference-dist>
         <max-dist>10</max-dist>
      </door>
      <door>
         <name>close left bay doors</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/door_slide_open.wav</path>
         <condition>
            <equals>
               <property>controls/doors/left-door</property>
               <value>false</value>
            </equals>
         </condition>
         <position>
            <x>1.0</x>
            <y>1.5</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>1.0</factor>
         </volume>
         <reference-dist>3</reference-dist>
         <max-dist>10</max-dist>
      </door>
      <door>
         <name>close right bay doors</name>
         <mode>once</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/door_slide_open.wav</path>
         <condition>
            <equals>
               <property>controls/doors/right-door</property>
               <value>false</value>
            </equals>
         </condition>
         <position>
            <x>1.0</x>
            <y>-1.5</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>1.0</factor>
         </volume>
         <reference-dist>3</reference-dist>
         <max-dist>10</max-dist>
      </door>

      <door>
         <name>close right frontdoor</name>
         <mode>once</mode>
         <path>Sounds/door_close.wav</path>
         <condition>
            <equals>
               <property>sim/model/Westland_Lynx-AH7/doors/door[0]/position-norm</property>
               <value>0</value>
            </equals>
         </condition>
         <position>
            <x>1.0</x>
            <y>1.5</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>0.3</factor>
         </volume>
         <reference-dist>15</reference-dist>
         <max-dist>50</max-dist>
      </door>

      <door>
         <name>close left frontdoor</name>
         <mode>once</mode>
         <path>Sounds/door_close.wav</path>
         <condition>
            <equals>
               <property>sim/model/Westland_Lynx-AH7/doors/door[1]/position-norm</property>
               <value>0</value>
            </equals>
         </condition>
         <position>
            <x>-1.0</x>
            <y>1.5</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>0.3</factor>
         </volume>
         <reference-dist>15</reference-dist>
         <max-dist>50</max-dist>
      </door>

      <door>
         <name>close right backdoor</name>
         <mode>once</mode>
         <path>Sounds/door_close.wav</path>
         <condition>
            <equals>
               <property>sim/model/Westland_Lynx-AH7/doors/door[2]/position-norm</property>
               <value>0</value>
            </equals>
         </condition>
         <position>
            <x>1.0</x>
            <y>1.0</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>0.3</factor>
         </volume>
         <reference-dist>15</reference-dist>
         <max-dist>50</max-dist>
      </door>

      <door>
         <name>close left backdoor</name>
         <mode>once</mode>
         <path>Sounds/door_close.wav</path>
         <condition>
            <equals>
               <property>sim/model/Westland_Lynx-AH7/doors/door[3]/position-norm</property>
               <value>0</value>
            </equals>
         </condition>
         <position>
            <x>-1.0</x>
            <y>1.0</y>
            <z>-1.5</z>
         </position>
         <volume>
            <factor>0.3</factor>
         </volume>
         <reference-dist>15</reference-dist>
         <max-dist>50</max-dist>
      </door>

      <door>
         <name>close right reardoor</name>
         <mode>once</mode>
         <path>Sounds/door_close.wav</path>
         <condition>
            <equals>
               <property>sim/model/Westland_Lynx-AH7/doors/door[4]/position-norm</property>
               <value>0</value>
            </equals>
         </condition>
         <position>
            <x>0.0</x>
            <y>-1.5</y>
            <z>-1.0</z>
         </position>
         <volume>
            <factor>0.3</factor>
         </volume>
         <reference-dist>15</reference-dist>
         <max-dist>50</max-dist>
      </door>

      <door>
         <name>close left reardoor</name>
         <mode>once</mode>
         <path>Sounds/door_close.wav</path>
         <condition>
            <equals>
               <property>sim/model/Westland_Lynx-AH7/doors/door[5]/position-norm</property>
               <value>0</value>
            </equals>
         </condition>
         <position>
            <x>0.0</x>
            <y>-1.5</y>
            <z>-1.0</z>
         </position>
         <volume>
            <factor>0.3</factor>
         </volume>
         <reference-dist>15</reference-dist>
         <max-dist>50</max-dist>
      </door>
      
        <rotor>
            <name>rotorinside</name>
            <mode>looped</mode>
            <path>Aircraft/Westland_Lynx-AH7/Sounds/inside_noflap.wav</path>
            <condition>
            <and>
               <property>sim/current-view/internal</property>
               <greater-than>
                  <property>rotors/main/rpm</property>
                  <value>50</value>
               </greater-than>
               <not>
                  <property>sim/crashed</property>
               </not>
            </and>
         </condition>
         <volume>
            <factor>0.1</factor>
         </volume>
         <volume>
            <property>rotors/main/rpm</property>
            <factor>0.002</factor>
         </volume>
            <pitch>
                <property>rotors/main/rpm</property>
                <factor>0.00325</factor>
                <offset>-0.0</offset>
                <max>2.5</max>
            </pitch>
            <reference-dist>500</reference-dist>
            <max-dist>1000</max-dist>
        </rotor>
      
                  <rain>
         <name>rain-inside</name>
         <mode>looped</mode>
         <path>Aircraft/Westland_Lynx-AH7/Sounds/insideGArainwav.wav</path>
         <condition>
         <and>
         <greater-than>
            <property>environment/rain-norm</property>
            <value>0.05</value>
            </greater-than>
            
            <property>sim/current-view/internal</property>
            
         </and>   
         </condition>
         <delay-sec>11.6</delay-sec>
         <volume>
            <factor>0.3</factor>
         </volume>
         <position>
            <x>-0.5</x>
            <y>0</y>
            <z>0.5</z>
         </position>
         <volume>
            <property>environment/rain-norm</property>
            <factor>1</factor>
            <min>0.3</min>
            <max>1</max>
         </volume>
         <reference-dist>5</reference-dist>
         <max-dist>10</max-dist>
      </rain>
      
      
   </fx>
</PropertyList>

"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Re: Westland Lynx AH7

Postby cobe571 » Tue Jun 25, 2019 9:25 pm

Inside the folder Systems

Image


autopilot-H.xml

Code: Select all

<?xml version="1.0"?>
 
<!-- Generic Autopilot Configuration -->

<!-- Each component is evaluated in the order specified.  You can make up -->
<!-- property names to pass the result of one component on to a subsequent -->
<!-- component. -->


<PropertyList>



  <!-- =============================================================== -->
  <!-- Roll Axis Modes                                                 -->
  <!-- =============================================================== -->

  <!-- Wing leveler -->
  <pid-controller>
    <name>Wing Leveler (Turn Coordinator based)</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>wing-leveler</value>
    </enable>
    <input>
      <prop>/instrumentation/turn-indicator/indicated-turn-rate</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/controls/flight/aileron</prop>
    </output>
    <config>
      <Kp>0.5</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Heading Bug Hold.  2 stage cascade controller. -->

  <!-- Stage #1 sets target roll based on diff between current heading -->
  <!-- and heading bug. -->
  <pid-controller>
    <name>Heading Bug Hold (DG based) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>dg-heading-hold</value>
    </enable>
    <input>
      <prop>/autopilot/internal/heading-bug-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>     <!-- input value weighing factor -->
      <alpha>0.1</alpha>   <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>   <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>     <!-- derivator time -->
      <u_min>-20.0</u_min> <!-- minimum output clamp -->
      <u_max>20.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  <pid-controller>
    <name>Heading Bug Hold (DG based) Stage 2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>dg-heading-hold</value>
    </enable>
    <input>
      <prop>/orientation/roll-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-roll-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/aileron</prop>
    </output>
    <config>
      <Kp>0.1</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- True Heading hold.  2 stage cascade controller. -->

  <!-- Stage #1 sets target roll based on diff between current heading -->
  <!-- and target heading. -->
  <pid-controller>
    <name>True Heading Hold (DG based) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>true-heading-hold</value>
    </enable>
    <input>
      <prop>/autopilot/internal/true-heading-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>     <!-- input value weighing factor -->
      <alpha>0.1</alpha>   <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>   <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>     <!-- derivator time -->
      <u_min>-20.0</u_min> <!-- minimum output clamp -->
      <u_max>20.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  <pid-controller>
    <name>True Heading Hold (DG based) Stage 2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>true-heading-hold</value>
    </enable>
    <input>
      <prop>/orientation/roll-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-roll-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/aileron</prop>
    </output>
    <config>
      <Kp>0.1</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Nav1 hold.  2 stage cascade controller. -->

  <!-- Stage #1 sets target roll based on diff between current heading -->
  <!-- and target heading. -->
  <pid-controller>
    <name>Nav1 Hold Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>nav1-hold</value>
    </enable>
    <input>
      <prop>/autopilot/internal/nav1-heading-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>     <!-- input value weighing factor -->
      <alpha>0.1</alpha>   <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>   <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>     <!-- derivator time -->
      <u_min>-20.0</u_min> <!-- minimum output clamp -->
      <u_max>20.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  <pid-controller>
    <name>Nav1 Hold Stage 2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>nav1-hold</value>
    </enable>
    <input>
      <prop>/orientation/roll-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-roll-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/aileron</prop>
    </output>
    <config>
      <Kp>0.1</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>


 <!-- =============================================================== -->
 <!-- Pitch Axis Modes                                                -->
 <!-- =============================================================== -->

 <filter>
  <name>Pitch Hold</name>
  <type>gain</type>
  <debug>false</debug>
  <enable>
   <condition>
   <equals>       
    <property>/autopilot/locks/altitude</property>
    <value>pitch-hold</value>
   </equals>
   </condition>
  </enable>
  <input>
   <property>/autopilot/settings/target-pitch-deg</property>
   <value>0</value>
  </input>
  <output>
   <property>/autopilot/internal/target-pitch-deg</property>
  </output>
  <gain>1.0</gain>
  <u_min>-70.0</u_min>
  <u_max>70.0</u_max>
 </filter>
 
 <pid-controller>
 <name>Altitude Hold Computer</name>
 <debug>false</debug>
 <enable>
   <condition>
   <equals>       
    <property>/autopilot/locks/altitude</property>
    <value>altitude-hold</value>
   </equals>
   </condition>
  </enable>
  <input>
   <property>/position/altitude-ft</property>
  </input>
  <reference>
   <property>/autopilot/settings/target-altitude-ft</property>
  </reference>
  <output>
   <property>/autopilot/internal/target-pitch-deg</property>
  </output>
   <config>
     <Kp>0.075</Kp>        <!-- proportional gain -0.01 -->
    <beta>1.0</beta>       <!-- input value weighing factor -->
    <alpha>0.5</alpha>     <!-- low pass filter weighing factor -->
    <gamma>0.0</gamma>     <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
    <Ti>7.5</Ti>          <!-- integrator time  10.0 -->
    <Td>0.0001</Td>       <!-- derivator time -->
    <u_min>-6.0</u_min>  <!-- minimum output clamp -->
    <u_max>6.0</u_max>   <!-- maximum output clamp -->
   </config>
  </pid-controller>
 
  <pid-controller>
 <name>Altitude TFR Computer</name>
 <debug>false</debug>
 <enable>
   <condition>
   <equals>       
    <property>/autopilot/locks/altitude</property>
    <value>agl-hold</value>
   </equals>
   </condition>
  </enable>
  <input>
   <property>/position/altitude-agl-ft</property>
  </input>
  <reference>
   <property>/autopilot/settings/target-agl-ft</property>
  </reference>
  <output>
   <property>/autopilot/internal/target-pitch-deg</property>
  </output>
   <config>
     <Kp>0.075</Kp>        <!-- proportional gain -0.01 -->
    <beta>1.0</beta>       <!-- input value weighing factor -->
    <alpha>0.5</alpha>     <!-- low pass filter weighing factor -->
    <gamma>0.0</gamma>     <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
    <Ti>7.5</Ti>          <!-- integrator time  10.0 -->
    <Td>0.0001</Td>       <!-- derivator time -->
    <u_min>-10.0</u_min>  <!-- minimum output clamp -->
    <u_max>15.0</u_max>   <!-- maximum output clamp -->
   </config>
  </pid-controller>
 
   <pid-controller>
  <name>System Command: Pitch</name>
  <debug>false</debug>
  <enable>
   <condition>
    <not-equals>
   <property>/autopilot/locks/altitude</property>
   <value />
   </not-equals>
   </condition>
  </enable>
  <input>
   <property>/orientation/pitch-deg</property>
  </input>
  <reference>
   <property>/autopilot/internal/target-pitch-deg</property>
  </reference>
  <output>
   <property>/controls/flight/elevator</property>
  </output>
  <config>
   <Kp>-0.05</Kp>     
   <beta>1.0</beta>    <!-- input value weighing factor -->
   <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
   <gamma>0.0</gamma>  <!-- input value weighing factor for -->
   <Ti>20.0</Ti>       <!-- integrator time  10.0 -->
   <Td>0.00001</Td>    <!-- derivator time -->
   <u_min>-0.35</u_min> <!-- minimum output clamp -->
   <u_max>0.35</u_max>
  </config>
 </pid-controller>
 
 <!-- vertical speed hold -->
  <pid-controller>
    <name>Vertical Speed Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>vertical-speed-hold</value>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/vertical-speed-fpm</prop>
      <scale>0.01667</scale>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Kp>-0.0025</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Glideslope hold. -->

  <!-- Stage #2 drives the elevator-trim to achieve the desired climb rate. -->
  <pid-controller>
    <name>Glideslop Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>gs1-hold</value>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/instrumentation/nav[0]/gs-rate-of-climb</prop>
    </reference>
     <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Kp>-0.01</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- vertical speed hold -->
  <pid-controller>
    <name>Vertical Speed Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>vertical-speed-hold</value>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/vertical-speed-fpm</prop>
      <scale>0.01667</scale>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Kp>-0.01</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>


 <!-- =============================================================== -->
 <!-- Velocity Modes                                                  -->
 <!-- =============================================================== -->

 <!-- Auto throttle -->
 <pid-controller>
    <name>Auto Throttle (5 sec lookahead)</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>speed-with-throttle</value>
    </enable>
    <input>
      <!-- <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop> -->
      <prop>/velocities/airspeed-kt</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-speed-kt</prop>
    </reference>
    <output>
      <prop>/controls/engines/engine[0]/throttle</prop>
      <prop>/controls/engines/engine[1]/throttle</prop>
      <prop>/controls/engines/engine[2]/throttle</prop>
      <prop>/controls/engines/engine[3]/throttle</prop>
      <prop>/controls/engines/engine[4]/throttle</prop>
      <prop>/controls/engines/engine[5]/throttle</prop>
      <prop>/controls/engines/engine[6]/throttle</prop>
      <prop>/controls/engines/engine[7]/throttle</prop>
    </output>
    <config>
      <Kp>0.1</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>0.0</u_min>  <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

 <!-- Hold speed by varying pitch trim (Two stage cascading controller) -->
 <pid-controller>
    <name>Speed hold (vary pitch trim) Stage #1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>speed-with-pitch-trim</value>
    </enable>
    <input>
      <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-speed-kt</prop>
    </reference>
    <output>
      <prop>/autopilot/settings/target-pitch-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>       <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>1.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-15.0</u_min><!-- minimum output clamp -->
      <u_max>15.0</u_max> <!-- maximum output clamp -->
    </config>
  </pid-controller>

 <pid-controller>
    <name>Speed hold (vary pitch trim) Stage #2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>speed-with-pitch-trim</value>
    </enable>
    <input>
      <prop>/orientation/pitch-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-pitch-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Kp>-0.05</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>1.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

</PropertyList>



flight-recorder.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!-- BK117 custom flight recorder configuration
    Heiko Schulz & Oliver Thurau January 2012
    Based on Thorsten Brehms work
-->

<PropertyList>

   <!-- selected active flight recorder configuration for replay system -->
   <replay-config type="int">0</replay-config>

<!--
   <config n="0" include="/Aircraft/Generic/flightrecorder/generic-jet.xml"/>
 -->

<config n="0">
   <name type="string">BK117 Flight Recorder</name>
   <!-- include generic stuff -->
   <signals include="/Aircraft/Generic/flightrecorder/components/position.xml"/>
   <signals include="/Aircraft/Generic/flightrecorder/components/gear-retractable.xml"/>
   <signals include="/Aircraft/Generic/flightrecorder/components/controls.xml"/>
   <signals include="/Aircraft/Generic/flightrecorder/components/environment.xml"/>
   <signals include="/Aircraft/Generic/flightrecorder/components/tanks.xml">
      <count type="int">2</count>
   </signals>
   
   <!--  main rotor -->
   <signals include="/Aircraft/Generic/flightrecorder/components/rotor.xml">
      <prefix type="string">/rotors/main</prefix>
   </signals>
   
   <!--  tail rotor -->
   <signals include="/Aircraft/Generic/flightrecorder/components/rotor.xml">
      <prefix type="string">/rotors/tail</prefix>
   </signals>
   
   <!--  custom properties -->
   <signals>

      <!--  rotor and blade properties -->
      <signal>
         <type>float</type>
         <property type="string">roll-deg</property>
         <interpolation type="string">angular-deg</interpolation>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">rpm</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">stall</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">torque</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">yaw-deg</property>
         <interpolation type="string">angular-deg</interpolation>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">cone-deg</property>
         <interpolation type="string">angular-deg</interpolation>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade/flap-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade/incidence-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade/position-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade[1]/flap-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade[1]/incidence-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade[1]/position-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade[2]/flap-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade[2]/incidence-deg</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/rotors/main/blade[2]/position-deg</property>
      </signal>
      <!--  lights properties -->
      <signal>
         <type>float</type>
         <property type="string">sim/multiplay/generic/float[0]</property>
      </signal>
      <signal>
         <type>bool</type>
         <property type="string">/controls/lighting/landing-lights</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/controls/landinglight/position-norm</property>
      </signal>
      <signal>
         <type>bool</type>
         <property type="string">/controls/lighting/nav-lights</property>
      </signal>
      <signal>
         <type>bool</type>
         <property type="string">/controls/lighting/beacon</property>
      </signal>
      <!--  simple single engine properties -->
      <signal>
         <type>float</type>
         <property type="string">/controls/engines/engine/throttle</property>
      </signal>
      <signal>
         <type>string</type>
         <property type="string">/engines/engine/tot-degc</property>
      </signal>
      <signal>
         <type>string</type>
         <property type="string">engines/engine[0]/rpm</property>
      </signal>
      <signal>
         <type>string</type>
         <property type="string">/engines/engine/n1-pct</property>
      </signal>
      <signal>
         <type>string</type>
         <property type="string">/instrumentation/VEMD/FLI/FLI-filter</property>
      </signal>
      <signal>
         <type>double</type>
         <property type="string">/sim/model/bk117/torque-pct</property>
      </signal>
      <!--  door properties -->
      <signal>
         <type>float</type>
         <property type="string">/sim/model/bk117/door-positions/leftFrontDoor/position-norm</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/sim/model/bk117/door-positions/rightFrontDoor/position-norm</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/sim/model/bk117/door-positions/leftBackDoor/position-norm</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/sim/model/bk117/door-positions/rightBackDoor/position-norm</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/sim/model/bk117/door-positions/leftRearDoor/position-norm</property>
      </signal>
      <signal>
         <type>float</type>
         <property type="string">/sim/model/bk117/door-positions/rightRearDoor/position-norm</property>
      </signal>
      
   </signals>
   
</config>

</PropertyList>



glass-rain.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<!--
    Copyright (c) 2015 Wayne Bragg

    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.

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

<PropertyList>

    <filter>
        <name>splash-xa</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/velocities/airspeed-kt</property>
                    <entry><ind>   0 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>   4 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>   15 </ind><dep> -1.7  </dep></entry>
                    <entry><ind>  50 </ind><dep> -2.1  </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-xa</property>
        </output>
    </filter>

    <filter>
        <name>splash-za</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/velocities/airspeed-kt</property>
                    <entry><ind>   0 </ind><dep>  0.82 </dep></entry>
                    <entry><ind>   4 </ind><dep>  0.82 </dep></entry>
                    <entry><ind>   15 </ind><dep> -0.17 </dep></entry>
                    <entry><ind>  50 </ind><dep> -0.35 </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-za</property>
        </output>
    </filter>

    <filter>
        <name>splash-xr</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/engines/active-engine/rpm</property>
                    <entry><ind>    0 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  600 </ind><dep> -0.33 </dep></entry>
                    <entry><ind>  601 </ind><dep> -1.3  </dep></entry>
                    <entry><ind> 1500 </ind><dep> -1.9  </dep></entry>
                </table>
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-xr</property>
        </output>
    </filter>

    <filter>
        <name>splash-zr</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>1.0</gain>
        <input>
            <expression>
                <table>
                    <property>/engines/active-engine/rpm</property>
                    <entry><ind>    0 </ind><dep>  0.82  </dep></entry>
                    <entry><ind>  600 </ind><dep>  0.82  </dep></entry>
                    <entry><ind>  601 </ind><dep>  0.127 </dep></entry>
                    <entry><ind> 1500 </ind><dep> -0.29  </dep></entry>
                </table>0
            </expression>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-zr</property>
        </output>
    </filter>

    <filter>
        <name>splash-x</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>-1.0</gain>
        <input>
            <condition>
                <greater-than-equals>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </greater-than-equals>
            </condition>
            <property>/environment/aircraft-effects/splash-xa</property>
        </input>
        <input>
            <condition>
                <less-than>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </less-than>
            </condition>
            <property>/environment/aircraft-effects/splash-xr</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-x</property>
        </output>
    </filter>

    <filter>
        <name>splash-y</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>-1.0</gain>
        <input>
            <value>0.0</value>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-y</property>
        </output>
    </filter>

    <filter>
        <name>splash-z</name>
        <update-interval-secs type="double">0.1</update-interval-secs>
        <type>gain</type>
        <gain>-1.0</gain>
        <input>
            <condition>
                <greater-than-equals>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </greater-than-equals>
            </condition>
            <property>/environment/aircraft-effects/splash-za</property>
        </input>
        <input>
            <condition>
                <less-than>
                    <property>/velocities/airspeed-kt</property>
                    <value>5</value>
                </less-than>
            </condition>
            <property>/environment/aircraft-effects/splash-zr</property>
        </input>
        <output>
            <property>/environment/aircraft-effects/splash-vector-z</property>
        </output>
    </filter>

</PropertyList>



init_electrical.nas

Code: Select all

init_electrical = func {
    print("Initializing Nasal Electrical System");
   

    # set initial switch positions
    setprop("/controls/engines/engine[0]/master-bat", 0);
    setprop("/controls/engines/engine[0]/master-alt", "true");
    setprop("/controls/switches/master-avionics", 0);
    setprop("/systems/electrical/outputs/fuel-pump", 0.0);
    setprop("/systems/electrical/outputs/cabin-lights", 0.0);
    setprop("/systems/electrical/outputs/instr-ignition-switch", 0.0);
    setprop("/systems/electrical/outputs/beacon", 0.0);
}

init_electrical();



instrumentation.xml

Code: Select all

<?xml version="1.0"?>

<PropertyList>
   <adf>
      <name>adf</name>
      <number>0</number>
   </adf>

   <adf>
      <name>adf-radio</name>
      <number>0</number>
   </adf>

   <airspeed-indicator>
      <name>airspeed-indicator</name>
      <number>0</number>
      <total-pressure>/systems/pitot/total-pressure-inhg</total-pressure>
      <static-pressure>/systems/static/pressure-inhg</static-pressure>
   </airspeed-indicator>

   <altimeter>
      <name>altimeter</name>
      <number>0</number>
      <static-pressure>/systems/static/pressure-inhg</static-pressure>
   </altimeter>

   <attitude-indicator>
      <name>attitude-indicator</name>
      <number>0</number>
      <suction>/systems/vacuum/suction-inhg</suction>
   </attitude-indicator>

   <clock>
      <name>clock</name>
      <number>0</number>
   </clock>

   <dme>
      <name>dme</name>
      <number>0</number>
   </dme>

   <encoder>
      <name>encoder</name>
      <number>0</number>
      <static-pressure>/systems/static/pressure-inhg</static-pressure>
   </encoder>

   <gsdi>
      <name>gsdi</name>
      <number>0</number>
   </gsdi>

   <marker-beacon>
      <name>marker-beacon</name>
      <number>0</number>
   </marker-beacon>

   <heading-indicator>
      <name>heading-indicator</name>
      <number>0</number>
      <suction>/systems/vacuum/suction-inhg</suction>
   </heading-indicator>

   <KT-70>
      <name>kt-70</name>
      <number>0</number>
   </KT-70>

   <magnetic-compass>
      <name>magnetic-compass</name>
      <number>0</number>
   </magnetic-compass>

   <nav-radio>
      <name>nav</name>
      <number>0</number>
   </nav-radio>

   <nav-radio>
      <name>nav</name>
      <number>1</number>
   </nav-radio>

   <slip-skid-ball>
      <name>slip-skid-ball</name>
      <number>0</number>
   </slip-skid-ball>

   <transponder>
      <name>transponder</name>
      <number>0</number>
      <mode-c-altitude>/instrumentation/encoder/mode-c-alt-ft</mode-c-altitude>
   </transponder>

   <turn-indicator>
      <name>turn-indicator</name>
      <number>0</number>
   </turn-indicator>

   <vertical-speed-indicator>
      <name>vertical-speed-indicator</name>
      <number>0</number>
      <static-pressure>/systems/static/pressure-inhg</static-pressure>
   </vertical-speed-indicator>

   <gps>
      <name>gps</name>
      <number>0</number>
   </gps>

   <tacan>
      <name>tacan</name>
      <number>0</number>
   </tacan>
</PropertyList>

"According to the laws of aerodynamics, the bumblebee can't fly either, but the bumblebee doesn't know anything about the laws of aerodynamics, so it goes ahead and flies anyway."
User avatar
cobe571
 
Posts: 164
Joined: Thu Mar 07, 2013 11:28 pm
Location: (ITALY)
Callsign: cobe571
IRC name: cobe571
Version: 2018.3.2
OS: UbuntuStudio , Win10

Previous

Return to Aircraft

Who is online

Users browsing this forum: Google [Bot] and 27 guests