Add units and nicer formating for items in profile info box

"SP change" info format in info box: Added/changed formating and add "bar" unit.
"waypoint above ceiling" event in info box: Added formating, depth conversation to ft/m and depth unit.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-02-21 19:26:38 +01:00 committed by Dirk Hohndel
parent b39b641a05
commit 508387b1e1

View file

@ -156,6 +156,10 @@ void DiveEventItem::setupToolTipString()
} else if (value) {
if (type == SAMPLE_EVENT_PO2 && same_string(internalEvent->name, "SP change")) {
name += QString(": %1bar").arg((double)value / 1000, 0, 'f', 1);
} else if (type == SAMPLE_EVENT_CEILING && same_string(internalEvent->name, "planned waypoint above ceiling")) {
const char *depth_unit;
double depth_value = get_depth_units(value*1000, NULL, &depth_unit);
name += QString(": %1%2").arg((int) round(depth_value)).arg(depth_unit);
} else {
name += QString(": %1").arg(value);
}