Settings

From PaparazziUAV
Revision as of 14:31, 6 November 2007 by HectoPascal (talk | contribs) (how to write a settings file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The grammar of the setting file is described in conf/settings/settings. It is a tree of named variables. Each variable is associated with a min, max and step attributes. These attributes are used to build the graphical interface of the settings page in the GCS. A simple entry looks like

<dl_setting MAX="2" MIN="0" STEP="1" VAR="pprz_mode">

More attributes may be added:

  • shortname="s" : s will replace the variable name for the label in the GCS
  • module="m" : It specifies the file where the variable is coming from. A corresponding #include "m.h" will be generated in the corresponding C code.
  • handler="h" : Specifies a macro to be called to do the setting. Associated with a module m the macro actually must be named m_h()

Buttons, packed in the strip in the GCS, may be associated to variables. They are described as strip children elements of a dl_setting element.

<dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="v_ctl_auto_throttle_cruise_throttle" shortname="cruise throttle" module="fw_v_ctl" handler="SetCruiseThrottle">
 <strip_button name="Dash" value="1"/>
 <strip_button name="Loiter" value="0.1"/>
 <strip_button name="Cruise" value="0"/>
</dl_setting>

For a prettier strip, an icon can be used for a strip button:

<dl_setting MAX="200" MIN="-200" STEP="10" VAR="nav_radius" module="nav" handler="SetNavRadius">
 <strip_button icon="circle-right.png" name="Circle right" value="1"/>        
 <strip_button icon="circle-left.png" name="Circle left" value="-1"/>        
</dl_setting>

The image file must be located in the data/pictures/gcs_icons directory.

Some examples of settings files can be found in conf/settings (basic.xml and tuning.xml).