summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/divelogimportdialog.cpp6
-rw-r--r--xslt/csv2xml.xslt11
2 files changed, 15 insertions, 2 deletions
diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp
index 7675e94c2..d7922907b 100644
--- a/desktop-widgets/divelogimportdialog.cpp
+++ b/desktop-widgets/divelogimportdialog.cpp
@@ -71,7 +71,7 @@ ColumnNameProvider::ColumnNameProvider(QObject *parent) : QAbstractListModel(par
tr("O₂") << tr("He") << tr("Sample time") << tr("Sample depth") << tr("Sample temperature") << tr("Sample pO₂") << tr("Sample CNS") << tr("Sample NDL") <<
tr("Sample TTS") << tr("Sample stopdepth") << tr("Sample pressure") <<
tr("Sample sensor1 pO₂") << tr("Sample sensor2 pO₂") << tr("Sample sensor3 pO₂") <<
- tr("Sample setpoint") << tr("Visibility") << tr("Rating");
+ tr("Sample setpoint") << tr("Visibility") << tr("Rating") << tr("Sample heartrate");
}
bool ColumnNameProvider::insertRows(int row, int, const QModelIndex&)
@@ -832,6 +832,8 @@ int DiveLogImportDialog::setup_csv_params(QStringList r, char **params, int pnr)
params[pnr++] = intdup(r.indexOf(tr("Sample stopdepth")));
params[pnr++] = strdup("pressureField");
params[pnr++] = intdup(r.indexOf(tr("Sample pressure")));
+ params[pnr++] = strdup("heartBeat");
+ params[pnr++] = intdup(r.indexOf(tr("Sample heartrate")));
params[pnr++] = strdup("setpointField");
params[pnr++] = intdup(r.indexOf(tr("Sample setpoint")));
params[pnr++] = strdup("visibilityField");
@@ -994,7 +996,7 @@ void DiveLogImportDialog::on_buttonBox_accepted()
parse_manual_file(qPrintable(fileNames[i]), params, pnr - 1, &table, &trips, &sites);
} else {
- char *params[51];
+ char *params[53];
int pnr = 0;
QRegExp apdRe("^.*[/\\][0-9a-zA-Z]*_([0-9]{6})_([0-9]{6})\\.apd");
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index d823e0ff9..a5818b159 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -35,6 +35,7 @@
<xsl:param name="meanDepth" select="meanDepth"/>
<xsl:param name="airTemp" select="airTemp"/>
<xsl:param name="waterTemp" select="waterTemp"/>
+ <xsl:param name="heartBeat" select="heartBeat"/>
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
@@ -545,6 +546,16 @@
</xsl:attribute>
</xsl:if>
</xsl:if>
+
+ <xsl:if test="$heartBeat >= 0">
+ <xsl:attribute name="heartbeat">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$heartBeat"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+
</sample>
</xsl:if>
</xsl:template>