<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">

<flight_plan alt="420" ground_alt="360" lat0="50.230060" lon0="10.990449" max_dist_from_home="1500" name="Flugplatz Steinruecken" security_height="25"  QFU="210">
  <header>
#include "subsystems/datalink/datalink.h"
</header>
  <waypoints>
    <waypoint name="HOME" x="0" y="0"/>
    <waypoint name="STDBY" x="103.9" y="-96.3"/>
    <waypoint name="PROFILE" x="123.9" y="-116.7"/>
    <waypoint name="1" x="8.9" y="-149.8"/>
    <waypoint name="2" x="241.5" y="-62.1"/>
    <waypoint name="MOB" x="137.0" y="-11.6"/>
    <waypoint name="S1" x="-100.8" y="-293.0"/>
    <waypoint name="S2" x="307.3" y="-65.4"/>
    <waypoint name="CLIMB" x="-102.3" y="-129.0"/>
  </waypoints>
  <exceptions>
    <exception cond="GetPosAlt() > 3400" deroute="Standby"/>
    <exception cond="datalink_time > 30" deroute="Standby"/>
  </exceptions>
  <blocks>
    <block name="Wait GPS">
      <set value="1" var="autopilot.kill_throttle"/>
      <while cond="!GpsFixValid()"/>
    </block>
    <block name="Geo init">
      <while cond="LessThan(NavBlockTime(), 10)"/>
      <call_once fun="NavSetGroundReferenceHere()"/>
    </block>
    <block name="Holding point">
      <set value="1" var="autopilot.kill_throttle"/>
      <attitude roll="0" throttle="0" vmode="throttle"/>
    </block>
    <block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
      <exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
      <set value="0" var="autopilot.kill_throttle"/>
      <set value="0" var="autopilot.flight_time"/>
      <go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB"/>
    </block>
    <block name="Standby" strip_button="Standby" strip_icon="home.png">
      <circle radius="nav_radius" wp="STDBY"/>
    </block>
    <block name="profile_up" strip_button="Profile Up" strip_icon="up_profile.png">
      <circle radius="nav_radius" wp="PROFILE"/>
    </block>
    <block name="profile_down" strip_button="Profile Down" strip_icon="down_profile.png">
      <circle pitch="RadOfDeg(-10)" radius="nav_radius" throttle="0" until="(GetAltRef()+150 > GetPosAlt())" vmode="throttle" wp="PROFILE"/>
      <deroute block="Standby"/>
    </block>
    <block name="MOB" strip_button="Circle around here" strip_icon="mob.png">
      <call_once fun="NavSetWaypointHere(WP_MOB)"/>
      <set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
      <circle radius="nav_radius" wp="MOB"/>
    </block>
    <block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png">
      <exception cond="datalink_time > 22" deroute="Standby"/>
      <call_once fun="nav_line_setup()"/>
      <call fun="nav_line_run(WP_1, WP_2, nav_radius)"/>
    </block>
    <block name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png">
      <oval p1="1" p2="2" radius="nav_radius"/>
    </block>
    <block name="Survey S1-S2 NS" strip_button="Survey (wp S1-S2) NS" strip_icon="survey.png">
      <survey_rectangle grid="150" wp1="S1" wp2="S2"/>
    </block>
    <block name="Survey S1-S2 WE" strip_button="Survey (wp S1-S2) WE" strip_icon="survey_we.png">
      <survey_rectangle grid="150" orientation="WE" wp1="S1" wp2="S2"/>
    </block>
  </blocks>
</flight_plan>
