mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c1d63f32d6
commit
f940ebcf74
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue