summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-07-09 22:13:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-09 13:22:06 -0700
commitffb441aa84a0867e275dd212a480a336b3547f89 (patch)
tree546ba11524d38df476d2b4ebf0bf2da01900002e
parent6cd0928487dc64238aad40b41f929bfdbc01d824 (diff)
downloadsubsurface-ffb441aa84a0867e275dd212a480a336b3547f89.tar.gz
Add quirk for Seabear CSV NDL/TTS in minutes
In the Seabear CSV the NDL and TTS fields are in minutes, not seconds as their time field. This is an ugly quirk but it gets the job done. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/divelogimportdialog.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 98dbefd55..27bb26b4a 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -11,7 +11,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
{ "APD Log Viewer", 1, 2, 16, 7, 18, -1, -1, 19, "Tab" },
{ "XP5", 1, 2, 10, -1, -1, -1, -1, -1, "Tab" },
{ "SensusCSV", 10, 11, -1, -1, -1, -1, -1, -1, "," },
- { "Seabear CSV", 1, 2, 6, -1, -1, -1, -1, 5, ";" },
+ { "Seabear CSV", 1, 2, 6, -1, -1, 3, 4, 5, ";" },
{ NULL, }
};
@@ -92,6 +92,16 @@ void DiveLogImportDialog::on_buttonBox_accepted()
VALUE_IF_CHECKED(Tags));
}
}
+ if (ui->knownImports->currentText() == QString("Seabear CSV")) {
+ /* Seabear CSV stores NDL and TTS in Minutes, not seconds */
+ struct dive *dive = dive_table.dives[dive_table.nr - 1];
+ for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) {
+ struct sample *sample = dive->dc.sample + s_nr;
+ sample->ndl.seconds *= 60;
+ sample->tts.seconds *= 60;
+ }
+ }
+
process_dives(true, false);
MainWindow::instance()->refreshDisplay();