This provides the relevant information for the currently selected dive
plus a bunch of statistics over all dives in the dive_table.
The visual design has lots of room for improvement
- right now the different fields change size
- it might be nice to have a more modern look for the entries
- the O2/He field is odd - for most divers the He value will
always be 0, so maybe we should only show He if there's at least one
dive that uses He? Also, we simply do a comma separated list of gases
for all the tanks used
Signed-off-by: Dirk Hohndel <dirk@hohndel.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>
Provides compatibility with winxp-32bit in gtk-gui.c,
since RegGetValue is only available on the 64bit build of the OS.
Fixed whitespace issues, fixed obvious typo (this patch clearly wasn't
even compile tested)
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
a yes/no dialog to clear or store data in HKCU "SOFTWARE\subsurface"
"Do you wish to store subsurface's settings?"
fixed small whitespace issue
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* 'macosx-app-bundle-1' of git://github.com/henrik242/subsurface:
Use the new packaging directory for MacOSX specific files, and provide shell script workaround to make the svg icon reachable.
Ignore process serial number argument when run as native MacOSX app
Add basic MacOSX app bundle install target
Add support for building .deb packages; to use, one can do
$ cp -r packaging/debian debian
$ dpkg-buildpackage -b
This of course requires a libdivecomputer package as a build prerequisite.
Signed-off-by: Roland Dreier <roland@digitalvampire.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We don't want to run gtk-update-icon-cache during a package build, when
we're installing into a staging directory just to create a tree that will
be packaged up and really installed later. The standard heuristic seems
to be to skip gtk-update-icon-cache if DESTDIR is set (ie we're installing
to a different location than we're configured to run from).
Signed-off-by: Roland Dreier <roland@digitalvampire.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- Make use of the new packaging directory.
- Set a current directory for subsurface to find the svg icon. There might be a pretter solution to this.
- Somehow subsurface doesn't behave properly in the Dock. Running it in the background without Dock integration until we figure out why.
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
The subsurface binary is invoked with a -psn_x_xxxxxx argument when started from
a native MacOSX app bundle.
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Native MacOSX app bundles are installed in /Applications. We want a separate
install target for this, since some would probably prefer the regular unixy
way.
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
XSLT file to transfer dive logs from JDiveLog format to Subsurface
format. It can be used on command line with the following syntax:
xsltproc <divelog.jlb> > <divelog.xml>
Basic functionality such as depth readings and dive information is
currently supported. However, this is only tested in metric units.
What is currently missing is at least tank changes and tank pressure (as
no sample data was available).
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'mingw-port-cleanup' of git://github.com/dirkhh/subsurface:
Fix Windows install destination
Get rid of the terminal window that is displayed under Windows
Add first cut of the mingw cross build spec file + nsi file
Get icons working correctly under Windows
We used to have the dive plot have two "filler" entries at the beginning
and the end, and indeed that is how they are allocated. However, we fix
up "pi->nr" later to be "lastindex+1", where "lastindex" is the index of
the time we surface.
So when we loop over the plot entries, we actually need to loop all the
way to the end: use "i < pi->nr" instead of "i < pi->nr-2".
We still do have the two extra filler entries at the beginning, though.
So depending on the loop, we might want to start at entry 2.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Right now it just plots something ridiculous, the code is really just
meant to be an example. We migth be able to plot a traditional
staircase plot and make it look somewhat saner by taking mean depth into
account (if it exists).
Right now it just plots a (skewed) rectangular dive profile using the
max depth and total time. Which is obviously insane.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When creating the plot_info, the 'entry' variable pointing to the last
plot_info data was not initialized (because there was no data to fill
in), and was then incorrectly used to fill in the last tank pressure.
We also used to look at 'dive->sample[0].cylinderindex' even if no
sample[0] necessarily existed.
Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Thanks to Michael Wiedmann I now know the magic incantation to get MinGW
to create a Windows executable that doesn't open two windows, a text
console and the actual gtk window.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These need more work but I'd rather have them here under version control.
The spec file appears to successfully build the Windows binaries, given
the right tar file to start with. Those binaries are then packed into an
rpm file (extermely useless to Windows users).
Once the rpm is unpacked one can then use the NSIS compiler and the .nsi
file to create a Windows installer. This all is still extremely fragile,
but it worked at least once...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this we are able to include both a separate .ico file that the
program can load at runtime and a .res file (that is created from the .rc
file, both in the packaging/windows directory) that is linked into the
executable and makes the Windows Explorer show the correct icon for
subsurface.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
* 'mingw-port-cleanup' of git://github.com/dirkhh/subsurface:
Use Registry on Windows to store preferences
* 'combobox-text-entry-fix' of git://github.com/dirkhh/subsurface:
Update the known locations / buddies / divemasters as user enters them
The code that allowed a user to start typing the name of a location, buddy
or divemaster and that would then offer completions has one flaw - it
doesn't add any new names that you enter to its store of names until you
save and restart the app. This patch fixes that.
When reading the code I also noted that the location_changed,
divemaster_changed, buddy_changed variables have become meaningless. They
are set to 1 and tested, but never changed. I wasn't sure if I should
remove the variables (as the code seems to work without them having any
impact), or if we should go back to actually tracking these changes to
prevent unnecessarily marking the divelist as changed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
No change at all to non-Windows builds.
Everything seems to work with preferences - but only tested on Win7
Remaining issue: displaying an icon (or the logo in the About dialog)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far this just removes the gconf code - so no preferences for Windows.
It also removes the unsused gconf references in main.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create a table with four rows of toggle events and resize it as needed.
This may not create the most beautiful layout, but it works.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now they are displayed in one hbox which doesn't work if you have
many events - but the code itself works and correctly toggles the events
on and off.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We don't have a way to actually configure this in the app, yet, but
toggling the bits in the debugger shows that this works, so commit this
code now.
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>
It's less portable (missing on Windows, for example) and it's kind of
overkill here - the same is easily done with a sscanf.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
You can build subsurface with MinGW. It requires installing lots of random
packages, plus some things still don't work. One is that xml2-config
appears to be missing. So this annotates the Makefile to tell a person
building under Windows how to work around this. But we can't make this
platform conditional as this workaround is hardcoding the install path.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I removed the regex code from the uemis parser a long time ago, but forgot
to remove the #include <regex.h>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The stupid lib vs lib64 problem. I'm sure there's a more portable way to
handle this, but this at least seems to work.
Also fix the install target. Seriously, you create a directory with mode
644 and claim that this ever worked?
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>