mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
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>
This commit is contained in:
parent
6cd0928487
commit
ffb441aa84
1 changed files with 11 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue