Profile info box ICD: Change format of ICD string

Change the format from (example!)
ICD: ΔHe=-34% ΔN₂=3%<3%
to
ICD: ΔHe=-34% ΔN₂=+3%<+2.8%

Change strings given to translation to less complex ones.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2018-01-21 14:58:00 +01:00 committed by Robert C. Helling
parent c89cfcccbe
commit d5cb30efac

View file

@ -7,6 +7,7 @@
#include "core/profile.h"
#include "core/gettextfromc.h"
#include "core/metrics.h"
#include "core/membuffer.h"
extern struct ev_select *ev_namelist;
extern int evn_used;
@ -168,6 +169,7 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
if (event_is_gaschange(internalEvent)) {
struct icd_data icd_data;
struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent);
struct membuffer mb = {};
name += ": ";
name += gasname(mix);
@ -176,10 +178,12 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
name += tr(" (cyl. %1)").arg(internalEvent->gas.index + 1);
bool icd = isobaric_counterdiffusion(lastgasmix, mix, &icd_data);
if (icd_data.dHe < 0) {
if (icd)
name += tr("\nICD: ΔHe=%1% ΔN₂=%2%>%3%").arg(icd_data.dHe / 10).arg(icd_data.dN2 / 10).arg(-icd_data.dHe / 50);
else
name += tr("\nICD: ΔHe=%1% ΔN₂=%2%<%3%").arg(icd_data.dHe / 10).arg(icd_data.dN2 / 10).arg(-icd_data.dHe / 50);
put_format(&mb, "\n%s: %s=%+.3g%% %s=%+.3g%%%s%+.3g%%",
tr("ICD").toUtf8().constData(),
tr("ΔHe").toUtf8().constData(), icd_data.dHe / 10.0,
tr("ΔN₂").toUtf8().constData(), icd_data.dN2 / 10.0,
icd ? ">" : "<", -icd_data.dHe / 50.0);
name += QString::fromUtf8(mb.buffer, mb.len);
}
*lastgasmix = *mix;
} else if (value) {