mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: work around water temperature bug in Tecdiving DiveComputer.eu
It appears to send a first sample with a water temperature of 0 C. If the next sample contains a more likely water temperature, overwrite the first one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
514edfec07
commit
acc4dc57af
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
- core: work around bug in TecDiving dive computer reporting spurious 0 deg C water temperature in first sample
|
||||||
- core: correctly parse DC_FIELD_SALINITY response; fixes incorrect water type with some dive computers, including the Mares Smart
|
- core: correctly parse DC_FIELD_SALINITY response; fixes incorrect water type with some dive computers, including the Mares Smart
|
||||||
- Desktop: Allow more than one media file to be imported from web
|
- Desktop: Allow more than one media file to be imported from web
|
||||||
- undo: Clear undo stack when the current file is closed
|
- undo: Clear undo stack when the current file is closed
|
||||||
|
|
|
@ -831,6 +831,14 @@ static int dive_cb(const unsigned char *data, unsigned int size,
|
||||||
dive->dc.sample[0].temperature.mkelvin = 0;
|
dive->dc.sample[0].temperature.mkelvin = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* special case for bug in Tecdiving DiveComputer.eu
|
||||||
|
* often the first sample has a water temperature of 0C, followed by the correct
|
||||||
|
* temperature in the next sample */
|
||||||
|
if (same_string(dive->dc.model, "Tecdiving DiveComputer.eu") &&
|
||||||
|
dive->dc.sample[0].temperature.mkelvin == ZERO_C_IN_MKELVIN &&
|
||||||
|
dive->dc.sample[1].temperature.mkelvin > dive->dc.sample[0].temperature.mkelvin)
|
||||||
|
dive->dc.sample[0].temperature.mkelvin = dive->dc.sample[1].temperature.mkelvin;
|
||||||
|
|
||||||
record_dive_to_table(dive, devdata->download_table);
|
record_dive_to_table(dive, devdata->download_table);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue