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

Checklist: Parking

Copyright (c) 2015 Richard Senior

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>

  <title>Parking</title>

  <!-- Parking Brake - ON -->
  <item>
    <name>Parking Brake</name>
    <value>ON</value>
    <condition>
      <equals>
        <property>controls/gear/brake-parking</property>
        <value>1</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>controls/gear/brake-parking</property>
      <value>1</value>
    </binding>
  </item>

  <!-- Taxi Light - OFF -->
  <item>
    <name>Taxi Light</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>systems/electrical/outputs/taxi-light</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>controls/lighting/taxi-light</property>
      <value>0</value>
    </binding>
    <binding>
      <command>nasal</command>
      <script>pup.click();</script>
    </binding>
  </item>

  <!-- Transponder - OFF -->
  <item>
    <name>Transponder</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>instrumentation/transponder/inputs/knob-mode</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>instrumentation/transponder/inputs/knob-mode</property>
      <value>0</value>
    </binding>
  </item>

  <!-- Radios - OFF -->
  <item>
    <name>Radios</name>
    <value>OFF</value>
    <condition>
      <and>
        <not>
          <property>instrumentation/adf/power-btn</property>
        </not>
        <not>
          <property>instrumentation/comm/power-btn</property>
        </not>
        <not>
          <property>instrumentation/dme/power-btn</property>
        </not>
      </and>
    </condition>
    <binding>
      <command>property-interpolate</command>
      <property>instrumentation/adf/volume-norm</property>
      <value>0.0</value>
      <time>0.5</time>
    </binding>
    <binding>
      <command>property-assign</command>
      <property>instrumentation/adf/power-btn</property>
      <value>0</value>
    </binding>
    <binding>
      <command>property-interpolate</command>
      <property>instrumentation/comm/volume</property>
      <value>0.0</value>
      <time>0.5</time>
    </binding>
    <binding>
      <command>property-assign</command>
      <property>instrumentation/comm/power-btn</property>
      <value>0</value>
    </binding>
    <binding>
      <command>property-assign</command>
      <property>instrumentation/dme/power-btn</property>
      <value>0</value>
    </binding>
  </item>

  <!-- Throttle - TICK OVER -->
  <item>
    <name>Tick Over</name>
    <value>Approx 1000 RPM</value>
    <condition>
      <or>
        <not>
          <property>engines/engine/running</property>
        </not>
        <and>
          <greater-than>
            <property>engines/engine/rpm</property>
            <value>800</value>
          </greater-than>
          <less-than>
            <property>engines/engine/rpm</property>
            <value>1200</value>
          </less-than>
        </and>
      </or>
    </condition>
    <binding>
      <command>property-interpolate</command>
      <property>controls/engines/engine/throttle</property>
      <value>0.30</value>
      <rate>0.5</rate>
    </binding>
  </item>

  <!-- Mixture - IDLE CUTOFF -->
  <item>
    <name>Mixture</name>
    <value>IDLE CUTOFF</value>
    <condition>
      <equals>
        <property>controls/engines/engine/mixture</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-interpolate</command>
      <property>controls/engines/engine/mixture</property>
      <value>0</value>
      <rate>0.5</rate>
    </binding>
  </item>

  <!-- Beacon - OFF -->
  <item>
    <name>Beacon</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>systems/electrical/outputs/beacon</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>controls/lighting/beacon</property>
      <value>0</value>
    </binding>
    <binding>
      <command>nasal</command>
      <script>pup.click();</script>
    </binding>
  </item>

  <!-- Navigation Lights - OFF -->
  <item>
    <name>Navigation Lights</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>systems/electrical/outputs/nav-lights</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>controls/lighting/nav-lights</property>
      <value>0</value>
    </binding>
    <binding>
      <command>nasal</command>
      <script>pup.click();</script>
    </binding>
  </item>

  <!-- Alternator - OFF -->
  <item>
    <name>Alternator</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>controls/electric/engine/generator</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>controls/electric/engine/generator</property>
      <value>0</value>
    </binding>
    <binding>
      <command>nasal</command>
      <script>pup.click();</script>
    </binding>
  </item>

  <!-- Main Battery - OFF -->
  <item>
    <name>Main Battery</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>systems/electrical/outputs/bus-dc</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>property-assign</command>
      <property>controls/electric/battery-switch</property>
      <value>0</value>
    </binding>
    <binding>
      <command>nasal</command>
      <script>pup.click();</script>
    </binding>
  </item>

  <!-- Magnetos - OFF -->
  <item>
    <name>Magnetos</name>
    <value>OFF</value>
    <condition>
      <equals>
        <property>controls/engines/engine/magnetos</property>
        <value>0</value>
      </equals>
    </condition>
    <binding>
      <command>nasal</command>
      <script>
        pup.select_magnetos(pup.Magnetos.OFF);
      </script>
    </binding>
  </item>

  <!-- Fuel Tank Selector - OFF -->
  <item>
    <name>Fuel Tank Selector</name>
    <value>OFF</value>
    <condition>
      <not>
        <or>
          <property>consumables/fuel/tank[1]/selected</property>
          <property>consumables/fuel/tank[2]/selected</property>
        </or>
    </not>
    </condition>
    <binding>
      <command>nasal</command>
      <script>
          pup.select_fuel_tank(pup.Tank.OFF);
      </script>
    </binding>
  </item>

</PropertyList>
