This makes it consider them to be identical if they are within half a
bar of each other. If you edit the pressures by hand and set them to
the same bar pressure as the samples, they may not be identical to the
last milli-bar, but clearly the manually entered cylinder pressure isn't
significantly different from the sample data, so consider it redundant.
We do want manual overrides of cylinder pressures to take precedence
over sample data (as Dirk so eloquently puts it, some dive computers
really don't have very reliable sample data), but at the same time the
sample data is the one we are expecting to be fairly accurate. The
starting and ending pressure overrides are for when there is no sample
data, or when the sample data is totally wrong for some reason.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Keep the sample pressure start/end data separate from the overall
cylinder start/end data - and clean the overall cylinder start/end data
if it matches the samples exactly to avoid the redundancy.
This breaks all the SAC calculations etc, which expect the cylinder
pressures to always be in the cylinder data. I'll fix that up
separately.
The reason for this is that we really want to keep the manually entered
data separate: the pressure plotting doesn't need the confusion, and
considers end-point data (with interpolation) very different from sample
data. Also, we do not want to pollute the xml save-file with data that
is computed.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Finally getting more consistent overall in how we convert between the
different units and how we decide which units to display.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Treat SAC and OTU consistently:
- SAC is now a member of struct dive
- it's calculated / populated at the same time with a helper function with
consistent API
Create get_volume_units function that returns volumes (e.g. used in SAC
rates) based on preferred units - make sure we have these conversions just
once in the code.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Designed along the lines of get_depth_units - except we don't define a
specific number of digits to show.
Use this in the one spot we need it right now in profile.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First step to being able to filter the events that we display in the
profile. We could (in theory) walk all the dives in the divelist when we
need this data, but it seems much more convenient to have them in an array
in one place.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way you can just type the first few characters of a location you've
been to before, and it will show you a list of possible completions.
Same for buddies and divemasters (which take the completions from a list
of people you've used before).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This way the cylinder model list will contain all the different
cylinders that we have ever seen, rather than only containing the models
that we have *edited*.
That makes it much more practical to add new dives with the same
cylinders that we've used before, because now those cylinders will show
up as cylinder models even if we haven't looked and edited the old dives
first.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If we have en explicit end pressure in the dive information, we should
not change it just because we also have some samples. The sample data
may not be complete (read: "Linus wireless connection dropped during the
dive again, and he fixed up the end pressure manually afterwards").
The beginning pressure already works correctly, because it will only use
the sample data for the first sample if no pressure existed before.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Depending on the tool used to import a dive from the uemis Zurich we end
up with different time stamps for the dive - just by a few seconds, but
the existing code insisted on an exact match.
We now allow for up to 60 seconds in difference and still consider two
dives as the same.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
At first glance it seems logical to make the ending pressure be the
lowest pressure observed during a dive. But if you do valve shut down
drills with a tech setup (where you have a fully redundant double
tank setup with two valves, two regulators and a manifold in between),
then you continue to breath from what is indeed the same "tank", but still
the valve on which your air pressure transmitter sits does get shut down
and de-pressurized. So your pressure goes down by quite a bit, and then
comes back up when the valve is turned back on.
And the ending pressure of the dive (which is used for things like the SAC
calculation) is indeed potentially higher than the lowest pressure
observed during a dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When merging two identical dives and one of them has lat/long data, pick
it up correctly for the merged dive.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Parse them, save them, take them from libdivecomputer.
This doesn't merge them or show them in the profile yet, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The following are UI toolkit specific:
gtk-gui.c - overall layout, main window of the UI
divelist.c - list of dives subsurface maintains
equipment.c - equipment / tank information for each dive
info.c - detailed dive info
print.c - printing
The rest is independent of the UI:
main.c i - program frame
dive.c i - creates and maintaines the internal dive list structure
libdivecomputer.c
uemis.c
parse-xml.c
save-xml.c - interface with dive computers and the XML files
profile.c - creates the data for the profile and draws it using cairo
This commit should contain NO functional changes, just moving code around
and a couple of minor abstractions.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
.. without the actual text, because I'm a "random plots that cannot
actually be interpreted" kind of guy.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We're going to start to want to allocate dives and samples for the
libdivecomputer import too, so let's clean things up a bit for that.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
libdivecomputer already uses 'gasmix_t' for its own gasmix thing. I
don't like th eway we step on each others name spaces, but hey, might as
well just use 'struct gasmix' and avoid the typedef.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Doing per-dive cylinder start/end pressures is insane, when we can have
up to eight cylinders. The cylinder start/end pressure cannot be per
dive, it needs to be per cylinder.
This makes the save format cleaner too, we have all the cylinder data in
just one place.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We don't want to override potentially more exact values for water
temperature etc either. The sample save interval may be longer than
some internally kept state of key per-dive values like that.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. and sort based on the 'time_t' value itself.
This allows us to use a more compact date format that doesn't need to
sort alphabetically, because sorting by date is always based on the date
value. So we can use just a two-digit year, and skip the seconds, to
keep the column narrow, while still sorting correctly.
Also, "Depth" is a nice header string, but it is wider than the column
itself, which makes the whole column wider than necessary. So put the
units in the header instead of in the string, keeping things narrow.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'compiler-warning' of https://github.com/nathansamson/diveclog:
Removed the unused startemp and enttemp calculations. This fixes a compiler warning too.
Fix up trivial conflict in dive.c due to the temperature simplification
(commit 9961c7f89c: "Remove redundant temperature readings").
I'm aiming to really differentiate in dive log software by making my XML
export files be *clean*, dammit.
That means that we don't have random names, we don't have crazy random
units, and we don't have redundant information.
So when the temperature doesn't change, just don't report it. That's
already what "no sample" means, just clean things up.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Instead of just tracking gasmix, track the size and workng pressure of
the cylinder too.
And use "cylinder" instead of "tank" throughout.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The computer may track "real" max depth more closely than it tracks
samples. So we trust the non-computed mean/max depths more than the
computed ones.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Now the dive profile plot *really* needs some units. The pressure is
just a random line otherwise.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>