Property tree: Difference between revisions

Jump to navigation Jump to search
Added section on Dumping the Property Tree - Changed Section Name "Protocols to access the property tree" to "Network Protocols to access the property tree"
(Switch to {{fg src file}} to fix the broken Gitorious link.)
(Added section on Dumping the Property Tree - Changed Section Name "Protocols to access the property tree" to "Network Protocols to access the property tree")
Line 57: Line 57:


So they can come from many places, thus there's no single source file where you'll find ALL properties/types. You will need to look at the corresponding subsystem/component. $FG_SRC/Network is the right pace to look for hardcoded protocols, make sure to also understand their inheritance (the interface being implemented).
So they can come from many places, thus there's no single source file where you'll find ALL properties/types. You will need to look at the corresponding subsystem/component. $FG_SRC/Network is the right pace to look for hardcoded protocols, make sure to also understand their inheritance (the interface being implemented).


== XML and property lists ==
== XML and property lists ==
Line 63: Line 64:
PropertyList-encoded XML files are mapped to a/the property tree - typically, such XML files are not manually processed, they are "transparently" processed by FlightGear, loaded and mapped into a Property Tree.
PropertyList-encoded XML files are mapped to a/the property tree - typically, such XML files are not manually processed, they are "transparently" processed by FlightGear, loaded and mapped into a Property Tree.


== Protocols to access the property tree ==
== Network Protocols to access the property tree ==
In addition to the protocols supported by the FlightGear I/O subsystem, other interfaces are provided by a built-in [[Property Tree/Web Server]] and a built-in [[Telnet usage|Telnet server]], which allow property tree data to be read and modified via these interfaces, in essence using a telnet client or a conventional web browser, at run time.
In addition to the protocols supported by the FlightGear I/O subsystem, other interfaces are provided by a built-in [[Property Tree/Web Server]] and a built-in [[Telnet usage|Telnet server]], which allow property tree data to be read and modified via these interfaces, in essence using a telnet client or a conventional web browser, at run time.


Line 77: Line 78:
=== Protocol options ===
=== Protocol options ===
Usually the "best" way depends on your specific circumstances.  Will the two applications be running on the same machine?  If not, do the two machines have a high speed network connection or some slow radio modem type connection?  How much data are you sending and at what rate?  Do you need really tight timing or can you get by with some delays and sloppiness in the communication?
Usually the "best" way depends on your specific circumstances.  Will the two applications be running on the same machine?  If not, do the two machines have a high speed network connection or some slow radio modem type connection?  How much data are you sending and at what rate?  Do you need really tight timing or can you get by with some delays and sloppiness in the communication?
==Dumping the Property Tree to an XML File==
Nasal command "io.write_properties" is used to dump all or part of the property tree to an xml file.  The command can be entered interactively while using the simulator or as part of a script.
To enter the command interactively, select Nasal Console from the Debug menu and enter the command, replacing "myName" with your login directory, and replacing "/" with the path to a set of properties you want to dump. for example
<code>io.write_properties( path: "/home/myName/.fgfs/Export/PropTree.xml", prop: "/instrumentation/kma20" );</code>
You can dump the entire property tree. This will create a large file with more than 50,000 lines.
<code>io.write_properties( path: "/home/myName/.fgfs/Export/PropTree.xml", prop: "/" );</code>
In addition to debugging, there are other good reasons for doing a dump of portions of the property tree.
* [[Howto:Create_animation_XML_files_from_Nasal| Creating Animation XML files]]
* [[State Overlay System || Creating State Overlays for Aircraft]]


== Reference documentation to the property tree ==
== Reference documentation to the property tree ==
936

edits

Navigation menu