mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Add best mix function to planner cylinder model
This allows calculation and selection of best mix in the planner cylinder entry, by entering the gas depth, followed by "b" for best (trimix) mix, or "bn" for best nitrox mix. The UI is not intuitive, but it is quick and easy. At the very least, it should be documented. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b61b3a8d28
commit
67dda48c88
1 changed files with 9 additions and 0 deletions
|
@ -267,6 +267,15 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
|
|||
break;
|
||||
case DEPTH:
|
||||
if (CHANGED()) {
|
||||
/* Calculate best nitrox mix for cylinder depth if input text ends with "bn",
|
||||
* or best (trimix) mix if input text ends with "b" */
|
||||
if (vString.toLower().endsWith("bn")) {
|
||||
cyl->gasmix.o2 = best_o2(string_to_depth(vString.toUtf8().data()), &displayed_dive);
|
||||
cyl->gasmix.he.permille = 0;
|
||||
} else if (vString.toLower().endsWith("b")) {
|
||||
cyl->gasmix.o2 = best_o2(string_to_depth(vString.toUtf8().data()), &displayed_dive);
|
||||
cyl->gasmix.he = best_He(string_to_depth(vString.toUtf8().data()), &displayed_dive);
|
||||
}
|
||||
cyl->depth = string_to_depth(vString.toUtf8().data());
|
||||
changed = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue