<?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 = 20         # mission's min depth
maxDepth = 25         # mission's max depth
vehMaxDepth = 0       # vehicle's max depth
depthDelta = 6        # infections can occur with delta of min/max depth
reachedDepth = False
data = slate.read("depth")[0]
for i in range(len(data)):
  depth = abs(float(data[i].data))
  if depth > vehMaxDepth:
    vehMaxDepth = depth
  if depth >= minDepth:
    reachedDepth = True
    passed = True
  if reachedDepth == True and \
     depth < minDepth - (depthDelta / 2) and \
     depth > maxDepth + (depthDelta / 2):
    print("%g < %g - (%g / 2) and %g > %g + (%g / 2)" % (depth, minDepth, depthDelta, depth, maxDepth, depthDelta) )
    passed = False
if not reachedDepth:
  print("Never reached minimum depth of %g. Max depth was %g\n" % (minDepth, vehMaxDepth) )
TEST_CODE_END
-->

    <Timeout Duration="P1H"/>

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

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

    <Aggregate Id="TestAggregate">

        <Sequence/>

        <Timeout Duration="P30M30S"></Timeout>

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

        <Guidance:Point>
            <Parallel/>
            <Setting><Guidance:Point.heading/><Units:degree/><Value>-135</Value></Setting>
        </Guidance:Point>

        <Guidance:DepthEnvelope>
            <Parallel/>
            <Setting><Guidance:DepthEnvelope.minDepth/><Units:meter/><Value>20</Value></Setting>
            <Setting><Guidance:DepthEnvelope.maxDepth/><Units:meter/><Value>25</Value></Setting>
        </Guidance:DepthEnvelope>

    </Aggregate>

</Mission>
