aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--planner.c3
-rw-r--r--qt-ui/profile/diveeventitem.cpp6
2 files changed, 7 insertions, 2 deletions
diff --git a/planner.c b/planner.c
index c56f04639..5c0bbecbc 100644
--- a/planner.c
+++ b/planner.c
@@ -264,6 +264,9 @@ struct dive *create_dive_from_plan(struct diveplan *diveplan)
/* Check for SetPoint change */
if (oldpo2 != po2) {
if (lasttime)
+ /* 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, "SP change");
oldpo2 = po2;
}
diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp
index 2f2bec60e..873c6abbe 100644
--- a/qt-ui/profile/diveeventitem.cpp
+++ b/qt-ui/profile/diveeventitem.cpp
@@ -92,12 +92,14 @@ void DiveEventItem::setupToolTipString()
name += tr("air");
else
name += QString(tr("EAN%1")).arg(o2);
- } else if (type == SAMPLE_EVENT_PO2) {
+ } else if (type == SAMPLE_EVENT_PO2 && name == "SP change") {
name += QString(":%1").arg((double)value / 1000);
} else {
name += QString(":%1").arg(value);
}
- } else if (type == SAMPLE_EVENT_PO2) {
+ } else if (type == SAMPLE_EVENT_PO2 && name == "SP change") {
+ // this is a bad idea - we are abusing an existing event type that is supposed to
+ // warn of high or low PO2 and are turning it into a set point change event
name += "\n" + tr("Bailing out to OC");
} else {
name += internalEvent->flags == SAMPLE_FLAGS_BEGIN ? tr(" begin", "Starts with space!") :