========== Parameters ========== Skills, scripts, monitors, even the application, everything is a parameter. By inheriting from other parameters and including sub-parameters inside them, everything is able to be represented. Defined at file ``models/parameters.xml`` in package **pitasc_library**. **General structure** --------------------- Chain of prototype based inheritance. *base* is the basic parameter prototype, which contains the meta data *description* and *visibility*. .. code-block:: any_parameter --> base --> descriptive All parameters are inheriting from 'base'. Basic parameters contain the following attributes inside the ```` tag. .. list-table:: Attributes inside ```` tag :widths: auto :header-rows: 1 * - Attribute - Description * - id - Needs to be locally unique to allow identification, If not unique, a incrementing element e.g., "_no0", "_no1", "_no2", ... will be added * - data_type - Data type of the parameter, can't be changed once set * - prototype - The base type the parameter "inherits" from, e.g. "string_parameter". | Basic parameters contain the following parameters inside the ```` tag by default. .. list-table:: Members inside ```` tag :widths: auto :header-rows: 1 * - description - Description of the parameter * - visibility - Visibility of the parameter (one of: required, basic, expert, hidden) | The xml definition of a parameter basically looks like the following: .. code-block:: xml {Choose meaningful description} {Choose enum} {data depending on parameter type} For example, this is the definition of a frame parameter (from the pitasc library): .. code-block:: xml A frame (coordinate system) The blacklist restriction with a space defines that the value of the parameter must not be empty. See below for more information on restrictions. **data_type vs prototype** -------------------------------- *data_type* describes the actual representation of the data of the parameter. It can only be one of the following: - int - bool - float - string - csv:int, csv:bool, csv:float, csv:string - dict - list:{parameter type} ({parameter type can be any pitasc parameter type, e.g. list:frame) - parameter (this is basically saying "don't know yet, will be defined in inherting parameters") - parameter:{parameter type} ({parameter type can be any pitasc parameter type, e.g. parameter:monitor) *prototype* needs to be an existing pitasc parameter type, defined with ```` tag. .. code-block:: xml ... x, y, z, a, b, c **Lists & Naming** ------------------ | **Naming** | In lists, it can happen that two elements would get the same name (id). Consider the following example: .. code-block:: xml In this case, pitasc changes the id of the skills such that they are unique. The assigned ids of the skills are then .. code-block:: xml | **Replacing** | Currently, it is not possible to remove entries from a list by using xml syntax. So, if a prototype adds something to a list, e.g. a controller to `controllers`, and you want to add your own controller, you need to re-define the whole skill to have only your controller in its ``controller`` members (below ``tasks.tracking``). .. note:: See also :doc:`../how-to/advanced/How_to_add_a_parameter_to_a_skill_monitor_etc`