Implement Seac SeacSync databaser parser.

Dives for the seac action computer are imported by the seacsync
program into two tables in an sqlite3 database.

The dive information is read from the headers_dive table.
The dive_data table is then queried for each dive to get samples.

The seac action computer is the only current supported computer
by the seacsync program. It only supports two gas mixes, so the
parser will toggle between two cylinders whenever it detects a
change in the active O2 mix.

Dive start time is stored in UTC with a timezone offset.
A helper function to read this was added to qthelper.

Default cases have been added to some switch statements
to assist in future development for other dive types and
salinity.

Example database has been added to ./dives/TestDiveSeacSync.db

Signed-off-by: James Wobser <james.wobser@gmail.com>
This commit is contained in:
James Wobser 2020-07-16 21:40:46 -04:00 committed by Miika Turkia
parent 52aa7d83b6
commit 4f3b26f9b6
11 changed files with 345 additions and 1 deletions

View file

@ -5,7 +5,6 @@
#include "core/settings/qPrefUpdateManager.h"
#include "core/subsurface-qt/divelistnotifier.h"
#include "subsurface-string.h"
#include "subsurface-string.h"
#include "gettextfromc.h"
#include "statistics.h"
#include "membuffer.h"
@ -955,6 +954,12 @@ QString get_dive_date_string(timestamp_t when)
return loc.toString(ts.toUTC(), QString(prefs.date_format) + " " + prefs.time_format);
}
// Get local seconds since Epoch from ISO formatted UTC date time + offset string
extern "C" time_t get_dive_datetime_from_isostring(char *when) {
QDateTime divetime = QDateTime::fromString(when, Qt::ISODate);
return (time_t)(divetime.toSecsSinceEpoch());
}
QString get_short_dive_date_string(timestamp_t when)
{
QDateTime ts;