]> git.tdb.fi Git - ext/subsurface.git/blobdiff - parse-xml.c
Add various dive fixups, and show pressure (if any) in the plot
[ext/subsurface.git] / parse-xml.c
index 3a84e296321d06b1453f86c2d868f78ff5b4cc8e..e6ace216fb7c17336f3f4e9456dc259ba5d55469 100644 (file)
@@ -29,7 +29,7 @@ static void record_dive(struct dive *dive)
                dive_table.dives = dives;
                dive_table.allocated = allocated;
        }
-       dives[nr] = dive;
+       dives[nr] = fixup_dive(dive);
        dive_table.nr = nr+1;
 }
 
@@ -787,19 +787,6 @@ static void sample_end(void)
        if (!dive)
                return;
 
-       if (sample->time.seconds > dive->duration.seconds) {
-               if (sample->depth.mm)
-                       dive->duration = sample->time;
-       }
-
-       if (sample->depth.mm > dive->maxdepth.mm)
-               dive->maxdepth.mm = sample->depth.mm;
-
-       if (sample->temperature.mkelvin) {
-               if (!dive->watertemp.mkelvin || dive->watertemp.mkelvin > sample->temperature.mkelvin)
-                       dive->watertemp = sample->temperature;
-       }
-
        sample = NULL;
        dive->samples++;
 }