From ffb441aa84a0867e275dd212a480a336b3547f89 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 9 Jul 2014 22:13:39 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/divelogimportdialog.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3-70-g09d2