mavlink/qgroundcontrol — pull request #991 by DonLakeFlyer (2014-11-24 05:09:30+00:00)
Title: New mavlink logging support

This is the initial implementation as described in Issue #979.

The changes are as follows:

Logging:
- Creation of new File Save location. This is the default location for mavlink logs and saved parameter files.
Flight Data Log in main settings. The default root is QStandardPaths::DocumentsLocation. Mavlink logs are stored in the 'FlightData' subdirectory. Save 'parameters' in the SavedParameters subdirectory. You can change the root directory from Settings.
- In the UI, mavlink logs are referred to as Flight Data to make them more user friendly. The file extension for the log files is still '.mavlink'
- Mavlink logging is now always on and being written to a temp file.
- A log file begins when the first connection is created and ends when the last connection is disconnected. This differs from the current implementation where the log file spans from QGC boot to shutdown.
- There is a new settings 'Prompt to save Flight Data log after each flight' on the General tab of Settings. The mavlink log setting on the Mavlink tab has been removed. This was moved to General to give it higher prominence in the ui. The default for this setting is on. If this is on, the user is prompted to save the log when the log file closes.
- At boot orphaned temp log files (due to crashes) are looked for and if found the user is prompted to save or remove.

Replay:
- Check to disallow replay while connections are active is made before the user is prompted for filename selection.
- LinkManager/LinkInterface architecture modified to add support for suspending the user being allowed to make a new connection. See commit for details. This allows Replay to disable connecting while a log is being replayed.
- Replay no longer affects the global log file saving setting.

General:
- Fixed a bunch of bugs in Logging and Replay along the way.
- Renamed QGCCore->QGCApplication and QGCSettingsWidget->SettingsDialog to better reflect usage.
- Added new qgcApp method to access QGCApplication object. Similary to qt qApp implementation.
- Restructured MainWindow construct sequence to maintain an understanding of when the splash screen was visible. This was needed because there can be boot sequence ordering which causes the MainWindow slots which show message boxes which happen while the splash screen is up. In this cases the splash screen must be hidden otherwise those message boxes show up behind the splash screen.

Remaining To Do:
- Need to add the 'Last chance' log save checkbox to status bar. This allows you to save a log file even if the global setting is off.
- Add no temp log creation command line parameter. This can be useful for development where you connect/disconnect many times over.
- Fix destroyed signal problem discovered during this work as described in Issue #990
- Need to write a Unit test for this. The log/replay paths are quite quirky and prone to bugs. A decent unit test would be very helpful here.

The commits contain detailed information as well.