Fix the salt water conversion.

The dive computer records the raw absolute pressure. To convert this
pressure value into a depth, we need to divide by the salinity factor,
not multiply!
This commit is contained in:
Jef Driesen 2015-11-09 20:42:13 +01:00
parent 4552558e87
commit 842c4ca466

View File

@ -721,7 +721,7 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi
*((unsigned int *) value) = array_uint16_le (data + table->divetime) * 60;
break;
case DC_FIELD_MAXDEPTH:
*((double *) value) = array_uint16_le (data + table->maxdepth) / 100.0 * salinity;
*((double *) value) = array_uint16_le (data + table->maxdepth) / 100.0 / salinity;
break;
case DC_FIELD_GASMIX_COUNT:
*((unsigned int *) value) = parser->ngasmixes;
@ -1164,7 +1164,7 @@ uwatec_smart_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
}
if (have_depth) {
sample.depth = (depth - depth_calibration) * salinity;
sample.depth = (depth - depth_calibration) / salinity;
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
}