From 106abe2dba7d5050fa97d16afc14cfec607a95a4 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 3 May 2015 20:35:48 +0200 Subject: [PATCH] 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. --- src/suunto_eon_parser.c | 23 ----------------------- src/suunto_vyper_parser.c | 24 ------------------------ 2 files changed, 47 deletions(-) diff --git a/src/suunto_eon_parser.c b/src/suunto_eon_parser.c index ad21b94..a803801 100644 --- a/src/suunto_eon_parser.c +++ b/src/suunto_eon_parser.c @@ -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); diff --git a/src/suunto_vyper_parser.c b/src/suunto_vyper_parser.c index dafcf16..946dcaf 100644 --- a/src/suunto_vyper_parser.c +++ b/src/suunto_vyper_parser.c @@ -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);