mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
0d103b456c
commit
c89cfcccbe
3 changed files with 11 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
- Warn in case of isobaric counter diffusion
|
||||
- Warn in case of isobaric counter diffusion if N2 increas is more than
|
||||
20% of He decrease.
|
||||
- Desktop: Automatically sync with cloud when going online
|
||||
- Small UI fixes
|
||||
- Fix bug when using remembered BT/BLE addresses in dive computer download
|
||||
|
|
|
@ -1184,7 +1184,7 @@ bool isobaric_counterdiffusion(struct gasmix *oldgasmix, struct gasmix *newgasmi
|
|||
{
|
||||
results->dN2 = get_he(oldgasmix) + get_o2(oldgasmix) - get_he(newgasmix) - get_o2(newgasmix);
|
||||
results->dHe = get_he(newgasmix) - get_he(oldgasmix);
|
||||
return get_he(oldgasmix) && results->dN2 > 0 && 5 * results->dN2 > -results->dHe;
|
||||
return get_he(oldgasmix) > 0 && results->dN2 > 0 && results->dHe < 0 && get_he(oldgasmix) && results->dN2 > 0 && 5 * results->dN2 > -results->dHe;
|
||||
}
|
||||
|
||||
/* some events should never be thrown away */
|
||||
|
|
|
@ -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")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue