<?xml version="1.0"?>

<!-- Sperry SP3 Autopilot Dialog

     Copyright (c) 2016, 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, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
     MA 02110-1301, USA.
-->

<PropertyList>

  <name>autopilot</name>
  <modal>false</modal>
  <layout>vbox</layout>

  <!-- TITLE BAR -->

  <group>
    <layout>hbox</layout>
    <empty>
      <stretch>1</stretch>
    </empty>
    <text>
      <label>SPERRY SP3 AUTOPILOT</label>
    </text>
    <empty>
      <stretch>1</stretch>
    </empty>
    <button>
      <pref-width>16</pref-width>
      <pref-height>16</pref-height>
      <legend></legend>
      <keynum>27</keynum>
      <border>2</border>
      <binding>
        <command>dialog-close</command>
      </binding>
    </button>
  </group>

  <hrule/>

  <group>

    <!-- TITLES -->

    <default-padding>8</default-padding>
    <layout>table</layout>
    <text>
      <row>0</row>
      <col>0</col>
      <label>PITCH</label>
    </text>
    <text>
      <row>0</row>
      <col>1</col>
      <label>TRIM</label>
    </text>
    <text>
      <row>0</row>
      <col>2</col>
      <label>TURN CONTROL</label>
    </text>
    <text>
      <row>0</row>
      <col>3</col>
      <label>SWITCHES</label>
    </text>

    <!-- PITCH WHEEL -->

    <group>
      <layout>vbox</layout>
      <valign>top</valign>
      <row>1</row>
      <col>0</col>
      <button>
        <pref-width>40</pref-width>
        <pref-height>40</pref-height>
        <legend>DN</legend>
        <binding>
          <command>property-adjust</command>
          <property>autopilot/sperry/pitch-select</property>
          <step>-0.1</step>
          <min>-10.0</min>
        </binding>
      </button>
      <button>
        <pref-width>40</pref-width>
        <pref-height>40</pref-height>
        <legend>CTR</legend>
        <binding>
          <command>property-interpolate</command>
          <property>autopilot/sperry/pitch-select</property>
          <value>0</value>
          <time>0.25</time>
        </binding>
      </button>
      <button>
        <pref-width>40</pref-width>
        <pref-height>40</pref-height>
        <legend>UP</legend>
        <binding>
          <command>property-adjust</command>
          <property>autopilot/sperry/pitch-select</property>
          <step>0.1</step>
          <max>10.0</max>
        </binding>
      </button>
    </group>

    <!-- ELEV TRIM -->

    <group>
      <layout>vbox</layout>
      <valign>top</valign>
      <row>1</row>
      <col>1</col>
      <button>
        <pref-width>30</pref-width>
        <pref-height>30</pref-height>
        <legend>DN</legend>
        <binding>
          <command>property-adjust</command>
          <property>autopilot/sperry/elev-trim</property>
          <step>-0.01</step>
          <min>-5.0</min>
        </binding>
      </button>
      <button>
        <pref-width>30</pref-width>
        <pref-height>30</pref-height>
        <legend>UP</legend>
        <binding>
          <command>property-adjust</command>
          <property>autopilot/sperry/elev-trim</property>
          <step>0.01</step>
          <max>5.0</max>
        </binding>
      </button>
    </group>

    <!-- TURN KNOB -->

    <group>
      <layout>vbox</layout>
      <valign>top</valign>
      <row>1</row>
      <col>2</col>
      <text>
        <label>ROLL TRIM</label>
      </text>
      <group>
        <layout>hbox</layout>
        <halign>center</halign>
        <button>
          <pref-width>30</pref-width>
          <pref-height>30</pref-height>
          <legend>&lt;</legend>
          <binding>
            <command>property-adjust</command>
            <property>autopilot/sperry/roll-trim</property>
            <step>-0.1</step>
            <min>-5</min>
            <max>+5</max>
          </binding>
        </button>
        <button>
          <pref-width>30</pref-width>
          <pref-height>30</pref-height>
          <legend>&gt;</legend>
          <binding>
            <command>property-adjust</command>
            <property>autopilot/sperry/roll-trim</property>
            <step>+0.1</step>
            <min>-5</min>
            <max>+5</max>
          </binding>
        </button>
      </group>
      <text>
        <label>TURN</label>
      </text>
      <group>
        <layout>hbox</layout>
        <button>
          <pref-width>40</pref-width>
          <pref-height>40</pref-height>
          <legend>&lt;&lt;</legend>
          <binding>
            <command>property-adjust</command>
            <property>autopilot/sperry/turn-select</property>
            <step>-10</step>
            <min>-20</min>
            <max>+20</max>
          </binding>
        </button>
        <button>
          <pref-width>40</pref-width>
          <pref-height>40</pref-height>
          <legend>&lt;</legend>
          <binding>
            <command>property-adjust</command>
            <property>autopilot/sperry/turn-select</property>
            <step>-1</step>
            <min>-20</min>
            <max>+20</max>
          </binding>
        </button>
        <button>
          <pref-width>40</pref-width>
          <pref-height>40</pref-height>
          <legend>CTR</legend>
          <binding>
            <command>property-interpolate</command>
            <property>autopilot/sperry/turn-select</property>
            <value>0</value>
            <time>0.25</time>
          </binding>
        </button>
        <button>
          <pref-width>40</pref-width>
          <pref-height>40</pref-height>
          <legend>&gt;</legend>
          <binding>
            <command>property-adjust</command>
            <property>autopilot/sperry/turn-select</property>
            <step>+1</step>
            <min>-20</min>
            <max>+20</max>
          </binding>
        </button>
        <button>
          <pref-width>40</pref-width>
          <pref-height>40</pref-height>
          <legend>&gt;&gt;</legend>
          <binding>
            <command>property-adjust</command>
            <property>autopilot/sperry/turn-select</property>
            <step>+10</step>
            <min>-20</min>
            <max>+20</max>
          </binding>
        </button>
      </group>
    </group>

    <!-- SWITCHES -->

    <group>
      <layout>vbox</layout>
      <valign>top</valign>
      <row>1</row>
      <col>3</col>
      <checkbox>
        <halign>left</halign>
        <label>AP ON</label>
        <property>autopilot/sperry/main-switch</property>
        <live>true</live>
        <binding>
          <command>dialog-apply</command>
        </binding>
      </checkbox>
      <checkbox>
        <halign>left</halign>
        <label>ALT HLD</label>
        <property>autopilot/locks/altitude-hold</property>
        <live>true</live>
        <binding>
          <command>dialog-apply</command>
        </binding>
      </checkbox>
    </group>

  </group>

</PropertyList>
