<?xml version="1.0" encoding="UTF-8"?>
<model version="6.0.0" links="0">
 <framework name="qpcpp"/>
 <package name="AOs" stereotype="0x02">
  <class name="CPF" superclass="qpcpp::QActive">
   <statechart properties="0x00">
    <initial target="../1">
     <action brief="BSP::init();&#10;&#9;StateMachine::initSM();&#10;&#9;StateMachine::runSM();"/>
     <initial_glyph conn="26,8,5,0,22,6">
      <action box="0,-2,17,14"/>
     </initial_glyph>
    </initial>
    <state name="InitPlatform">
     <entry>stdStateEntry
thisStateEntry

enum Actions : uint8_t
{
        readConfigFile = 0,
        readMissionFile,
        initCTD1,
        initBcyEngine,
        initGPS1,
        initIModem1,
        initFLBB1,
        initOptode1,
        initPTH1,
        initMSC1,
        initOCR1,
        runInitPlatformTests,
        runWakeupTests,
        setBellows = surfaceOps
        handleErrors
        lastAction
}</entry>
     <exit>lastAction
timeout
error</exit>
     <tran trig="lastAction">
      <choice target="../../../2">
       <guard brief="profileNum == 0"/>
       <choice_glyph conn="65,24,5,3,15">
        <action box="1,-2,14,3"/>
       </choice_glyph>
      </choice>
      <choice target="../../../4">
       <choice_glyph conn="65,24,4,3,28,15">
        <action box="1,0,10,2"/>
       </choice_glyph>
      </choice>
      <tran_glyph conn="55,24,1,-1,10">
       <action box="0,-2,10,2"/>
      </tran_glyph>
     </tran>
     <tran trig="timeout/error" target="..">
      <action>
handleErrors</action>
      <tran_glyph conn="55,57,1,1,11,4,-11">
       <action box="0,-2,15,6"/>
      </tran_glyph>
     </tran>
     <state_glyph node="22,14,33,52">
      <entry box="1,2,31,41"/>
      <exit box="1,43,12,8"/>
     </state_glyph>
    </state>
    <state name="Recovery">
     <tran trig="Got Go">
      <choice target="../../../3">
       <guard brief="profileNum == 0"/>
       <choice_glyph conn="122,29,4,3,-1,-44,5,2">
        <action box="-13,-3,15,2"/>
       </choice_glyph>
      </choice>
      <choice target="../../../4">
       <choice_glyph conn="122,29,4,3,15,-44,6,2">
        <action box="1,0,10,2"/>
       </choice_glyph>
      </choice>
      <tran_glyph conn="108,18,1,-1,14,11">
       <action box="0,-2,11,2"/>
      </tran_glyph>
     </tran>
     <state_glyph node="80,14,28,12"/>
    </state>
    <state name="preMissionDelay">
     <tran trig="Delay Over" target="../../4">
      <tran_glyph conn="100,34,1,3,4,10,-26,6,2">
       <action box="0,-2,10,2"/>
      </tran_glyph>
     </tran>
     <state_glyph node="80,30,20,12"/>
    </state>
    <state name="Submerge">
     <tran trig="Depth&gt;0.4m" target="../../5">
      <tran_glyph conn="100,50,1,3,12,8,-34,6,2">
       <action box="1,-2,10,2"/>
      </tran_glyph>
     </tran>
     <state_glyph node="80,46,20,10"/>
    </state>
    <state name="Descend">
     <entry>stdStateEntry
thisStateEntry

Actions
{
    idle
    runPlatformVelocityControl
    startSampleAcq
    setGlideMode
    handleErrors
}

x/
timeout
error</entry>
     <tran trig="Past Sample Depth" target="..">
      <action>
StartSampleAcq</action>
      <tran_glyph conn="102,64,1,1,16,4,-16">
       <action box="0,-2,16,6"/>
      </tran_glyph>
     </tran>
     <tran trig="Past Park Depth" target="../../7">
      <tran_glyph conn="102,84,1,3,25,-66,15">
       <action box="0,-2,17,2"/>
      </tran_glyph>
     </tran>
     <tran trig="Anchored?" target="../../6">
      <tran_glyph conn="102,88,1,3,28,-30,12">
       <action box="1,-2,11,2"/>
      </tran_glyph>
     </tran>
     <tran trig=" OK to Glide">
      <choice target="../..">
       <guard brief="yes"/>
       <action brief="GlideModeOn"/>
       <choice_glyph conn="116,72,5,1,9,4,-23">
        <action box="-9,2,17,2"/>
       </choice_glyph>
      </choice>
      <choice target="../..">
       <guard brief="no"/>
       <action brief="GlideModeOff"/>
       <choice_glyph conn="116,72,5,1,9,8,-23">
        <action box="-9,6,14,15"/>
       </choice_glyph>
      </choice>
      <tran_glyph conn="102,72,1,-1,14">
       <action box="0,-2,15,10"/>
      </tran_glyph>
     </tran>
     <state_glyph node="80,60,22,32">
      <entry box="1,2,21,27"/>
     </state_glyph>
    </state>
    <state name="Anchor">
     <entry>stdStateEntry
thisStateEntry

Actions
{
    idle
    startSampleAcq
    startCPMode
    deAnchor
    handleErrors
}

