Skip to content

XML node description

David Moreno Montero edited this page May 24, 2013 · 4 revisions

On the behaviours client side, there exists the need to setup the configuration of the nodes. Each node can have several parameters and depending on such parameters change the specific behaviour. For example the timeout node needs to know each how many seconds it needs to be activated.

This setup also contains several documentation bits.

For example, the timeout has this definition:

<node-description id="timeout">
	<name lang="en">Timeout</name>
	<name lang="es">Temporiz.</name>
	<description lang="en">Triggers the event every T seconds.</description>
	<description lang="es">Activa el evento cada T segundos.</description>
	<type>event</type>
	<icon src="timeout.png"/>
		
	<params>
		<param id="timeout">
			<type>float</type>
			<description lang="en">Seconds between event each event activation </description>
			<description lang="es">Cada cuantos segundos se activa el evento </description>
			<max>100</max>
			<min>0.1</min>
			<default>0.5</default>
		</param>
	</params>
</node-description>

Every node must be described into a node-description and provide an id attribute that must match the server side type name. Textual elements can be repeated and have with a lang attribute used for internationalization. These are the known attributes:

Attributes

name

The name of the attribute, as presented to the user

description

Long description as presented to the user at the help (TODO).

type

The type of node, needed to classify it, and propose the proper default drawing.

params

List of parameters on this node type, each param must have an id that matches the server implementation name, and may have a definition on how to edit it on the interface. Default type is a text line.

type

The type of the parameter, depending on the type it may have more type definitions, for example float needs to know the limits max and min.

Known types are:

  • string (default)
  • float

If your type is more complex and needs a custom interface, all interface can be modified using javascript.

description

Description of the parameter.

default

Default value of the parameter

max (only float)

Maximum value.

min (only float)

Minimum value

Clone this wiki locally