diff options
author | Robert C. Helling <helling@atdotde.de> | 2018-05-17 22:01:12 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2018-05-28 09:57:00 +0200 |
commit | 2c53eef50eaab5d9228ef095e10d7832cb3b7514 (patch) | |
tree | 182ee0d26da5f199032decfc029da6699c9c05f7 /core/planner.c | |
parent | fb09784060a10ef181e20d8e3adc3d7b1c55041e (diff) | |
download | subsurface-2c53eef50eaab5d9228ef095e10d7832cb3b7514.tar.gz |
Planner: Don't store a setpoint unless we are in CCR mode
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/planner.c')
-rw-r--r-- | core/planner.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/planner.c b/core/planner.c index 842a86ebf..2b58a2440 100644 --- a/core/planner.c +++ b/core/planner.c @@ -323,7 +323,8 @@ static void create_dive_from_plan(struct diveplan *diveplan, struct dive *dive, /* this is a bad idea - we should get a different SAMPLE_EVENT type * reserved for this in libdivecomputer... overloading SMAPLE_EVENT_PO2 * with a different meaning will only cause confusion elsewhere in the code */ - add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, QT_TRANSLATE_NOOP("gettextFromC", "SP change")); + if (dp->divemode == type) + add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, QT_TRANSLATE_NOOP("gettextFromC", "SP change")); oldpo2 = po2; } @@ -420,7 +421,7 @@ void add_to_end_of_diveplan(struct diveplan *diveplan, struct divedatapoint *dp) struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration, int depth, int cylinderid, int po2, bool entered, enum divemode_t divemode) { - struct divedatapoint *dp = create_dp(duration, depth, cylinderid, po2); + struct divedatapoint *dp = create_dp(duration, depth, cylinderid, divemode == CCR ? po2 : 0); dp->entered = entered; dp->divemode = divemode; add_to_end_of_diveplan(diveplan, dp); |