summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar willem ferguson <willemferguson@zoology.up.ac.za>2014-11-01 06:06:34 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-01 22:13:47 -0700
commit6cf3787a0ed150fd7cd996d6ae54e9ed9eab7af5 (patch)
treece0f94294ea511f46e100f586e1860c60c617fd8 /dive.c
parentc9b4562a450586d15cd1d27c2f03d9c4bceb6b08 (diff)
downloadsubsurface-6cf3787a0ed150fd7cd996d6ae54e9ed9eab7af5.tar.gz
Remove code that zeroes out duplicate oxygen sensor and temperature values
Remove the code that changes all duplicate oxygen sensor, setpoint and temperature values from a dive log to zero. One of the motivations is that a zero setpoint value indicates an Open Circuit dive segment, not Closed Circuit Rebreather. The code in dive.c is removed and the comments for the corresponding restoration code that restores the last known values into sensor or temperature with zero values is [fill_o2_values() in profile.c] is changed to apply to the present situation. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/dive.c b/dive.c
index 9e2918183..5bcdf3aa8 100644
--- a/dive.c
+++ b/dive.c
@@ -1098,15 +1098,14 @@ static void fixup_dc_events(struct divecomputer *dc)
static void fixup_dive_dc(struct dive *dive, struct divecomputer *dc)
{
- int i, j, o2val;
+ int i, j;
double depthtime = 0;
int lasttime = 0;
int lastindex = -1;
int maxdepth = dc->maxdepth.mm;
int mintemp = 0;
int lastdepth = 0;
- int lasto2val[3] = { 0, 0, 0 };
- int lasttemp = 0, lastpressure = 0, lastdiluentpressure = 0;
+ int lastpressure = 0, lastdiluentpressure = 0;
int pressure_delta[MAX_CYLINDERS] = { INT_MAX, };
int first_cylinder;
@@ -1164,31 +1163,10 @@ static void fixup_dive_dc(struct dive *dive, struct divecomputer *dc)
fixup_pressure(dive, sample);
if (temp) {
- /*
- * If we have consecutive identical
- * temperature readings, throw away
- * the redundant ones.
- */
- if (lasttemp == temp)
- sample->temperature.mkelvin = 0;
- else
- lasttemp = temp;
-
if (!mintemp || temp < mintemp)
mintemp = temp;
}
- // If there are consecutive identical O2 sensor readings, throw away the redundant ones.
- for (j = 0; j < dc->no_o2sensors; j++) { // for CCR oxygen sensor data:
- o2val = sample->o2sensor[j].mbar;
- if (o2val) {
- if (lasto2val[j] == o2val)
- sample->o2sensor[j].mbar = 0;
- else
- lasto2val[j] = o2val;
- }
- }
-
update_min_max_temperatures(dive, sample->temperature);
depthtime += (time - lasttime) * (lastdepth + depth) / 2;