Remove the temperature and pressure samples.
With the new temperature and pressure field, artificially injecting the temperature and pressure info from the header into the samples is no longer necessary. Applications will typically expect a real temperature or pressure profile, and not a few discrete points. The two surface samples (with zero depth) at the begin and end of the dive are kept for now, to support events that occur at the surface.
This commit is contained in:
parent
7278a70afe
commit
106abe2dba
@ -282,13 +282,6 @@ suunto_eon_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c
|
||||
sample.time = 0;
|
||||
if (callback) callback (DC_SAMPLE_TIME, sample, userdata);
|
||||
|
||||
// Tank Pressure (2 bar)
|
||||
if (!parser->nitrox) {
|
||||
sample.pressure.tank = 0;
|
||||
sample.pressure.value = data[5] * 2;
|
||||
if (callback) callback (DC_SAMPLE_PRESSURE, sample, userdata);
|
||||
}
|
||||
|
||||
// Depth (0 ft)
|
||||
sample.depth = 0;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
@ -313,15 +306,6 @@ suunto_eon_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c
|
||||
// Delta depth.
|
||||
depth += (signed char) value;
|
||||
|
||||
// Temperature at maximum depth (°C)
|
||||
if (depth == parser->maxdepth) {
|
||||
if (parser->spyder)
|
||||
sample.temperature = (signed char) data[parser->marker + 1];
|
||||
else
|
||||
sample.temperature = data[parser->marker + 1] - 40;
|
||||
if (callback) callback (DC_SAMPLE_TEMPERATURE, sample, userdata);
|
||||
}
|
||||
|
||||
// Depth (ft).
|
||||
sample.depth = depth * FEET;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
@ -364,13 +348,6 @@ suunto_eon_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c
|
||||
if (callback) callback (DC_SAMPLE_TIME, sample, userdata);
|
||||
}
|
||||
|
||||
// Tank Pressure (2 bar)
|
||||
if (!parser->nitrox) {
|
||||
sample.pressure.tank = 0;
|
||||
sample.pressure.value = data[offset + 2] * 2;
|
||||
if (callback) callback (DC_SAMPLE_PRESSURE, sample, userdata);
|
||||
}
|
||||
|
||||
// Depth (0 ft)
|
||||
sample.depth = 0;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
|
||||
@ -322,15 +322,6 @@ suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
||||
sample.time = 0;
|
||||
if (callback) callback (DC_SAMPLE_TIME, sample, userdata);
|
||||
|
||||
// Temperature (°C)
|
||||
sample.temperature = (signed char) data[8];
|
||||
if (callback) callback (DC_SAMPLE_TEMPERATURE, sample, userdata);
|
||||
|
||||
// Tank Pressure (2 bar)
|
||||
sample.pressure.tank = 0;
|
||||
sample.pressure.value = data[5] * 2;
|
||||
if (callback) callback (DC_SAMPLE_PRESSURE, sample, userdata);
|
||||
|
||||
// Depth (0 ft)
|
||||
sample.depth = 0;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
@ -355,12 +346,6 @@ suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
||||
// Delta depth.
|
||||
depth += (signed char) value;
|
||||
|
||||
// Temperature at maximum depth (°C)
|
||||
if (depth == parser->maxdepth) {
|
||||
sample.temperature = (signed char) data[parser->marker + 1];
|
||||
if (callback) callback (DC_SAMPLE_TEMPERATURE, sample, userdata);
|
||||
}
|
||||
|
||||
// Depth (ft).
|
||||
sample.depth = depth * FEET;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
@ -418,15 +403,6 @@ suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
||||
if (callback) callback (DC_SAMPLE_TIME, sample, userdata);
|
||||
}
|
||||
|
||||
// Temperature (°C)
|
||||
sample.temperature = (signed char) data[offset + 2];
|
||||
if (callback) callback (DC_SAMPLE_TEMPERATURE, sample, userdata);
|
||||
|
||||
// Tank Pressure (2 bar)
|
||||
sample.pressure.tank = 0;
|
||||
sample.pressure.value = data[offset + 3] * 2;
|
||||
if (callback) callback (DC_SAMPLE_PRESSURE, sample, userdata);
|
||||
|
||||
// Depth (0 ft)
|
||||
sample.depth = 0;
|
||||
if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user