XML Layout of tool/task interface


Example of typical tool structure

<tool name="mytool" module="mymodule">

<code>
<include>myproj/mymodule/mytool_forward.h</include>
<private>
#include &lt;myproj/mymodule/mtool_private.h&gt;
</private>
</code>

<shortdescription> 
</shortdescription>
<description>
<description>

<!Methods now follow>

<method type="function" name="mymethod">
     <shortdescription>
     </shortdescription>
     <description>
     </description>
     <output>
        <param></param>
        ......
     </output>
     <inout>
        <param></param>
        ......
     </inout>
     <input>
          <param  type="" name="">
                <description></description>
                <value></value>
          </param>
          .....
      </input>
      <returns></returns>
      <example>
      </example>
</method>
....
</tool>

Notes:

Parameter blocks are repeated as necessary inside input, output, and inout blocks. Method blocks are repeated as necessary inside the tool block. For a task, replace tool with task, and leave out the method block.

You may return tools, but not include them in the input, output, or inout blocks.

parameter types are bool, int, double, complex, string, boolArray, doubleArray, intArray, complexArray, stringArray, or any. If you specify the any type, you must then add an tag inside the param block. types, can be record or variant. The record type keyword-value pairs, the variant type is used for arguments with unknown types.

Examples of setting Parameters in XML

An example setting a record default

     <param xsi:type="any"  name="height">
     <any type="record"/>
     <defaultrecord>
           <value name="amp" xsi:type="double">1.0</value>
     </defaultrecord>
     <description>amplitude of Gaussian, or 3 numeric values</description>
     </param>

Example setting  a single value

     <param xsi:type="double" direction="in" name="center">
     <description>center of Gaussian</description>
     <value>0</value>
     </param>

Example setting a "Quantity"

     <param xsi:type="double" name="mstart" units="m/s">
     <description>Start velocity (e.g. '20Km/s')</description>
     <value>0.0</value>
     </param>
   
Example setting an array with one value.

     <param xsi:type="intArray" name="start">
     <description>Start channels (0-relative)</description>
     <value>0</value>
     </param>

Example of an empty array

          <param xsi:type="intArray" name="spwid">
     <description>Spectral Window Ids (0 relative) to select</description>
     <value type="vector"></value>
     </param>

Example setting a vector with more than one value

     <param xsi:type="intArray" name="quack">
     <description>Flag VLA quacks -- scan interval and quack length, in seconds</description>
     <value type="vector">
     <value>0</value>
     <value>0</value> </value>
     </param>


Example setting a complex array

     <param xsi:type="complexArray" name="flux">
     <description>The flux value.
     A vector with four real or complex numbers</description>
     <value type="vector">
             <value type="struct"><value name="re">1.0</value><value name="im">0.0</value></value>
             <value type="struct"><value name="re">0.0</value><value name="im">0.0</value></value>
             <value type="struct"><value name="re">0.0</value><value name="im">0.0</value></value>
             <value type="struct"><value name="re">0.0</value><value name="im">0.0</value></value>
     </value>            
     </param>

Example of a multiple choice, note default is last option.
    
     <param xsi:type="string" name="polarization">
     <description>The polarization of the value field.
     ``Stokes'', ``linear'' or ``circular''</description>
     <value>Circular</value>
     <value>Linear</value>
     <value>Stokes</value>
     </param>

-- WesYoung - 03 Nov 2006
Topic revision: r1 - 2006-11-03, WesYoung
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback