diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-07-09 23:12:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-09 14:22:48 -0700 |
commit | f940ebcf74a7a398fb991796c56b831fa39959d1 (patch) | |
tree | b43cd5c7e945804eda2ca4b134a513b965fb220d /qt-ui | |
parent | c1d63f32d60212a60fe633ef1c3a77d23da2760d (diff) | |
download | subsurface-f940ebcf74a7a398fb991796c56b831fa39959d1.tar.gz |
Add quirk for Seabear CSV settings
The Seabear software stores its settings as two csv-rows in the same
file as its samples. These settings got read as two bogus samples in the
beginning of the dive.
This kills those off and repairs the temperature damage they done.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelogimportdialog.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 27bb26b4a..f9452e85d 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -100,6 +100,18 @@ void DiveLogImportDialog::on_buttonBox_accepted() sample->ndl.seconds *= 60; sample->tts.seconds *= 60; } + + /* And the two first samples are "settings" from there software */ + memcpy(dive->dc.sample, dive->dc.sample + 2, sizeof(dive->dc.sample) * dive->dc.samples - 2); + dive->dc.samples -= 2; + memset(dive->dc.sample + dive->dc.samples, 0, sizeof(dive->dc.sample) * 2); + + /* And fix dammanged temperature from the initial samples */ + dive->mintemp.mkelvin = 0; + dive->maxtemp.mkelvin = 0; + dive->watertemp.mkelvin = 0; + dive->dc.watertemp.mkelvin = 0; + fixup_dive(dive); } process_dives(true, false); |