<?xml version="1.0"?>
<!-- version: 2020-05-24 -->
<PropertyList>
  <name>weight_and_balance_dialog</name>
  <layout>vbox</layout>
  <default-padding>1</default-padding>
  <modal>false</modal>
  <width>600</width>

<!-- Title bar with close button -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <default-padding>1</default-padding>
    <empty>
      <stretch>true</stretch>
    </empty>
    <text>
      <label>Weight and Balance Settings</label>
      <font>
        <name>times_bold</name>
      </font>
    </text>
    <empty>
      <stretch>true</stretch>
    </empty>
    <button>
      <legend/>
      <key>Esc</key>
      <pref-width>16</pref-width>
      <pref-height>16</pref-height>
      <border>2</border>
      <binding>
        <command>dialog-close</command>
      </binding>
    </button>
  </group>

  <hrule/>
  <hrule/>

<!-- dragonfly weight setting -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>  
      <text>
        <halign>left</halign>
        <label>Empty Weight</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
        <frame>
          <layout>hbox</layout>
          <halign>center</halign>
          <text>
            <label>999999999</label>
            <live>true</live>
            <format>  %3.1f lbs</format>
            <property>/fdm/jsbsim/inertia/empty-weight-lbs</property>
            <color>
              <red>0.</red>
              <green>1.</green>
              <blue>1.</blue>
            </color>
          </text>
        </frame>

        <frame>
          <layout>hbox</layout>
          <halign>center</halign>
          <text>
            <label>9999999999</label>
            <live>true</live>
            <format>  %3.1f kg</format>
            <property>/fdm/jsbsim/inertia/empty-weight-kg</property>
            <color>
              <red>0.</red>
              <green>1.</green>
              <blue>1.</blue>
            </color>
          </text>
        </frame>
    </frame>

    <group>
      <layout>hbox</layout>
      <equal>true</equal>
      <empty>
        <stretch>true</stretch>
      </empty>
    </group>

  </group>

<!-- pilot weight -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Pilot</label>
      </text>
    </frame>

    <frame> 
    <layout>hbox</layout> 
    <equal>true</equal>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lbs</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-lbs[0]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f kg</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-kg[0]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <halign>center</halign>
      <slider>
        <name>pilots_weight</name>
        <live>true</live>
        <property>/fdm/jsbsim/inertia/pointmass-weight-kg[0]</property>
        <min>0.0</min>
        <max>150.0</max>
        <step>1.0</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance()</script>
        </binding>
      </slider>
    </frame>

  </group>

<!-- co-pilot weight -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Co-Pilot</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lbs</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-lbs[1]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f kg</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-kg[1]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <halign>center</halign>
      <slider>
        <name>Co-Pilot</name>
        <live>true</live>
        <property>/fdm/jsbsim/inertia/pointmass-weight-kg[1]</property>
        <min>0.0</min>
        <max>150.0</max>
        <step>1.0</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance()</script>
        </binding>

      </slider>
    </frame>

  </group>

<!-- instruments -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Instruments in panel</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout> 
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lbs</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-lbs[2]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f kg</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-kg[2]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal> 
      <halign>center</halign>
      <slider>
        <name>InstrumentsPanel</name>
        <live>true</live>
        <property>/fdm/jsbsim/inertia/pointmass-weight-kg[2]</property>
        <min>0.0</min>
        <max>10.0</max>
        <step>0.1</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance()</script>
        </binding>
      </slider>
    </frame>

  </group>

<!-- Floats -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Floats</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout> 
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lbs</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-lbs[3]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f kg</format>
          <property>/fdm/jsbsim/inertia/pointmass-weight-kg[3]</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <halign>center</halign>
      <slider>
        <name>Floats</name>
        <live>true</live>
        <property>/fdm/jsbsim/inertia/pointmass-weight-kg[3]</property>
        <min>0.0</min>
        <max>7.0</max>
        <step>1.</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance()</script>
        </binding>
      </slider>
    </frame>

  </group>

<!-- Fuel weight -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Fuel</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout> 
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lbs</format>
          <property>/consumables/fuel/total-fuel-lbs</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f kg</format>
          <property>/consumables/fuel/total-fuel-kg</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <halign>center</halign>
      <slider>
        <name>Fuel</name>
        <live>true</live>
        <property>/consumables/fuel/tank/level-kg</property>
        <min>0.0</min>
        <max>15.0</max>
        <step>0.5</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance()</script>
        </binding>
      </slider>
    </frame>

  </group>


<!-- total weight  -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Max. all-up weight</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lbs</format>
          <property>/fdm/jsbsim/inertia/weight-lbs</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f kg</format>
          <property>/fdm/jsbsim/inertia/weight-kg</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <label>Max: 992lbs / 450kg</label>
      </text>
    </frame>

  </group>

  <hrule/>

<!-- Total CG position  -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>CG position (from Nose)</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f inch</format>
          <property>/fdm/jsbsim/inertia/cg_from_nose-in</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f mm</format>
          <property>/fdm/jsbsim/inertia/cg_from_nose-mm</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <label>Limit: 1921mm &lt; CG &lt; 2077mm</label>
      </text>
    </frame>

  </group>


<!-- CG / MAC in Percent -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>CG position from LE / MAC</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>99999999999999</label>
          <live>true</live>
          <format>       %3.1f pc</format>
          <property>/fdm/jsbsim/inertia/cg_mac-pc</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <label>Limit:  24.2% &lt; CG &lt; 33.7%</label>
      </text>
    </frame>

  </group>


  <hrule/>

<!-- Wing Loading  -->
  <group>
    <layout>hbox</layout><equal>true</equal>
    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <text>
        <halign>left</halign>
        <label>Wing Loading</label>
      </text>
    </frame>

    <frame>
      <layout>hbox</layout>
      <equal>true</equal>
      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format>  %3.1f lb/sqft</format>
          <property>/fdm/jsbsim/inertia/wing_loading_lbsqft</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>

      <frame>
        <layout>hbox</layout>
        <halign>center</halign>
        <text>
          <label>9999999999</label>
          <live>true</live>
          <format> %3.1f kg/sqm</format>
          <property>/fdm/jsbsim/inertia/wing_loading_kgsqm</property>
          <color>
            <red>0.</red>
            <green>1.</green>
            <blue>1.</blue>
          </color>
        </text>
      </frame>
    </frame>
    <group>
      <layout>hbox</layout>
       <equal>true</equal>
       <empty>
         <stretch>true</stretch>
       </empty>
    </group>

  </group>

  <hrule/>
  <hrule/>

<!-- bottom line -->
  <frame>
    <layout>hbox</layout>
    <default-padding>1</default-padding>
    <empty>
      <stretch>true</stretch>
    </empty>
    <button>
      <legend>Set Defaults</legend>
      <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance_defaults()</script>
        </binding>
      <binding>
          <command>nasal</command>
          <script>dragonfly.weight_and_balance()</script>
        </binding>
    </button>
    <empty>
      <stretch>true</stretch>
    </empty>
    <button>
      <legend>Close</legend>
      <binding>
        <command>dialog-close</command>
      </binding>
    </button>
    <empty>
      <stretch>true</stretch>
    </empty>
  </frame>

</PropertyList>
