X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=dive.c;h=f4bf497a7da0edeafb91b5a26b1de067f87d64b7;hb=d0e27c6c533005b5fd161286f68f1325bdabe8e3;hp=a420a3ef638927cd39c60ffe69f5fa37a9bbfea3;hpb=19621bf481c68955184c11dd407c59af4a05130e;p=ext%2Fsubsurface.git diff --git a/dive.c b/dive.c index a420a3e..f4bf497 100644 --- a/dive.c +++ b/dive.c @@ -473,7 +473,12 @@ struct dive *fixup_dive(struct dive *dive) } } if (end < 0) + { + /* Assume an ascent/descent rate of 9 m/min */ + int asc_desc_time = dive->maxdepth.mm*60/9000; + dive->meandepth.mm = dive->maxdepth.mm*(dive->duration.seconds-asc_desc_time)/dive->duration.seconds; return dive; + } update_duration(&dive->duration, end - start); if (start != end) @@ -486,6 +491,7 @@ struct dive *fixup_dive(struct dive *dive) add_people(dive->buddy); add_people(dive->divemaster); add_location(dive->location); + add_suit(dive->suit); for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = dive->cylinder + i; add_cylinder_description(&cyl->type); @@ -703,6 +709,7 @@ struct dive *try_to_merge(struct dive *a, struct dive *b) MERGE_TXT(res, a, b, buddy); MERGE_TXT(res, a, b, divemaster); MERGE_MAX(res, a, b, rating); + MERGE_TXT(res, a, b, suit); MERGE_MAX(res, a, b, number); MERGE_MAX(res, a, b, maxdepth.mm); res->meandepth.mm = 0;