Print the SAC values from preferences into the diveplan.
These are the values used for calculation of gas consumption.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Print the ATM pressure and the altitude used for calculation into the resulting diveplan.
Moved this info together with the deco model info below the runtime table.
There is one drawback in this implementation: Altitude will be recalculated from surface pressure and therefore may differ slightly from altitude entered in the UI.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When merging a real dive with a planned dive (for comparison),
we should not try to be clever in merging similar cylinders,
rather keep the union of both cylinder sets as the two versions
of the dive might differ in exctly which gas and how much of it
was used.
Increase MAX_CYLINDERS to 20 to make room for this.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
When Suunto Vytecs are used in gauge mode they don't record gasmixes.
If a tank pressure sensor is present they nevertheless record the
pressures. This patch handles this situation by assuming the tanks
contain air (and warning the user about this).
Reported-by: antonnorth@gmail.com
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes the missing translations for some standard term like "save",
"cancel" on Windows.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updates mainly in the comments of the MXE build script:
- File system layout: different proposal
- Hint to not use MXE current version from git
- MXE build JOBS setting to (very) safe value of 1
- export CXXFLAGS=-std=c++11 added for marble build
This allows the user to enter multiple buddies as a comma separated list,
the "Multiple Buddies" entry is still a special case as we can only populate
the combobox with a single name for each entry.
fixes#168
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
When moving the last handle of a dive (in the planner, in dive add, or
when editing a dive), we rescaled the time axis whenever our idea of the
maximum duration that we should show changed. That lead to the odd
situation that you couldn't get to certain dive durations with the
visual editor (e.g. 64 minutes) because just as you approach that time
the scale changes and the dive duration jumps past the desired value.
Fixes issue #174
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixes#170 on GitHub
Simple catch function for double click events in the divelist,
prevents users from trying to edit the divenumber ithe wrong way.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
In the cylinder table, the last column ("use") always showed
OC-GAS. Editing was enabled, but the user had to guess to enter
a small integer meaning dilluent or CCR oxygen cylingder. I guess,
nobody has ever done that.
This patch makes this column clickable. A click toggles if the cylinder
is used for planning or not. This wait it is much easier to investigate
the consequences of gas loss on a plan.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Gas switches appear as special samples with zero or one second duration.
Those can be confusing when they appear as zero duration in the dive plan
when replanning, so better suppress theose.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
The JS string function search returns the position of the string you
search for and -1 if that string isn't found. Also, search allows
regular expression, indexOf does just a string match. So let's use
that as it is much faster.
See issue #168
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"Multiple Buddies" is magic in that it means "do not change the buddies
set for this dive". Allowing the user to edit that magic phrase defeats
the purpose.
This deals with part of issue #168 - but of course that magic phrase
shouldn't be fixed as English text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we manually track Kirigami we need to compile the desktopicon.cpp
file when not building on Android or iOS.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When painting the tankbar the function triggers on change in cylinder index,
as a result the new gascolour are changed at the next sample time point.
On a divecomputer with a reasonable fast sample rate the 2-3s offset are hardly
noticable, especially on a longer dive.
For divecomputers with slow sample rate the 10-30s offset are clearly visible.
This is fixed by start painting the new gascolour at the time point of the switch event rather than the time point of the next sample.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
When replanning a dive, do not set the surface pressure when it is 0.
Same for salinity.
This closes#161 .
Signed-off-by: Robert C. Helling <helling@atdotde.de>
In commit 70e2404492 ("Stop accessing the internals of
dc_descriptor_t") the structure definition of the libdivecomputer
descriptor was removed from Subsurface and replaced with accessor
functions. This adapts the Smart Trakl import tool to use the same
accessor functions, which allows it to compile again in current master.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had hardcoded the exact translation of the event numbers. They
haven't changed (although we did have what appears to be a spurious
entry for "non stop time" at the end that libdivecomputer doesn't have
an enum for).
Instead, use an explicit array index initializer array, so that it's
obvious that the two match up (and if the sample event numbers ever
change, we should cope with it gracefully).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
New libdivecomputer versions use DC_SAMPLE_GASMIX to indicate a gas
change (which contains the cylinder index we're changing to) rather than
SAMPLE_EVENT_GASCHANGE*.
Unlike the old GASCHANGE model, and despite the name, DC_SAMPLE_GASMIX
does not actually say what the mix is, it only specifies a cylinder
index. We had already extended SAMPLE_EVENT_GASCHANGE2 to have the
cylinder index in the otherwise unused "flags" field, so this is not all
that different from what we used to do.
And subsurface internally already had the logic that "if we know what
the cylinder index is, take the gas mix from the cylinder data", so
we've already been able to transparently use _either_ the actual gas mix
or the cylinder index to show the event.
But we do want to make it an event rather than some sample data, because
we want to show it as such in the profile. But because we are happy
with just the cylinder index, we'll just translate the DC_SAMPLE_GASMIX
thing to the SAMPLE_EVENT_GASCHANGE2 event, and nothing really changes
for subsurface.
libdivecomputer has made other changes, like indicating the initial
cylinder index with an early DC_SAMPLE_GASMIX report, but we've seen
that before too (in the form of early SAMPLE_EVENT_GASCHANGE events), so
that doesn't really end up changing anything for us either.
HOWEVER, one thing that is worth noticing: do *not* apply this patch and
then use an old libdivecomputer library that sends both the
DC_SAMPLE_GASMIX samples _and_ the deprecated SAMPLE_EVENT_GASCHANGE
events. It will all *work*, but since subsurface will take either,
you'll then get duplicate gas mix events.
It's not like that is in any way fatal, but it might be a bit confusing.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Right now this is only designed for Linux where current distros all should have
a new enough libgit2 (and our instructions tell people to install this with
system tools, so we should also use it).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears that sometimes autoreconf will not install ltmain.sh and
subsequently fail; simply running autoreconf again appears to be a
workaround.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This reverts commit adaeb506b7.
commit a8e8d56ec0 ("Tweak cylinder equipment tooltips") does a much
better job allowing the user to know the true volume of the cylinder
(given the gas entered) and clutters the UI a lot less.
While playing around with the current subsurface, I realized that while we
give the gas volume and Z factor for the beginning/end pressures in the
newly added tooltips, there is no way to actually see that same
information for the working pressure.
So if you have filled in cylinder type information, but don't have any
actual gas usage information, there will be no cylinder tooltips at all.
But you might still want to know what the actual volume for a particular
cylinder is, and what the Z value for that working pressure is.
So this tweaks the tool-tips a bit.
When mousing over the pressure fields (ie "working pressure", "start" and
"end"), it now always gives the cylinder gas volume and Z factor for that
pressure, so for example on an AL72 that has a working pressure of 3000
psi and that contains air the tooltip will say:
69 cuft, Z=1.040
when you mouse over the working pressure field (that's obviously with
imperial units, in metric you'll see liters of gas).
When mousing over the type/size field, it gives the used gas amounts, ie
something like this:
37 cuft (82 cuft -> 45 cuft)
but if the cylinder doesn't have starting/ending pressures (and thus no
used gas information), this patch will make subsurface show the working
pressure data instead, so that you at least get something.
This all seems more useful than what my first version gave.
NOTE! This makes commit adaeb506b7 ("Show both the nominal and "real"
size for an imperial cylinder") kind of pointless. You now see the real
size in the tooltip when you mouse over the size, and now it actually
works both for imperial and metric people, so the tooltip is in many ways
the better model.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Modify formluas for gas use to take into account the
compressibility correction for real gases. This introduces
also the inverse formula to compute the pressure for a given
amount of gas.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
...by making the pen start at its first position rather
than first position minus half width.
Sorry for my first attempt to solve this in a totally
differen (read: wrong) way.
Signed-off-by: Robert C. Helling <helling@atdotde.de>