<?xml version="1.0" encoding="UTF-8"?>
<Mission xmlns="Tethys"
       xmlns:Control="Tethys/Control"
       xmlns:Guidance="Tethys/Guidance" 
       xmlns:Units="Tethys/Units"
       xmlns:Universal="Tethys/Universal"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="Tethys http://okeanids.mbari.org/tethys/Xml/Tethys.xsd
                           Tethys/Control http://okeanids.mbari.org/tethys/Xml/Control.xsd
                           Tethys/Guidance http://okeanids.mbari.org/tethys/Xml/Guidance.xsd
                           Tethys/Units http://okeanids.mbari.org/tethys/Xml/Units.xsd
                           Tethys/Universal http://okeanids.mbari.org/tethys/Xml/Universal.xsd"
       Id="TestMission">

<!--
TEST_CODE_START
minDepth = 5          # mission's min depth
maxDepth = 30         # mission's max depth
depthDelta = 3.5        # inflections can occur with delta of min/max depth
UP = 0
DOWN = 1
direction = DOWN
lastDepth = 0
depth = 0
infl = 0 
inflExpected = 11
data = slate.read("depth")[0]
for i in range(len(data)):
  lastDepth = depth
  depth = abs(float(data[i].data)) 
  if direction == DOWN and depth < lastDepth:
    direction = UP
    if utils.withinDelta(depth, maxDepth, depthDelta):
      infl = infl + 1
  elif direction == UP and depth > lastDepth:
    direction = DOWN
    if utils.withinDelta(depth, minDepth, depthDelta):
      infl = infl + 1
if infl >= inflExpected:
  passed = True
else:
  print "Error, expected at least %d inflections, only got %d." % ( inflExpected, infl )
TEST_CODE_END
-->

    <Timeout Duration="P1H"/>

    <Insert Filename="RegressionTests/InsertHighPriority.xml"/>

    <Insert Filename="RegressionTests/InsertSurfaceOps.xml"/>

    <Aggregate Id="TestAggregate">

        <Sequence/>

        <Guidance:DepthEnvelope>
            <Parallel/>
            <Setting><Guidance:DepthEnvelope.minDepth/><Units:meter/><Value>5</Value></Setting>
            <Setting><Guidance:DepthEnvelope.maxDepth/><Units:meter/><Value>30</Value></Setting>
        </Guidance:DepthEnvelope>

        <Guidance:YoYo>
            <Parallel/>
        </Guidance:YoYo>

        <Guidance:SetSpeed>
            <Parallel/>
            <Setting><Guidance:SetSpeed.speed/><Units:meter_per_second/><Value>1</Value></Setting>
        </Guidance:SetSpeed>

        <Guidance:Waypoint Id="Waypoint">
            <Sequence/>
            <Setting><Guidance:Waypoint.latitude/><Units:degree/><Value>36.75</Value></Setting>
            <Setting><Guidance:Waypoint.longitude/><Units:degree/><Value>-121.88</Value></Setting>
        </Guidance:Waypoint>

    </Aggregate>

</Mission>
