+ /* if all the samples for a cylinder have pressure data that
+ * is basically equidistant throw out the sample cylinder pressure
+ * information but make sure we still have a valid start and end
+ * pressure
+ * this happens when DivingLog decides to linearalize the
+ * pressure between beginning and end and for strange reasons
+ * decides to put that in the sample data as if it came from
+ * the dive computer; we don't want that (we'll visualize with
+ * constant SAC rate instead)
+ * WARNING WARNING - I have only seen this in single tank dives
+ * --- maybe I should try to create a multi tank dive and see what
+ * --- divinglog does there - but the code right now is only tested
+ * --- for the single tank case */
+ for (j = 0; j < MAX_CYLINDERS; j++) {
+ if (abs(pressure_delta[j]) != INT_MAX) {
+ cylinder_t *cyl = dive->cylinder + j;
+ for (i = 0; i < dive->samples; i++)
+ if (dive->sample[i].cylinderindex == j)
+ dive->sample[i].cylinderpressure.mbar = 0;
+ if (! cyl->start.mbar)
+ cyl->start.mbar = cyl->sample_start.mbar;
+ if (! cyl->end.mbar)
+ cyl->end.mbar = cyl->sample_end.mbar;
+ cyl->sample_start.mbar = 0;
+ cyl->sample_end.mbar = 0;
+ }
+ }