<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://jsbsim.sf.net/JSBSimScript.xsl"?>
<runscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://jsbsim.sf.net/JSBSimScript.xsd"
    name="At-altitude autopilot test setup.">
    
  <use aircraft="c172x" initialize="reset01"/>
  <run start="0.0" end="200" dt="0.00833333">
    
    <event name="Engine start">
      <condition>simulation/sim-time-sec  ge  0.25</condition>
      <set name="fcs/throttle-cmd-norm" value="0.65"/>
      <set name="fcs/mixture-cmd-norm" value="0.87"/>
      <set name="propulsion/magneto_cmd" value="3"/>
      <set name="propulsion/starter_cmd" value="1"/>
      <set name="ap/heading_hold" value="0"/>
      <notify>
        <property>velocities/vc-kts</property>
        <property>position/h-agl-ft</property>
      </notify>
    </event>
    
    <event name="Trim">
      <condition>simulation/sim-time-sec  ge  0.50</condition>
      <set name="simulation/do_simple_trim" value="0"/>
      <notify>
        <property>velocities/vc-kts</property>
        <property>position/h-agl-ft</property>
      </notify>
    </event>

    <event name="Set roll autopilot">
      <condition>simulation/sim-time-sec  ge  5.0</condition>
      <set name="ap/attitude_hold" value="1"/>
      <notify>
        <property>velocities/vc-kts</property>
        <property>position/h-agl-ft</property>
      </notify>
    </event>

  </run>
</runscript>
