Add setpoint events according to divetype

When changing to a CCR dive, add a setpoint change to the default setpoint
at the beginning of the dive. Otherwise add an explicit setpoint change to 0
.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-01-08 14:42:07 +01:00 committed by Dirk Hohndel
parent a478eb5711
commit 0f7f2195d5
3 changed files with 11 additions and 6 deletions

6
dive.c
View file

@ -888,8 +888,10 @@ void update_setpoint_events(struct divecomputer *dc)
}
ev = get_next_event(ev->next, "SP change");
}
if (!changed)
add_event(dc, 0, SAMPLE_EVENT_PO2, 0, new_setpoint, "SP change");
if (!changed) {
if (!add_event(dc, 0, SAMPLE_EVENT_PO2, 0, new_setpoint, "SP change"))
printf("Could not add setpoint change event\n");
}
}
void sanitize_gasmix(struct gasmix *mix)