Property browser: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Update to 2.4.0)
(Copy-editing + Adding some of the tips mentioned in the links on the talk page)
Line 2: Line 2:
The [[FlightGear]] '''property browser''' is a dialog used to browse, in-simulator, through all properties (internal, runtime state variables in FlightGear). The property browser can be opened with / (forward slash) or through the [[menubar|menu]]: <tt>Debug > Browse Internal Properties</tt> (in older version: <tt>File > Browse Internal Properties</tt>).
The [[FlightGear]] '''property browser''' is a dialog used to browse, in-simulator, through all properties (internal, runtime state variables in FlightGear). The property browser can be opened with / (forward slash) or through the [[menubar|menu]]: <tt>Debug > Browse Internal Properties</tt> (in older version: <tt>File > Browse Internal Properties</tt>).


* To set a property to a new value, select the property, fill the new value in the form below and click the Set button. To toggle values (like true/false), click on them while holding the Ctrl key.
== Tips and tricks ==
* Holding the Shift key while pressing a property in the browser will print the property (and update it) to the topleft of the screen. The property can be removed from the screen by clicking at another property, while holding Ctrl-Shift.
Apart from setting a property by clicking it and using the text field and Set button, there is many things that can be done through the property browser:
* Clicking the square in the left top of the window will copy the property browser. The right square closes the current browser.


* To ''toggle boolean values'' (like true/false), ctrl-click a boolean property.
* To ''display a property'' in the top left corner of the screen, shift-click the property in the property bowser. To ''remove the property'' ctrl-shift-click another property.
* To ''clone the property browser window'' click the square in the ''left'' top of the window. The ''right'' square closes the current browser.
* To ''go to the root'' ctrl-click an "<tt>..</tt>" entry.
* To toggle ''verbose/developer mode'' ctrl-click an "<tt>.</tt>" entry.
== Verbose mode ==
In verbose mode, toggled by ctrl-clicking an "<tt>.</tt>" entry or toggling <code>/sim/gui/dialogs/property-browser/show-flags</code>, some additional information is shown as flags like this
<code>foo = '123.456' (double; AT)</code>. 
{| class="wikitable" border="1" cellspacing="0"
! Flag
! Meaning
! Comment
|-
! r
| Read protected || Showing that a property can not be read.
|-
! w
| Write protected || Showing that a property can not be written to.
|-
! R
| Trace read operations || rowspan="2" | In <code>--log-level=info</code> create log line with TRACE prefix on write/read operation; set with <code><foo trace-write="y"></code>.
|-
! W
| Trace write operations
|-
! A
| Archive bit set || Makes writeProperties() also save this property in restricted mode ("save flight"), while all others are only saved in full mode.
|-
! U
| User archive bit set || Saved into ~/.fgfs/autosave.xml, and restored next time. <!-- When FlightGear starts? -->
|-
! T
| Tied property || Only the C/C++ code that owns a tied property can write to it. Also, listeners will not be triggered.
|-
|}
== Other ways to open the property browser ==
=== Forcing open the browser on startup ===
You can force the browser to open on startup, through the following command:
You can force the browser to open on startup, through the following command:
  --prop:browser=/sim/path/that/you/want/to/show  
  --prop:browser=/sim/path/that/you/want/to/show
 
More than one property browser can be opened like this.
--prop:browser=position --prop:browser[1]=orientation
 
=== Trough nasal ===
Using <code>gui.property_browser(<path>)</code> opens a property browser for path.  While it can be called more than once, though all the dialogues will be drawn on top of each other in the centre of the screen. Example:


The property browser is a very powerful tool when working in FlightGear, it has several very advanced and useful features that are not yet covered here which may however be useful during debugging sessions (there's for example support to trace properties and inspect registered listeners) .
<syntaxhighlight lang="php">
So, for debugging or development purposes in general, you may want to refer to this article's "[http://wiki.flightgear.org/index.php/Talk:Property_browser discussion]" page, where we are collecting additional resources about the property browser, please do feel free to add new links or integrate existing ones into this article!
settimer(func {
    gui.property_browser("/position");
    gui.property_browser("/orientation");
}, 0);
</syntaxhighlight>


== Related content ==
== Related content ==

Revision as of 21:06, 8 September 2012

The property browser window

The FlightGear property browser is a dialog used to browse, in-simulator, through all properties (internal, runtime state variables in FlightGear). The property browser can be opened with / (forward slash) or through the menu: Debug > Browse Internal Properties (in older version: File > Browse Internal Properties).

Tips and tricks

Apart from setting a property by clicking it and using the text field and Set button, there is many things that can be done through the property browser:

  • To toggle boolean values (like true/false), ctrl-click a boolean property.
  • To display a property in the top left corner of the screen, shift-click the property in the property bowser. To remove the property ctrl-shift-click another property.
  • To clone the property browser window click the square in the left top of the window. The right square closes the current browser.
  • To go to the root ctrl-click an ".." entry.
  • To toggle verbose/developer mode ctrl-click an "." entry.

Verbose mode

In verbose mode, toggled by ctrl-clicking an "." entry or toggling /sim/gui/dialogs/property-browser/show-flags, some additional information is shown as flags like this

foo = '123.456' (double; AT).  
Flag Meaning Comment
r Read protected Showing that a property can not be read.
w Write protected Showing that a property can not be written to.
R Trace read operations In --log-level=info create log line with TRACE prefix on write/read operation; set with <foo trace-write="y">.
W Trace write operations
A Archive bit set Makes writeProperties() also save this property in restricted mode ("save flight"), while all others are only saved in full mode.
U User archive bit set Saved into ~/.fgfs/autosave.xml, and restored next time.
T Tied property Only the C/C++ code that owns a tied property can write to it. Also, listeners will not be triggered.

Other ways to open the property browser

Forcing open the browser on startup

You can force the browser to open on startup, through the following command:

--prop:browser=/sim/path/that/you/want/to/show

More than one property browser can be opened like this.

--prop:browser=position --prop:browser[1]=orientation

Trough nasal

Using gui.property_browser(<path>) opens a property browser for path. While it can be called more than once, though all the dialogues will be drawn on top of each other in the centre of the screen. Example:

settimer(func {
    gui.property_browser("/position");
    gui.property_browser("/orientation");
}, 0);

Related content