Add dive: don't throw away the pressure data entered

Previously we were trying to get rid of the tracked gas pressures that
were added when using the plan infrastructure to create a dive. Now that
this isn't the case anymore we can stop doing that which magically makes
setting start and end pressure while adding a dive work as expected.

Fixes #582
Fixes #553

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-04 11:44:58 -07:00
parent cc86d68c86
commit aafd918169

View file

@ -749,18 +749,6 @@ void MainTab::acceptChanges()
find_new_trip_start_time(current_dive->divetrip);
}
if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
// clean up the dive data (get duration, depth information from samples)
// remove the pressures from the samples (as those prevent the user from
// being able to manually set the start and end pressure)
struct sample *sample = current_dc->sample;
for (int i = 0; i < current_dc->samples; i++, sample++)
sample->cylinderpressure.mbar = 0;
for (int i = 0; i < MAX_CYLINDERS; i++) {
cylinder_t *cyl = &current_dive->cylinder[i];
cyl->start.mbar = cyl->sample_start.mbar;
cyl->end.mbar = cyl->sample_end.mbar;
cyl->sample_end.mbar = cyl->sample_start.mbar = 0;
}
fixup_dive(current_dive);
if (dive_table.nr == 1)
current_dive->number = 1;