<?xml version="1.0" encoding="iso-8859-1"?>

<PropertyList>
  
  <!-- If you put the dialog file in the Aircraft/aircraftname/gui/dialog the dialog box is loaded -->
  <name>Ground_Targeting</name>
  <modal type="bool">false</modal>
  <layout>vbox</layout>
<!--  <width>800</width>
  <height>345</height>-->
  
  <group>
    <layout>hbox</layout>
    <empty>
      <stretch>1</stretch>
    </empty>
    <text>
      <label>Ground Targeting</label>
    </text>
    
    <empty>
      <stretch>1</stretch>
    </empty>
    
    <button>
      <pref-width>16</pref-width>
      <pref-height>16</pref-height>
      <legend></legend>
      
      <default>1</default>
      <keynum>27</keynum>
      <border>2</border>
      <binding>
        <command>dialog-close</command>
      </binding>
      <binding>
        <command>dialog-apply</command>
      </binding>
    </button>
  </group>

  <hrule />

  <button>
    <legend>Sniping mode</legend>
    <enable>
        <equals>
          <property>payload/armament/station/id-6-set</property>
          <value>PDLCT</value>
        </equals>
    </enable>
    <binding>
      <command>nasal</command>
      <script>missile.sniping()</script>
    </binding>
  </button>

  <hrule />

  <text><label>Sniped properties</label></text>

  <hrule />

  <input>
   <width>75</width>
   <height>25</height>
   <label>Lat</label>
   <property>/sim/dialog/groundtTargeting/target-latitude-deg</property>
  </input>
  
  <input>
   <width>75</width>
   <height>25</height>
   <label>Lon</label>
   <property>/sim/dialog/groundtTargeting/target-longitude-deg</property>
  </input>

 <!--<input>
   <width>75</width>
   <height>25</height>
   <label>Alt</label>
   <property>/sim/dialog/groundtTargeting/target-alt-feet</property>
  </input>-->


  <hrule />
  
  <button>
    <legend>Acquisition</legend>
    <binding>
     <command>dialog-apply</command>
    </binding>
    <binding>
      <command>nasal</command>
      <script>missile.targetingGround()</script>
    </binding>
  </button>
  
    <button>
    <legend>Focus on target</legend>
    <binding>
     <command>dialog-apply</command>
    </binding>
    <binding>
      <command>nasal</command>
      <script>missile.focus_onTarget()</script>
    </binding>
  </button>
  


  <button>
    <legend>Follow closest GND AI/MP</legend>
    <binding>
     <command>dialog-apply</command>
    </binding>
    <binding>
      <command>nasal</command>
      <script>missile.follow_AI_MP()</script>
    </binding>
  </button>
  
<!--  <input>
   <legend>Time to target</legend>
   <width>75</width>
   <height>25</height>
   <label>TTT</label>
   <property>/sim/dialog/groundtTargeting/time-to-target</property>
  </input>-->
    <hrule />
  
<group>
    <layout>table</layout>
    <halign>center</halign>    
    <text>
        <row>0</row>
        <col>0</col>
        <label>A/G Falling time</label>
    </text>
    <text>
        <row>0</row>
        <col>1</col>
        <live>true</live>
        <property>/sim/dialog/groundtTargeting/time-to-target</property>
    </text>  
</group>

  <slider>
        <name>TTT</name>
        <property>/sim/dialog/groundtTargeting/time-to-target</property>
        <live>1</live>
        <min>10</min>
        <max>30</max>
        <step>5</step>
        <binding>
          <command>dialog-apply</command>
        </binding>
        <binding>
          <command>nasal</command>
          <script>
            gui.popupTip(sprintf("Falling time : %d", getprop("/sim/dialog/groundtTargeting/time-to-target")));
          </script>
        </binding>
   </slider>
  
   
     <hrule />
     
     
  <button>
    <legend>Delete Ground Target</legend>
    <binding>
     <command>dialog-apply</command>
    </binding>
    <binding>
      <command>nasal</command>
      <script>missile.del_target()</script>
    </binding>
  </button>  
  

</PropertyList>
