We've added a fair amount of features since 1.0 (like multi-tank) and
we've made things a lot prettier and supports editing much more
information. So let's make a new release.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'ui' of git://github.com/dirkhh/subsurface:
Disable sorting by dive number
Fix oversight in preference implementation
Make columns for temperature, cylinder, and nitrox optional
Show dive number in dive list
Improve time marker handling and add printing of some time labels
This is based on Linus idea and code - just adding it to my UI branch in
case he didn't actually add it to his code...
It makes no sense to sort by dive number - every sane person will have
dive numbers be chronological; so they can sort by date instead.
But removing this option wastes less space and makes the dive list look
much better
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Not being careful enough doing copy and paste and then making manual
changes... this inconsistency caused subsurface to always store the
opposite of what you wanted in the preferences for SAC and O2%.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We now draw time markers at most every 5 min, but no more than 12 markers.
For convenience we do 5, 10, 15 or 30 min intervals.
This allows for 6h dives - enough (I hope) for even the craziest divers -
but just in case, for those 8h depth-record-breaking dives, we double the
interval if this still doesn't get us to 12 or fewer time markers.
We label the first and then every other time marker with the minute text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dirk wrote the multi-cylinder support assuming that the dive computer
always gives the selected cylinder index in the sample data - that's
what his Uemis does, and it makes sense for any dive computer that
supports multiple pressure transmitters.
However, the other case is a dive computer where the pressure samples
are all from cylinder 0, and any other cylinder will have the starting
and ending pressure set by hand. And the gas change events show when
the cylinder change happened.
So this creates a "turn gas change events into pressure sample fixups"
phase just before we actually analyze the pressures. That way the
pressure analysis can alway sdo the right thing, regardless of how the
data was originally stores in the dive.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
For the dive computers that give cylinder change events, we want to
re-write the cylinder index and pressure information with the event
information before we start analyzing the pressures. So instead of
filling the plot info and analyzing in one loop, split it up into two
phases. We'll do the "fix up cylinder pressure info based on events" in
between those phases.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'plot-multitank' of git://github.com/dirkhh/subsurface:
Plot tank pressures for multiple tanks
Change plot_info to use depth (instead of val) for depth value
The code keeps track of the segments of time when a specific tank was used
and interpolates the pressure values for that tank based on a simulated
average SAC rate for the times in which no pressure readings are
available.
This changes the way we used to plot the pressure when only beginning and
end pressure of a tank are known; it used to be a straight line, now it is
a sloped line where the steepness of the slope is proportional to the
depth at that point - which is much more realistic.
We also plot the pressures in two colors now. The old green for pressure
data that came from the input file (that is not the same thing as saying
it came from the computer - divelog for example appear to create pressure
readings in the samples even if it only has beginning and end pressure).
Interpolated values are plotted in yellow. If you have a sub-standard dive
computer which has a frequently failing pressure sensor, you can now tell
the parts of the plot where data was missing and we are filling in.
The function that prints the pressure text labels had to be completely
redone as it previously assumed one tank for the whole dive and
simplisticly printed that tank's start and end pressure at the beginning
and end of the profile plot with the y-values being the maximum and
minimum pressure...
This commit introduces a custom simplistic single linked list data
structure to keep track of the pressure information per segment - Linus
hated the idea of using GList for this purpose, and I have to admit that
in the end this was very straight forward to implement and made the code
easier to read and debug.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The text entries have completions, but if you want to see the full list
of possibilities, I'm not seeing how to do that without turning the
GtkEntry into a GtkComboBoxEntry.
The list of people/locations are not sorted, though, which makes the
full list less than readable. Will have to do that too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.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 makes us fill in the size/pressure data for a cylinder even if we
just type the name (rather than pick an entry from the list)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This allows us to start typing the cylinder description and we'll get a
matching list that we can select. This is similar to selecting one from
the model, and works in addition to the explicit selection.
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>
The cylinder model doesn't contain the start/end pressures, they just
contain the cylinder type information. So trying to read the start and
end pressure from the cylinder model change callback is totally bogus.
We need to set the start/end pressures from the cylinder info when we
create the cylinder widget, and not touch them when the type changes.
So split up the "set_cylinder_spinbuttons()" function in two: one that
sets the type information, and one that sets the start/end pressure.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'minor-fixes' of git://github.com/dirkhh/subsurface:
Fix "Keep window size for new notebook pages" to not set minimum size
Make the first filename on the command line the default filename
Turns out I used the wrong function to keep the size of notebook pages
that were ripped off. Using gtk_widget_set_size_request on the new
notebook creates a hard minimum size for this window.
Instead we should use gtk_window_set_default_size on the new window that
is the parent of the notebook. This has the desired effect of creating the
new window with the same size as the one the page was ripped off from -
without making that the minimum size for this window.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Repainting the dive will end up touching the cylinder list store, so we
should finish setting the cylinder info before we repaint it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
From a usecase point of view - if we call with multiple file names then
most likely it's
subsurface MyDives.xml new_dive1.xml new_dive2.xml
and therefore the existing "database" is the first filename, not the last
one (as the current implementation assumes).
Frankly, this is a bit arbitrary - but this one seems to make more sense.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Those changes may have changed cylinder sizes and beginning/end
pressures, so the dive profile and SAC rate may be different.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
At this point we don't do anything with this - the commit just provides
the infrastructure changes so that this becomes possible. Subsurface
behaves the same if exactly one dive is selected and simply keeps the last
selected dive if zero or more than one dives are selected.
The goal is to be able to select multiple dives and then do actions on
them. For example pick a tank used for all of them. Or edit the location
or (yet to be implemented) other equipment data like weight carried.
And also to be able to merge multiple dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I clearly had never tried this with a dive that used the "just air"
setting the uemis. With this fix the cylinder data for that one tank is
read correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This isn't right if you switch back to the same cylinder multiple times,
but for the first time it kind of works - just take the beginning
cylinder pressure if we have one.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Too much cut-and-paste, as Dirk points out. With multiple cylinders,
we're not necessarily going to start at time zero.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We used to set a fixed size instead of just copying the size that the
existing notebook has - which didn't really feel right when resizing and
then ripping of a page.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We would save it in the xml file, but then not actually read it back
properly. Oops. Not that we actually have any multi-tank dives yet, so
it doesn't matter. Yet.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It doesn't actually do multiple cylinders correctly yet, but it should
be a nice framework for it. And accidentally (not) it also ends up
drawing the final line for the end pressure of a single-cylinder dive
that has been fixed up by hand too.
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>
This finally allows you to set the start/end pressures by hand.
HOWEVER! Right now, if we have samples with pressures, those samples
will always end up overriding anything you set manually. Which can be
very annoying if your wireless air integration fails halfway through.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This allows us the specifiy libdivecomputer's cflags (and also the
library, static or dynamic) outside of the Makefile
Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
make DESRDIR a prefix of everything according my understanding
of the GNU standards. This is also useful(/needed) for installing
in Gentoo. Declare BINDIR for bin/program directory.
Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commit bd8948386d ("Since we don't want configure, use gnumake to find
libdivecomputer") was totally broken. Sure, using GNU make features is
fine. But then hiding in that commit is the fact that it also changed
it to use "-ldivecomputer" instead of just linking with the static
libdivecomputer archive.
And that's just a really bad idea. Dynamic linking is useful for things
like libc, where it allows sharing of the code pages across all the
programs using it. For something like libdivecomputer it's just a *bad*
idea, and doesn't even work. The libdivecomputer interfaces aren't
stable enough to make it a good idea even if it *did* work, and the
libdivecomputer "make install" phase doesn't do the proper ldconfig etc
setup anyway.
Static linking is just simpler and better. It also means that the
binary will work even if you move it around to another machine - since
libdivecomputer isn't exactly a "standard library"..
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I'm trying to get subsurface to get closer to becoming a "regular desktop
application"; so far this is based on the recommendations and guidelines
on OpenSUSE and Fedora.
The icon is now named subsurface.svg and make install installs it in the
correct location. At runtime subsurface first checks if an icon is
installed and if it is it uses that - otherwise it falls back to the old
code that tries to read the svg file from the current directory.
We also install a subsurface.desktop file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Using '%f' limits the precision to 6 decimals, which may well be
perfectly ok. But at least in theory you *could* have higher precision,
and gps units will report it, so don't mindlessly limit us to what %f
shows.
This arbitrarily uses '%.12g' instead. %g will drop excess zeroes at
the end, so it actually results in the same (or shorter) ascii
representation unless you have the extra precision.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Remove casts from/to void*. They are unneeded in C, can hide problems
in the future, and are far too C++ish. Furthermore, they were
inconsistent with the rest of the code and even with regards to
themselves (at least in terms of whether or not to have space after the
cast).
In this case, we temporarily lose const specifiers in libdivecomputer.c
due to the unneeded cast, so it seems better to avoid the cast at all,
so you get warned about a const->non-const cast if you ever change it to
do something like this.
The casts in gtk-gui.c are just useless semantically, although they
might be useful as a hint to the reader that the void pointers are char
arrays.
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If we choose a file in the import dialog then this should imply clicking
OK in that dialog - no reason for a two step process.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
That's a gtk limitation.
So you have to import XML files one at a time. If this is too big of a
restriction then we need to redesign the import dialog.
Sgned-off-by: Dirk Hohndel <dirk@hohndel.org>