From cef56c6290c82b882181bf7477ee96ad4fa65dcd Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 7 May 2017 14:19:58 +0300 Subject: Import dive number from Seabear CSV file Signed-off-by: Miika Turkia --- xslt/csv2xml.xslt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xslt') diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt index 960f48395..fadb5f443 100644 --- a/xslt/csv2xml.xslt +++ b/xslt/csv2xml.xslt @@ -26,6 +26,7 @@ + @@ -111,6 +112,12 @@ + + + + + + -- cgit v1.2.3-70-g09d2 From 6e1c00078dc440ca96745315455b731ca3a5fa09 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 7 May 2017 15:34:27 +0300 Subject: Add dive mode support for Seabear import Signed-off-by: Miika Turkia --- core/qthelper.cpp | 16 +++++++++++++++- xslt/csv2xml.xslt | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'xslt') diff --git a/core/qthelper.cpp b/core/qthelper.cpp index cbfbd2f72..41c9d310b 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1545,13 +1545,27 @@ int parse_seabear_header(const char *filename, char **params, int pnr) } /* - * Note that we scan over the "Log interval" on purpose + * Grab the sample interval */ while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { if (parseLine.contains("//Log interval: ")) { params[pnr++] = strdup("delta"); params[pnr++] = strdup(parseLine.remove(QString::fromLatin1("//Log interval: ")).trimmed().remove(QString::fromLatin1(" s")).toUtf8().data()); + break; + } + } + + /* + * Dive mode, can be: OC, APNEA, BOTTOM TIMER, CCR, CCR SENSORBOARD + * Note that we scan over the "Log interval" on purpose + */ + + while ((parseLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) { + QString needle = "//Mode: "; + if (parseLine.contains(needle)) { + params[pnr++] = strdup("diveMode"); + params[pnr++] = strdup(parseLine.replace(needle, QString::fromLatin1("")).prepend("\"").append("\"").toUtf8().data()); } } diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt index fadb5f443..efe7c37ef 100644 --- a/xslt/csv2xml.xslt +++ b/xslt/csv2xml.xslt @@ -27,6 +27,7 @@ + @@ -144,6 +145,23 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.3-70-g09d2