summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveeventitem.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2018-01-20 21:39:38 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2018-01-21 15:24:46 +0100
commitc89cfcccbe8700af13554465e4e09b424aa1be00 (patch)
tree306cf8227d9549d80695352faec8d2d1cb02bd66 /profile-widget/diveeventitem.cpp
parent0d103b456c88b4ecfee2526ec9634ed06966d4ed (diff)
downloadsubsurface-c89cfcccbe8700af13554465e4e09b424aa1be00.tar.gz
Only give ICD warning if pN2 increases
as otherwise there are warning on the descent. The ICD line in the info box is generated for all gas switches with decreasing He content. Also change the presentation in the info box to align it with the notes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'profile-widget/diveeventitem.cpp')
-rw-r--r--profile-widget/diveeventitem.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index e904bbefc..5a5ba15b5 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -166,6 +166,7 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
int type = internalEvent->type;
if (event_is_gaschange(internalEvent)) {
+ struct icd_data icd_data;
struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent);
name += ": ";
name += gasname(mix);
@@ -173,9 +174,13 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
/* Do we have an explicit cylinder index? Show it. */
if (internalEvent->gas.index >= 0)
name += tr(" (cyl. %1)").arg(internalEvent->gas.index + 1);
- icd_data icd_data;
- if (isobaric_counterdiffusion(lastgasmix, mix, &icd_data))
- name += tr("\nICD ΔN2/ΔHe=%1/%2=%3%").arg(icd_data.dN2 / 10).arg(-icd_data.dHe / 10).arg((-100 * icd_data.dN2 / icd_data.dHe));
+ 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);
+ }
*lastgasmix = *mix;
} else if (value) {
if (type == SAMPLE_EVENT_PO2 && same_string(internalEvent->name, "SP change")) {