x/
    timeout
    error</entry>
     <tran trig="Sample Time Expired" target="..">
      <action>
StartSampleAcq</action>
      <tran_glyph conn="163,58,1,1,17,4,-17">
       <action box="0,-2,16,7"/>
      </tran_glyph>
     </tran>
     <tran trig="AnchorTimeExpired" target="..">
      <action>
StartCPMode</action>
      <tran_glyph conn="163,66,1,1,18,4,-18">
       <action box="2,-2,30,20"/>
      </tran_glyph>
     </tran>
     <tran trig="non-scheduled liftoff" target="../../5">
      <tran_glyph conn="163,86,1,3,13,8,-100,-25,4">
       <action box="0,-2,23,2"/>
      </tran_glyph>
     </tran>
     <tran trig="Deanchored" target="../../8">
      <tran_glyph conn="163,82,1,3,17,16,-102,6,2">
       <action box="0,-2,10,2"/>
      </tran_glyph>
     </tran>
     <tran trig="ParkTimeExpired" target="..">
      <action>
StartCPMode</action>
      <tran_glyph conn="163,74,1,1,17,4,-17">
       <action box="0,-2,17,6"/>
      </tran_glyph>
     </tran>
     <state_glyph node="142,54,21,34">
      <entry box="1,2,18,30"/>
     </state_glyph>
    </state>
    <state name="Park">
     <entry>stdStateEntry
thisStateEntry

Actions
{
    idle
    startSampleAcq
    runParkDepthControl
    startCPMode
    handleErrors
}

x/
    timeout
    error</entry>
     <tran trig="Sample Time Expired" target="..">
      <action>
StartSampleAcq</action>
      <tran_glyph conn="162,18,1,1,17,4,-17">
       <action box="0,-2,16,7"/>
      </tran_glyph>
     </tran>
     <tran trig="ParkTimeExpired" target="..">
      <action>
StartCPMode</action>
      <tran_glyph conn="162,26,1,1,18,4,-18">
       <action box="1,-2,30,20"/>
      </tran_glyph>
     </tran>
     <tran trig="Depth out of band" target="..">
      <action>
runParkDepthControl</action>
      <tran_glyph conn="162,34,1,1,18,4,-18">
       <action box="2,-2,30,20"/>
      </tran_glyph>
     </tran>
     <tran trig="CPModeStarted" target="../../8">
      <tran_glyph conn="162,42,1,3,10,10,-37,44,-61,10,6">
       <action box="0,-2,12,3"/>
      </tran_glyph>
     </tran>
     <tran trig="CriticalError" target="../../2">
      <tran_glyph conn="162,46,1,3,9,4,-36,-38,-57,6,2">
       <action box="0,-2,12,2"/>
      </tran_glyph>
     </tran>
     <state_glyph node="142,14,20,34">
      <entry box="1,2,18,30"/>
     </state_glyph>
    </state>
    <state name="Ascend">
     <entry>stdStateEntry
thisStateEntry

Actions
{
    idle
    runPlatformVelocityControl
    startSampleAcq
    setGlideMode
    handleErrors
}

x/
timeout
error</entry>
     <tran trig="Past Sample Depth" target="..">
      <action>
StartSampleAcq</action>
      <tran_glyph conn="102,104,1,0,16,4,-16">
       <action box="0,-2,16,6"/>
      </tran_glyph>
     </tran>
     <tran trig="atSurface" target="../../9">
      <tran_glyph conn="102,124,1,3,10,12,-88,-54,7">
       <action box="0,-2,17,2"/>
      </tran_glyph>
     </tran>
     <tran trig=" OK to Glide">
      <choice target="../..">
       <guard brief="yes"/>
       <action brief="GlideModeOn"/>
       <choice_glyph conn="116,112,5,1,4,4,-18">
        <action box="-12,2,17,2"/>
       </choice_glyph>
      </choice>
      <choice target="../..">
       <guard brief="no"/>
       <action brief="GlideModeOff"/>
       <choice_glyph conn="116,112,5,1,4,8,-18">
        <action box="-12,6,15,2"/>
       </choice_glyph>
      </choice>
      <tran_glyph conn="102,112,1,-1,14">
       <action box="0,-2,15,10"/>
      </tran_glyph>
     </tran>
     <state_glyph node="80,100,22,32">
      <entry box="1,2,21,27"/>
     </state_glyph>
    </state>
    <state name="SurfaceOps">
     <entry>stdStateEntry
thisStateEntry

Actions
{
    getCPData
    setBellows(surfaceOps)    
    getPosition
    startSurfaceAcq
    downloadCommandsSBD
    sendStatusSBD
    sendFilesIridium
    handleErrors
    lastAction
}

x/
    timeout
    error</entry>
     <tran trig="Timeout" target="../../4">
      <tran_glyph conn="58,108,1,3,12,-54,10">
       <action box="2,-2,13,5"/>
      </tran_glyph>
     </tran>
     <tran trig="lastAction" target="../../4">
      <tran_glyph conn="58,112,1,3,12,-58,10">
       <action box="0,-2,23,2"/>
      </tran_glyph>
     </tran>
     <state_glyph node="31,78,27,38">
      <entry box="1,2,24,34"/>
     </state_glyph>
    </state>
    <state_diagram size="197,210"/>
   </statechart>
  </class>
 </package>
</model>
