Changeset 8a8315d in subsurface


Ignore:
Timestamp:
Feb 3, 2017, 7:41:35 AM (8 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
67de8f3
Parents:
08c4281
git-author:
Robert Helling <helling@…> (02/03/17 07:31:30)
git-committer:
Dirk Hohndel <dirk@…> (02/03/17 07:41:35)
Message:

Correct "When merging planned dives keep all cylinders"

When merging a real dive with a planned dive (for comparison),
we should not try to be clever in merging similar cylinders,
rather keep the union of both cylinder sets as the two versions
of the dive might differ in exctly which gas and how much of it
was used.

Increase MAX_CYLINDERS to 20 to make room for this. We warn if we
exceed this number.

[Dirk Hohndel: I had mistakenly pushed out an earlier version of this

commit, so this fixes things up to the final version]

Signed-off-by: Robert C. Helling <helling@…>
Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/dive.c

    r08c4281 r8a8315d  
    20622062                        ++j;
    20632063                }
    2064                 while (j < MAX_CYLINDERS)
     2064                bool warn = false;
     2065                while (j < MAX_CYLINDERS) {
     2066                        if (is_cylinder_used(b, j))
     2067                                warn = true;
    20652068                        mapping[j++] = 0;
     2069                }
     2070                if (warn) {
     2071                        report_error("Could not merge all cylinders as number exceeds %d", MAX_CYLINDERS);
     2072                }
    20662073                cylinder_renumber(b, mapping);
    20672074        }
Note: See TracChangeset for help on using the changeset viewer.