Logging properties: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (cat: Property Tree)
(+-first section; More complete example; links to Generic protocol, readme and source code)
Line 1: Line 1:
{{Template:PropertyTree}}
{{Template:PropertyTree}}
__NOTOC__
FlightGear has the ability to produce multiple files '''logging properties'''.  Both the properties and the interval between the records are user selectable.


FlightGear has the ability to produce multiple logs, each recording the value of user-selected properties at a user-defined interval. Details are available in docs-mini/README.logging;  Here's a simple example that logs the rudder and aileron positions to steering.csv every second or so:
More than one log file can be configured in the [[PropertyList XML files|PropertyList file]] setting up what properties to log.
 
== Simple example ==
Here is a simple example that logs the rudder and aileron positions to the file <code>steering.csv</code> every second or so:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
  <logging>
  <logging>
   <log>
   <log>
   <filename>steering.csv</filename>
   <filename>steering.csv</filename>
  <enabled>true</enabled>
   <interval-ms>1000</interval-ms>
   <interval-ms>1000</interval-ms>
  <delimiter>,</delimiter>
   <entry>
   <entry>
     <title>Rudder</title>
     <title>Rudder</title>
Line 18: Line 27:
   </log>
   </log>
  </logging>
  </logging>
</PropertyList>
</syntaxhighlight>
</syntaxhighlight>
Here's some sample output:
 
Here is some sample output:


<pre>
<pre>
Line 40: Line 51:
   22097,-0.000000,-0.168000
   22097,-0.000000,-0.168000
</pre>
</pre>
== Related content ==
=== Wiki articles ===
* [[Generic protocol]] – ''Alternative and more flexible way to log or even stream data.''
=== Readme files ===
* {{Git link|gitorious|fg/fgdata|master|Docs/README.logging}}
=== Source code ===
* {{Git link|gitorious|fg/flightgear|next|src/Main/logger.hxx}}
* {{Git link|gitorious|fg/flightgear|next|src/Main/logger.cxx}}


[[Category:Property Tree]]
[[Category:Property Tree]]

Revision as of 08:46, 10 February 2015

FlightGear has the ability to produce multiple files logging properties. Both the properties and the interval between the records are user selectable.

More than one log file can be configured in the PropertyList file setting up what properties to log.

Simple example

Here is a simple example that logs the rudder and aileron positions to the file steering.csv every second or so:

<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
 <logging>
  <log>
   <filename>steering.csv</filename>
   <enabled>true</enabled>
   <interval-ms>1000</interval-ms>
   <delimiter>,</delimiter>
   <entry>
    <title>Rudder</title>
    <property>/controls/rudder</property>
   </entry>
   <entry>
    <title>Ailerons</title>
    <property>/controls/aileron</property>
   </entry>
  </log>
 </logging>
</PropertyList>

Here is some sample output:

  Time,Rudder,Ailerons
  6522,0.000000,0.000000
  7668,-0.000000,0.000000
  8702,-0.000000,0.000000
  9705,-0.000000,0.000000
  10784,-0.000000,0.000000
  11792,-0.000000,0.000000
  12808,-0.000000,-0.210000
  13826,-0.000000,-0.344000
  14881,-0.000000,-0.066000
  15901,-0.000000,-0.806000
  16943,-0.000000,-0.936000
  17965,-0.000000,-0.534000
  19013,-0.000000,-0.294000
  20044,-0.000000,0.270000
  21090,-0.000000,-1.000000
  22097,-0.000000,-0.168000

Related content

Wiki articles

  • Generic protocolAlternative and more flexible way to log or even stream data.

Readme files

Source code