<?xml version="1.0" encoding="UTF-8"?>
<xidml Version="2.4.2" xmlns:mml="http://www.w3.org/1998/Math/MathML">
  <Documentation>
    <CreatedBy>Joseph Bloggs</CreatedBy>
    <CreatedDate>2004-10-14</CreatedDate>
    <ShortDescription> Building complex algorithms from simple ones</ShortDescription>
    <LongDescription>
      This example illustrates a parameter type, parameter definition and
      algorithm definition for a math module capable of running multiple algorithms.
      One parameter (MyMachNo) measures speed in Mach numbers.
      One parameter (MyKnots) measures speed in knots.
      A third parameter i(MyMph) s the difference between them in mph.
    </LongDescription>
    <LastUpdated>2008-6-25</LastUpdated>
  </Documentation>
  <Parameters>
    <ParameterTypeSet>
      <ParameterType Name="My_Machs">
        <!-- meters/s = Mach x 343 @ 1 std. ATM-->
        <BaseUnit>MetersPerSecond</BaseUnit>
        <Scale>343</Scale>
        <RangeMaximum>4</RangeMaximum>
        <RangeMinimum>0</RangeMinimum>
      </ParameterType>
      <ParameterType Name="My_Knots">
        <!-- meters/s = Knots x 0.51444444 -->
        <BaseUnit>MetersPerSecond</BaseUnit>
        <Scale>0.51444444</Scale>
        <RangeMaximum>2048</RangeMaximum>
        <RangeMinimum>0</RangeMinimum>
      </ParameterType>
      <ParameterType Name="My_Mph">
        <!-- meters/s = Miles/Hr x 0.44704-->
        <BaseUnit>MetersPerSecond</BaseUnit>
        <Scale>0.44704</Scale>
        <RangeMaximum>100</RangeMaximum>
      </ParameterType>
    </ParameterTypeSet>
    <ParameterSet>
      <Parameter Name="MyMachNo">
        <ParameterProperties>
          <ParameterTypeReference>My_Machs</ParameterTypeReference>
        </ParameterProperties>
        <Source>
          <Signal>
            <InstrumentReference>MyVelocityMeter</InstrumentReference>
            <VendorMap>Channel1</VendorMap>
          </Signal>
        </Source>
        <Destination>
          <Algorithm>
            <InstrumentReference>MyMathModule</InstrumentReference>
            <AlgorithmReference>MyAverageOver200</AlgorithmReference>
            <ParameterMap>Input1</ParameterMap>
          </Algorithm>
        </Destination>
      </Parameter>
      <Parameter Name="MyAverageMach">
        <ParameterProperties>
          <ParameterTypeReference>My_Machs</ParameterTypeReference>
        </ParameterProperties>
        <Source>
          <Algorithm>
            <InstrumentReference>MyMathModule</InstrumentReference>
            <AlgorithmReference>MyAverageOver200</AlgorithmReference>
            <ParameterMap>Output1</ParameterMap>
          </Algorithm>
        </Source>
        <Destination>
          <Algorithm>
            <InstrumentReference>MyMathModule</InstrumentReference>
            <AlgorithmReference>MyDifference</AlgorithmReference>
            <ParameterMap>MyIn1</ParameterMap>
          </Algorithm>
        </Destination>
      </Parameter>
      <Parameter Name="MyKnots">
        <ParameterProperties>
          <ParameterTypeReference>My_Knots</ParameterTypeReference>
        </ParameterProperties>
        <Source>
          <Signal>
            <InstrumentReference>MyVelocityMeter</InstrumentReference>
            <VendorMap>Channel2</VendorMap>
          </Signal>
        </Source>
        <Destination>
          <Algorithm>
            <InstrumentReference>MyMathModule </InstrumentReference>
            <AlgorithmReference>MyAverageOver200</AlgorithmReference>
            <ParameterMap>Input1</ParameterMap>
          </Algorithm>
        </Destination>
      </Parameter>
      <Parameter Name="MyAverageKnots">
        <ParameterProperties>
          <ParameterTypeReference>My_Knots</ParameterTypeReference>
        </ParameterProperties>
        <Source>
          <Algorithm>
            <InstrumentReference>MyMathModule</InstrumentReference>
            <AlgorithmReference>MyAverageOver200</AlgorithmReference>
            <ParameterMap>Output1</ParameterMap>
          </Algorithm>
        </Source>
        <Destination>
          <Algorithm>
            <InstrumentReference>MyMathModule</InstrumentReference>
            <AlgorithmReference>MyDifference</AlgorithmReference>
            <ParameterMap>MyIn2</ParameterMap>
          </Algorithm>
        </Destination>
      </Parameter>
      <Parameter Name="MyMph">
        <ParameterProperties>
          <ParameterTypeReference>My_Mph</ParameterTypeReference>
        </ParameterProperties>
        <Source>
          <Algorithm>
            <InstrumentReference>MyMathModule</InstrumentReference>
            <AlgorithmReference>My_Differnce</AlgorithmReference>
            <ParameterMap>Output2</ParameterMap>
          </Algorithm>
        </Source>
      </Parameter>
    </ParameterSet>
  </Parameters>
  <Instrumentation>
    <InstrumentSet>
      <X-Instrument Name="MyMathModule">
        <Manufacturer>
          <Name>MathRUS</Name>
        </Manufacturer>
      </X-Instrument>
    </InstrumentSet>
  </Instrumentation>
  <Algorithms>
    <AlgorithmSet>
      <X-NSamplesInOneSampleOut-Average-1.0 Name="MyAverageOver200">
        <Input Name="Input1"/>
        <Output Name="Ouput1"/>
        <NumberOfSamples>200</NumberOfSamples>
      </X-NSamplesInOneSampleOut-Average-1.0>
      <X-MathML-1.0 Name="MyDifference">
        <Input Name="MyIn1"/>
        <Input Name="MyIn2"/>
        <Output Name="Output2"/>
        <mml:math>
          <mml:apply>
            <mml:cn>In1</mml:cn>
            <mml:cn>In2</mml:cn>
          </mml:apply>
        </mml:math>
      </X-MathML-1.0>
    </AlgorithmSet>
  </Algorithms>
</xidml>
