Settings

From PaparazziUAV
Revision as of 15:02, 3 July 2009 by HectoPascal (talk | contribs) (key press)
Jump to navigation Jump to search

The grammar of the setting file is described in conf/settings/settings.dtd. 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.

Key accelerators can also be specified (using the GTK syntax to specify the keysym):

<dl_setting MAX="200" MIN="-200" STEP="10" VAR="nav_radius" module="nav" handler="SetNavRadius">
 <key_press key="greater" value="1"/>
 <key_press key="less" value="-1"/>
 <key_press key="F10" value="100"/>
</dl_setting>

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