Difference between revisions of "Settings"

From PaparazziUAV
Jump to navigation Jump to search
m
(key press)
Line 19: Line 19:
  </dl_setting></tt>
  </dl_setting></tt>
The image file must be located in the <tt>data/pictures/gcs_icons</tt> directory.
The image file must be located in the <tt>data/pictures/gcs_icons</tt> directory.
Key accelerators can also be specified (using the GTK syntax to specify the keysym):
<tt><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></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> ([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]).

Revision as of 15:02, 3 July 2009

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).