Property tree: Difference between revisions

Fixed broken dump properties command, rewrite for easier understanding
(Added section on Dumping the Property Tree - Changed Section Name "Protocols to access the property tree" to "Network Protocols to access the property tree")
(Fixed broken dump properties command, rewrite for easier understanding)
Line 83: Line 83:
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.
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
To enter the command interactively, select Nasal Console from the Debug menu and enter the command:
<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(getprop("/sim/fg-home") ~ "/PropTree.xml", "/");</code>


<code>io.write_properties( path: "/home/myName/.fgfs/Export/PropTree.xml", prop: "/" );</code>
This will dump the entire property tree, in a file containing more than 50,000 lines
 
We can also dump only part of the property tree. For example, to dump everything in /instrumentation/kma20, we would use this:
 
<code>io.write_properties(getprop("/sim/fg-home") ~ "/PropTree.xml", "/instrumentation/kma20");</code>


In addition to debugging, there are other good reasons for doing a dump of portions of the property tree.
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]]
* [[Howto:Create_animation_XML_files_from_Nasal|Creating Animation XML files]]
* [[State Overlay System || Creating State Overlays for Aircraft]]
* [[State Overlay System|Creating State Overlays for Aircraft]]


== Reference documentation to the property tree ==
== Reference documentation to the property tree ==
1,396

edits