summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--planner.c3
-rw-r--r--profile.c12
2 files changed, 10 insertions, 5 deletions
diff --git a/planner.c b/planner.c
index dd86d184a..580426bf7 100644
--- a/planner.c
+++ b/planner.c
@@ -218,9 +218,10 @@ struct dive *create_dive_from_plan(struct diveplan *diveplan)
he = oldhe;
}
+ /* Check for SetPoint change */
if (oldpo2 != po2) {
if (lasttime)
- add_event(dc, lasttime, 20, 0, po2/1000, "SP change"); // SAMPLE_EVENT_PO2
+ add_event(dc, lasttime, 20, 0, po2, "SP change"); // SAMPLE_EVENT_PO2
oldpo2 = po2;
}
diff --git a/profile.c b/profile.c
index 6f2e64664..4b863fa01 100644
--- a/profile.c
+++ b/profile.c
@@ -391,19 +391,23 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st
unsigned int he = event->value >> 16;
unsigned int o2 = event->value & 0xffff;
if (he) {
- snprintf(buffer, sizeof(buffer), "%s: (%u/%u)",
+ snprintf(buffer, sizeof(buffer), "%s:%u/%u",
_(event->name), o2, he);
} else {
if (o2 == 21)
- snprintf(buffer, sizeof(buffer), "%s: %s",
+ snprintf(buffer, sizeof(buffer), "%s:%s",
_(event->name), _("air"));
else
- snprintf(buffer, sizeof(buffer), "%s: %u%% %s",
+ snprintf(buffer, sizeof(buffer), "%s:%u%% %s",
_(event->name), o2, "O" UTF8_SUBSCRIPT_2);
}
+ } else if (event->name && !strcmp(event->name, "SP change")) {
+ snprintf(buffer, sizeof(buffer), "%s:%0.1f", _(event->name), (double) event->value / 1000);
} else {
- snprintf(buffer, sizeof(buffer), "%s: %d", _(event->name), event->value);
+ snprintf(buffer, sizeof(buffer), "%s:%d", _(event->name), event->value);
}
+ } else if (event->name && !strcmp(event->name, "SP change")) {
+ snprintf(buffer, sizeof(buffer), "Bailing out to OC");
} else {
snprintf(buffer, sizeof(buffer), "%s%s", _(event->name),
event->flags == SAMPLE_FLAGS_BEGIN ? " begin" :