diff options
author | Willem Ferguson <willemferguson@zoology.up.ac.za> | 2018-01-24 21:50:35 +0200 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-24 22:03:42 +0100 |
commit | b9ac89574ebd095f1c4760d223ccfb4dd9fba479 (patch) | |
tree | 8b4c58e0c6d5018e722201fed6ed59f1be7dc17e | |
parent | 36cfab46bd012830e17858e7b0b5a38a223bb5f8 (diff) | |
download | subsurface-b9ac89574ebd095f1c4760d223ccfb4dd9fba479.tar.gz |
Planner: print icd information at 0.1 resolution
The gas fractions (in %) are now printed at a resolution of 0.1%
and not at 0.01% as previously.
The string in the info box that provides icd data is reformatted
so that the info-box is as narrow as possible.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
-rw-r--r-- | core/plannernotes.c | 15 | ||||
-rw-r--r-- | profile-widget/diveeventitem.cpp | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c index 078604774..a678131e2 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -47,18 +47,17 @@ int add_icd_entry(char *icdbuffer, unsigned int maxsize, struct icd_data *icdval "<td rowspan=2 style= 'vertical-align:top;'>%s➙", (time_seconds + 30) / 60, translate("gettextFromC", "min"), gasname(gas_from)); len += snprintf(icdbuffer + len, maxsize - len, - "%s</td><td style='padding-left: 10px;'>%+5.2f%%</td>" - "<td style= 'padding-left: 15px; color:%s;'>%+5.2f%%</td>" - "<td style='padding-left: 15px;'>%+5.2f%%</td></tr>" + "%s</td><td style='padding-left: 10px;'>%+5.1f%%</td>" + "<td style= 'padding-left: 15px; color:%s;'>%+5.1f%%</td>" + "<td style='padding-left: 15px;'>%+5.1f%%</td></tr>" "<tr><td style='padding-left: 10px;'>%+5.2f%s</td>" "<td style='padding-left: 15px; color:%s;'>%+5.2f%s</td>" "<td style='padding-left: 15px;'>%+5.2f%s</td></tr>", gasname(gas_to), icdvalues->dHe / 10.0, - ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", icdvalues->dN2 / 10.0 , 0.2 * (-icdvalues->dHe / 10), - ambientpressure_mbar * icdvalues->dHe / 1e6, translate("gettextFromC", "bar"), ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", - ambientpressure_mbar * icdvalues->dN2 / 1e6, translate("gettextFromC", "bar"), - ambientpressure_mbar * -icdvalues->dHe / 5e6, translate("gettextFromC", "bar")); - + ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", icdvalues->dN2 / 10.0 , 0.2 * (-icdvalues->dHe / 10.0), + ambientpressure_mbar * icdvalues->dHe / 1e6f, translate("gettextFromC", "bar"), ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", + ambientpressure_mbar * icdvalues->dN2 / 1e6f, translate("gettextFromC", "bar"), + ambientpressure_mbar * -icdvalues->dHe / 5e6f, translate("gettextFromC", "bar")); return len; } diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp index c1044ecc3..f47c5839c 100644 --- a/profile-widget/diveeventitem.cpp +++ b/profile-widget/diveeventitem.cpp @@ -178,11 +178,11 @@ 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) { - put_format(&mb, "\n%s: %s=%+.3g%% %s=%+.3g%%%s%+.3g%%", + 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); + icd ? ">" : "<", lrint(-icd_data.dHe / 5.0) / 10.0); name += QString::fromUtf8(mb.buffer, mb.len); } *lastgasmix = *mix; |