Log time-stamper add-on

From FlightGear wiki
Jump to navigation Jump to search
Log time-stamper add-on
Started in 6 August 2024
Contributor(s) Johan G
Status Under development
Website https://gitlab.com/JohanG/log-time-stamper

The log time-stamper add-on will print time-stamps to the console and log, which can be useful when comparing timings of events with other resources.

Features

FlightGear v. 2020.3.18 prints times-stamps each on line of the console output and log, but only with elapsed time of the FlightGear session.

This add-on prints timestamps to the console at configurable intervals. As of early August 2024 it can print:

  • Simulated UTC time
  • Real local time
  • Real UTC time (with some known issues)

Additionally the add-on prints changes in

  • Simulation rate, how fast the simulation is running.
  • Time warp, if the time of day is running at at a different speed than the simulation rate.
  • If FlightGear is paused or unpaused.
  • If the Time Setter add-on by Colin[1] is enabled or disabled. It synchronizes the simulated time with real time, optionally with a number of hours offset.

Timestamps are printed in ISO 8601 / RFC 3339 format, in essence YYYY-MM-DD"T"HH:MM:SS("Z"|("+"|"-")hh:mm:ss).

Exposed properties

There are some properties exposed that control the behavior of the add-on. These can be configured through the addon-config.xml file, or through properties in /addons/by-id/org.flightgear.addons.log-time-stamper/config/.

Property Type Default Use
print-sim-utc-time bool True Simulated UTC time-stamps will be printed if true.
print-real-local-time bool True Real local time-stamps will be printed if true.
print-real-utc-time bool True Real UTC time-stamps will be printed if true (with some known issues).
time-stamp-interval-sec int 60 Interval in seconds between time-stamps.

Known issues

Real UTC time time-stamps

As of early August 2024 the real UTC time time-stamps ignores day rollovers, in essence if the offset and time makes it so that the UTC time would be on another day than the local real time day.

This means that days, months and years can be off by one.

The Time Setter add-on

The Time Setter add-on must be loaded before the time-stamper add-on for the time-stamper add-on to be able to print status changes of the Time Setter add-on.

This is due that to register a listener to the the relevant property, /sim/time/time-setter/enable, that property must exist. That property get initialized when the Time Setter add-on is loaded.

Notes

Related content

Wiki articles

Forum topic

Source code