Difference between revisions of "Settings"

From PaparazziUAV
Jump to navigation Jump to search
m (Updated some links to point at github)
Line 27: Line 27:
  </dl_setting></tt>
  </dl_setting></tt>


Some examples of settings files can be found in <tt>conf/settings</tt> ([http://cvs.savannah.nongnu.org/viewvc/paparazzi3/conf/settings/basic.xml?root=paparazzi&view=log basic.xml] and [http://cvs.savannah.nongnu.org/viewvc/paparazzi3/conf/settings/tuning.xml?root=paparazzi&view=log tuning.xml]).
Some examples of settings files can be found in <tt>conf/settings</tt> ([https://github.com/paparazzi/paparazzi/blob/master/conf/settings/rotorcraft_basic.xml rotocraft_basic.xml] and [https://github.com/paparazzi/paparazzi/blob/master/conf/settings/fixedwing_basic.xml fixedwing_basic.xml]).


[[Category:Software]] [[Category:User_Documentation]]
[[Category:Software]] [[Category:User_Documentation]]

Revision as of 04:31, 3 September 2015

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 (rotocraft_basic.xml and fixedwing_basic.xml).