<?xml version="1.0"?>

<system name="armament">

  <property value="0">systems/armament/release</property>

  <channel name="Armament">

     <!-- release station 1 -->
     <switch name="systems/armament/station1/released">
          <default value="systems/armament/station1/released"/>
          <test logic="AND" value="1">
                systems/armament/release == 1
                systems/armament/station1/selected == 1
          </test>
          <output>systems/armament/station1/released</output>
     </switch>

     <!-- release station 2 -->
     <switch name="systems/armament/station2/released">
          <default value="systems/armament/station2/released"/>
          <test logic="AND" value="1">
                systems/armament/release == 1
                systems/armament/station2/selected == 1
          </test>
          <output>systems/armament/station2/released</output>
     </switch>

     <!-- release station 3 -->
     <switch name="systems/armament/station3/released">
          <default value="systems/armament/station3/released"/>
          <test logic="AND" value="1">
                systems/armament/release == 1
                systems/armament/station3/selected == 1
          </test>
          <output>systems/armament/station3/released</output>
     </switch>

     <!-- release station 4 -->
     <switch name="systems/armament/station4/released">
          <default value="systems/armament/station4/released"/>
          <test logic="AND" value="1">
                systems/armament/release == 1
                systems/armament/station4/selected == 1
          </test>
          <output>systems/armament/station4/released</output>
     </switch>

     <!-- release station 5 -->
     <switch name="systems/armament/station5/released">
          <default value="systems/armament/station5/released"/>
          <test logic="AND" value="1">
                systems/armament/release == 1
                systems/armament/station5/selected == 1
          </test>
          <output>systems/armament/station5/released</output>
     </switch>

  </channel>

  <channel name="Weight-loss">

     <!-- station 1 -->
     <switch name="systems/armament/station1/weight-control">
          <default value="inertia/pointmass-weight-lbs[0]"/>
          <test value="0">
                systems/armament/station1/released == 1
          </test>
          <output>inertia/pointmass-weight-lbs[0]</output>
     </switch>

     <!-- station 2 -->
     <switch name="systems/armament/station2/weight-control">
          <default value="inertia/pointmass-weight-lbs[1]"/>
          <test value="0">
                systems/armament/station2/released == 1
          </test>
          <output>inertia/pointmass-weight-lbs[1]</output>
     </switch>

     <!-- station 3 -->
     <switch name="systems/armament/station3/weight-control">
          <default value="inertia/pointmass-weight-lbs[2]"/>
          <test value="0">
                systems/armament/station3/released == 1
          </test>
          <output>inertia/pointmass-weight-lbs[2]</output>
     </switch>

     <!-- station 4 -->
     <switch name="systems/armament/station4/weight-control">
          <default value="inertia/pointmass-weight-lbs[3]"/>
          <test value="0">
                systems/armament/station4/released == 1
          </test>
          <output>inertia/pointmass-weight-lbs[3]</output>
     </switch>

     <!-- station 5 -->
     <switch name="systems/armament/station5/weight-control">
          <default value="inertia/pointmass-weight-lbs[4]"/>
          <test value="0">
                systems/armament/station5/released == 1
          </test>
          <output>inertia/pointmass-weight-lbs[4]</output>
     </switch>

  </channel>

  <channel name="Fuel-loss">

     <!-- station 3 -->
     <switch name="systems/armament/station3/fuel-level-control">
          <default value="propulsion/tank[1]/contents-lbs"/>
          <test value="0">
                systems/armament/station3/released == 1
          </test>
          <output>propulsion/tank[1]/contents-lbs</output>
     </switch>

  </channel>


</system>
