]> git.tdb.fi Git - ext/subsurface.git/log
ext/subsurface.git
12 years agoFix reference tank information for LP steel tanks.
Linus Torvalds [Sun, 1 Apr 2012 22:38:52 +0000 (15:38 -0700)]
Fix reference tank information for LP steel tanks.

Commit f9bb3f79106b ("Clean up reference tank information table") had
cleaned up the tank info list so that you could sanely do tanks in
liters and with a working pressure in bar.

But the LP steel cylinders had somehow missed out on the ".psi =" part
of the equation, and as a result, what was supposed to be their working
pressure instead ended up being interpreted as their size in
milli-liters.

Oops.

Fix that, and also make the standard tank info filling code actually
verify the sanity of the reference tank table, so that if this happens
again, it will complain loudly instead of using nonsensical values.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix broken average SAC calculation
Miika Turkia [Fri, 30 Mar 2012 05:10:05 +0000 (08:10 +0300)]
Fix broken average SAC calculation

old_sac_time was always 0 when calculating average air consumption.
Thus the results were incorrect.  Move the counter to stats_t structure
as suggested by Linus.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdded support for Mares Darwin, M1, M2, ... from latest libdivecomputer.
Björn Spruck [Sun, 25 Mar 2012 15:16:21 +0000 (17:16 +0200)]
Added support for Mares Darwin, M1, M2, ... from latest libdivecomputer.
Only M1 has been tested.
Darwin Air will most likely not work as an additional model flag seems to be needed.
This is not foreseen in current GUI.

12 years agoMerge branch 'weight' of git://subsurface.hohndel.org/subsurface
Linus Torvalds [Sat, 24 Mar 2012 04:07:53 +0000 (21:07 -0700)]
Merge branch 'weight' of git://subsurface.hohndel.org/subsurface

Pull weight management from Dirk Hohndel:
 "This is the fifth or sixth version of this code, I'm begining to lose
  track.  I still struggle with the balance between code duplication and
  unnecessary indirectness and complexity.  Maybe I'm just not finding
  the right level of abstraction.  Maybe I'm just trying too hard.

  The code here is reasonably well tested.  Works for me :-)

  It can import DivingLog xml files with weight systems and correctly
  parses those.  It obviously can read and write weight systems in its
  own file format.  It adds a KG/lbs unit default (and correctly stores
  that).

  The thing I still worry about is the code in equipment.c.  You'll see
  that I tried to abstract things in a way that weight systems and
  cylinders share quite a bit of code - but there's more very similar
  code that isn't shared as my attempts to do so turned into ugly and
  hard to read code.  It always felt like trying to write C++ in C..."

* 'weight' of git://subsurface.hohndel.org/subsurface:
  Add weight system tracking

Fix up some trivial conflicts due to various renaming of globals and
simplification in function interfaces.

12 years agoAdd weight system tracking
Dirk Hohndel [Sat, 24 Dec 2011 03:41:16 +0000 (19:41 -0800)]
Add weight system tracking

- supports multiple weight systems per dive
- supports multiple weight system types
- supports import of weight as tracked by DivingLog

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agouser-manual: fix a few annoying typos
Miklos Vajna [Thu, 22 Mar 2012 11:34:41 +0000 (12:34 +0100)]
user-manual: fix a few annoying typos

Signed-off-by: Miklos Vajna <vmiklos@vmiklos.hu>
12 years agoShow statistics of selected dives
Miika Turkia [Wed, 14 Mar 2012 17:01:34 +0000 (19:01 +0200)]
Show statistics of selected dives

If at least 2 dives are selected, show statistics of these dives on
Overall Stats. Otherwise, show the statistics of all dives. Temperature
is also added to the shown statistics.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Minor change to avoid adding statistics.h (moved the global variable and
external function declaration to display-gtk.h).
Another minor change to the text displayed for the "Stats" notebook page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoCochran: fix up dive data descrambling
Linus Torvalds [Sat, 28 Jan 2012 02:27:30 +0000 (18:27 -0800)]
Cochran: fix up dive data descrambling

This seems to do the dive data descrambling right for both files I have
access to.  Except it uses a hardcoded (different) offset for the two.
I have yet to figure out how to automatically detect the offset itself
properly, so you have to compile for the right file.

I'll figure it out, but I'm committing this as a reasonable point in the
process.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix up Cochran dive header decoding offset
Linus Torvalds [Sat, 28 Jan 2012 01:36:42 +0000 (17:36 -0800)]
Fix up Cochran dive header decoding offset

It turns out the odd "different CAN files have different header offsets"
came from the fact that the decode block was different lengths, and I
had not picked the correct place to start - and instead had found two
different places that were at different offsets due to the decode block
length differences.

This fixes that up, and it looks like the dive header is correctly
descrambled (but what the data *means* is unclear, although there is now
an ASCII date and time visible, so at least one part of it is pretty
obvious).

The actual dive data unscrambling is still different for the two
test-files I have to play with, I do not know why.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agocochran: do a partial header de-scramble
Linus Torvalds [Fri, 27 Jan 2012 23:11:34 +0000 (15:11 -0800)]
cochran: do a partial header de-scramble

This descrambles at least parts of the header data.  Some of it has the
same pattern of data 4kB apart, it may be that there is a dive hiding in
there too (ie what I currently call a "header" may in fact be a header
_plus_ a dive).

But the 4kB thing may well be an artifact of the crazy scrambling code
itself.  Who knows what kind of chunking the Cochran Analyst
"encryption" uses.

As with the dive data, there seems to be some offset differences between
different CAN files.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agocochran: do the full de-scramble for one case
Linus Torvalds [Fri, 27 Jan 2012 22:10:55 +0000 (14:10 -0800)]
cochran: do the full de-scramble for one case

So this descrambles all the dives in *one* of my cochran test files.  I
still don't know what the dive data *means*, but it's not a random
jumble of bytes any more: there are very clear patterns.

However, the magic offsets that work for that particular CAN file are
not generic, because they don't work for another.  So there is some
magic dynamic decoding that I don't know about.  There is probably more
decode information in the initial decode block, over and beyond just the
scrambling bytes.

(The scrambling array is 234 bytes starting at 0x40001, but the first
actual *dive* data starts at 0x45e03, so there's tons of unknown stuff
in the file even outside the dives themselves)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake cochran debug output a bit easier to use directly
Linus Torvalds [Fri, 27 Jan 2012 22:02:50 +0000 (14:02 -0800)]
Make cochran debug output a bit easier to use directly

Just do the hex-dump in the program, and print all the results to
standard output.  Avoid the need to do 'od' by hand etc to see what
happens when you play with the decoder.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd some initial cochran CAN file parsing
Linus Torvalds [Fri, 27 Jan 2012 20:43:40 +0000 (12:43 -0800)]
Add some initial cochran CAN file parsing

It's broken, and currently only writes out a debug output file per dive.
I'm not sure I'll ever really be able to decode the mess that is the
Cochran ANalyst stuff, but I have a few test files, along with separate
depth info from a couple of the dives in question, so in case this ever
works I can at least validate it to some degree.

The file format is definitely very intentionally obscured, though.
Annoying.  It's not like the Cochran software is actually all that good
(it's really quite a horribly nasty Windows-only app, I'm told).

Cochran Analyst is very much not the reason why people would buy those
computers.  So Cochran making their computers harder to use with other
software is just stupid.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoImport: always open and read the file before checking the filename extension
Linus Torvalds [Fri, 27 Jan 2012 18:56:36 +0000 (10:56 -0800)]
Import: always open and read the file before checking the filename extension

Most of the parsers will want the content in memory, so keep them
simple.  The fact that the Suunto parser uses "libzip" that has to
re-open the file is annoying and causes us to re-open the file etc.

But it's the odd man out, so don't design the "open_by_filename()"
function around it.  Pretty much everybody else will want to avoid
having to cook up their own IO routines.

Also, when reading the file, NUL-terminate the buffer.  This allows us
to just treat text files as large strings if we want to, and doesn't
matter for binary files (we still pass in the length explicitly).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix typo ('suundo' instead of 'suunto')
Linus Torvalds [Fri, 27 Jan 2012 16:11:24 +0000 (08:11 -0800)]
Fix typo ('suundo' instead of 'suunto')

I apparently was so congested that it affected my typing too when I
wrote that, and then copy-paste meant that the use and declaration
matched despite the misspelling.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd "native" Suunto SDE zip file reading
Linus Torvalds [Fri, 27 Jan 2012 01:43:33 +0000 (17:43 -0800)]
Add "native" Suunto SDE zip file reading

You need to have libzip-devel installed, and pkg-config needs to know about it
for the build to pick up on it.

On at least Fedora, a simple "yum install libzip-devel" will make things
work, although you may need to force a rebuild of subsurface too (the
"file.o" file in particular - the Makefile doesn't track system
dependencies).

Then, you can just do

   subsurface my-dives.SDE

to read the data directly from the SDE file.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoSplit up file reading from 'parse-xml.c' into 'file.c'
Linus Torvalds [Thu, 26 Jan 2012 21:00:45 +0000 (13:00 -0800)]
Split up file reading from 'parse-xml.c' into 'file.c'

We're going to eventually import non-xml files too, so let's begin
splitting the logic up.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'info-split' of git://git.hohndel.org/subsurface
Linus Torvalds [Wed, 18 Jan 2012 04:02:33 +0000 (20:02 -0800)]
Merge branch 'info-split' of git://git.hohndel.org/subsurface

* 'info-split' of git://git.hohndel.org/subsurface:
  Add statistics for longest, shortest, and shallowest dive
  Create separate single dive and total stats pages
  Separate out single dive statistics and total statistics

12 years agoLink with libm for 'pow()'
Cristian Ionescu-Idbohrn [Sun, 15 Jan 2012 23:40:50 +0000 (00:40 +0100)]
Link with libm for 'pow()'

Solves suddenly revealed linking error:

  divelist.c:400: error: undefined reference to 'pow'

Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd statistics for longest, shortest, and shallowest dive
Dirk Hohndel [Sun, 15 Jan 2012 23:21:56 +0000 (15:21 -0800)]
Add statistics for longest, shortest, and shallowest dive

I don't really like calling the shallowest dive "min depth", but all other
texts that I could come up with that were reasonably short weren't any
better...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoCreate separate single dive and total stats pages
Dirk Hohndel [Sun, 15 Jan 2012 22:29:08 +0000 (14:29 -0800)]
Create separate single dive and total stats pages

No additional statistics added, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoSeparate out single dive statistics and total statistics
Dirk Hohndel [Sun, 15 Jan 2012 21:19:39 +0000 (13:19 -0800)]
Separate out single dive statistics and total statistics

Right now this just changes the infrastructure - nothing outside of
statistics.c is modified. This is simply in preparation to split out the
single dive info and the total dive statistics in the future (as we are
creating more info and more stats and they will overflow the screen area
available - so this will turn into two notebook tabs).

This commit does not change any functionality.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAvoiding some potentially confusing name space clashes
Dirk Hohndel [Thu, 5 Jan 2012 16:16:08 +0000 (08:16 -0800)]
Avoiding some potentially confusing name space clashes

We have local variables or function arguments with the same names as
function static variables (or in one case, function arguments).

While all the current code was correct, it could potentially cause
confusion when chasing bugs or reviewing patches. This should make things
clearer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMore removal of unused arguments
Dirk Hohndel [Thu, 5 Jan 2012 16:12:57 +0000 (08:12 -0800)]
More removal of unused arguments

Just trying to clean up the code a bit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoOddly, finishing a sample doesn't require a sample
Dirk Hohndel [Thu, 5 Jan 2012 06:01:02 +0000 (22:01 -0800)]
Oddly, finishing a sample doesn't require a sample

So let's not pass it around

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMore Mac improvements
Henrik Brautaset Aronsen [Tue, 3 Jan 2012 19:18:04 +0000 (20:18 +0100)]
More Mac improvements

The startup shell script workaround isn't needed anymore. The preferences
hotkey didn't work. Remove left-over menu separators.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoEven more Mac-i-ness
Dirk Hohndel [Tue, 3 Jan 2012 04:49:10 +0000 (20:49 -0800)]
Even more Mac-i-ness

Move the About and Preferences menu item to the App menu.
Switch the accelerator key to be Meta (i.e., Command) instead of Control

This required a bit of restructuring of the code, but it's all for a good
cause.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdding the right header file for R_OK on Windows
Dirk Hohndel [Tue, 3 Jan 2012 05:53:33 +0000 (21:53 -0800)]
Adding the right header file for R_OK on Windows

Dang, I should have compile tested this on Windows before the last
commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoOnly set the window icon if the icon file exists
Dirk Hohndel [Tue, 3 Jan 2012 04:15:24 +0000 (20:15 -0800)]
Only set the window icon if the icon file exists

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoCorrectly free the GSList in file_open
Dirk Hohndel [Tue, 3 Jan 2012 04:13:45 +0000 (20:13 -0800)]
Correctly free the GSList in file_open

Passing a value that is known to be NULL to g_slist_free seems like the
wrong approach...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUse the right function to get resource path on Mac
Dirk Hohndel [Mon, 2 Jan 2012 16:26:24 +0000 (08:26 -0800)]
Use the right function to get resource path on Mac

Much better than hacking together my own...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUse a more standard approach to save preferences on MacOSX
Henrik Brautaset Aronsen [Mon, 2 Jan 2012 14:14:42 +0000 (15:14 +0100)]
Use a more standard approach to save preferences on MacOSX

CFPreferences* seems to be the proper way to handle preferences on MacOSX.
This approach also eliminates a problem where the hard coded preferences
path couldn't be read.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
[ fixed small coding style issues ]
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMore AsciiDoc updates
Dirk Hohndel [Mon, 2 Jan 2012 01:41:05 +0000 (17:41 -0800)]
More AsciiDoc updates

Add missing internal links

Work on better visual representation of structured data

Start creating quoted text (instead of styled text)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUpdate asciidoc headers and deal with internal links
Dirk Hohndel [Mon, 2 Jan 2012 00:52:45 +0000 (16:52 -0800)]
Update asciidoc headers and deal with internal links

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFirst try at converting user-manual to AsciiDoc
Linus Torvalds [Sun, 1 Jan 2012 23:12:28 +0000 (15:12 -0800)]
First try at converting user-manual to AsciiDoc

You can do "make doc" in the main directory to create the html version,
and if you want to play around with it, do "make show" in the
Documentation subdirectory to start firefox on the end result.

It's by no means perfect, but it gives somewhat reasonable results, and
this is enough initial work for people to play around with, I think.

NOTE! You need "asciidoc" installed to do this: it's a python program,
so it should be pretty easy even on non-Linux platforms.  And on Linux,
most distributions package it, so you just have to do something like

yum install asciidoc

to get it (replace with apt-get/zypper/whatever).

Asciidoc can generate other output too (man-pages, LaTeX, etc), maybe
people want to play with that part too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'mac' of git://git.hohndel.org/subsurface
Linus Torvalds [Sun, 1 Jan 2012 22:37:38 +0000 (14:37 -0800)]
Merge branch 'mac' of git://git.hohndel.org/subsurface

* 'mac' of git://git.hohndel.org/subsurface:
  Turn subsurface into a real Mac application

12 years agoTurn subsurface into a real Mac application
Dirk Hohndel [Sun, 1 Jan 2012 21:41:47 +0000 (13:41 -0800)]
Turn subsurface into a real Mac application

To do this a few things needed to move into the os specific files, but the
overall change is fairly small and the difference on the Mac is amazing.

Subsurface now becomes a Mac app with Mac toolbar and useful default
fonts.

Changed the CFBundleIdentifier to be the reverse DNS of the subsurface
site (sadly, 'torvalds' is not yet a TLD).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoDefine O2 permille for air in one spot
Henrik Brautaset Aronsen [Sat, 31 Dec 2011 16:15:59 +0000 (17:15 +0100)]
Define O2 permille for air in one spot

Having the O2 permille defined once is more readable.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoDisplay OTU for dives using air
Henrik Brautaset Aronsen [Sat, 31 Dec 2011 16:00:36 +0000 (17:00 +0100)]
Display OTU for dives using air

Zero o2 means 20.9% o2, which can be confusing...

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoMove the gasmix cleanups from XML parsing to the generic dive fixup stage
Linus Torvalds [Fri, 30 Dec 2011 21:09:17 +0000 (13:09 -0800)]
Move the gasmix cleanups from XML parsing to the generic dive fixup stage

Right now we do certain cylinder info operations only when importing
from an XML file, which is wrong.  In particular, we do the "is the
gasmix air" or "what is the standard cylinder name" only at XML read
time, which means that if you import a dive directly from the dive
computer, it won't have the air sanitization or the proper default
cylinder names.

Of course, most dive computers don't actually save enough cylinder
information for us to do the cylinder name lookup anyway, but some do.
And all Nitrox-capable dive computers do have that O2 percentage that
needs cleanup too.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake icon file name OS helper function
Dirk Hohndel [Wed, 28 Dec 2011 23:57:36 +0000 (15:57 -0800)]
Make icon file name OS helper function

This way we can load the correct icon on the Mac without ugly hacks in the
OS independent code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branches 'windows', 'docs' and 'forlinus' of git://git.hohndel.org/subsurface
Linus Torvalds [Tue, 27 Dec 2011 17:27:33 +0000 (09:27 -0800)]
Merge branches 'windows', 'docs' and 'forlinus' of git://git.hohndel.org/subsurface

* 'windows' of git://git.hohndel.org/subsurface:
  Fixes for the Windows installer

* 'docs' of git://git.hohndel.org/subsurface:
  Version 0.0.7 of user manual

* 'forlinus' of git://git.hohndel.org/subsurface:
  Remove unused return value

12 years agoRemove unused return value
Dirk Hohndel [Tue, 27 Dec 2011 00:46:06 +0000 (16:46 -0800)]
Remove unused return value

We never use the number of decimals that this function returns. So we
might as well not return them to begin with.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoVersion 0.0.7 of user manual
Jacco van Koll [Tue, 27 Dec 2011 00:14:44 +0000 (16:14 -0800)]
Version 0.0.7 of user manual

Added chapter 14: The menu and sub-menus

Signed-off-by: Jacco van Koll <jko@haringstad.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFixes for the Windows installer
Dirk Hohndel [Tue, 27 Dec 2011 00:07:03 +0000 (16:07 -0800)]
Fixes for the Windows installer

Add missing files and update a library version number.

The library version thing seems to indicate that this is much more fragile
than I'd want it to be...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoThere's a difference between "it's" and "its"
Henrik Brautaset Aronsen [Mon, 26 Dec 2011 11:08:34 +0000 (12:08 +0100)]
There's a difference between "it's" and "its"

Just sayin'

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoFix incorrect utf-8 in Documentation/user-manual.txt
Cristian Ionescu-Idbohrn [Sat, 24 Dec 2011 11:17:46 +0000 (12:17 +0100)]
Fix incorrect utf-8 in Documentation/user-manual.txt

Not sure, but us-ascii might have been intended.

Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
[ And even if you do want to use utf8, you should use it correctly, not
  with this "pick random character" approach  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'docs' of git://git.hohndel.org/subsurface
Linus Torvalds [Sat, 24 Dec 2011 04:23:04 +0000 (20:23 -0800)]
Merge branch 'docs' of git://git.hohndel.org/subsurface

* 'docs' of git://git.hohndel.org/subsurface:
  Version 0.0.6 of user manual

12 years agoVersion 0.0.6 of user manual
Jacco van Koll [Fri, 23 Dec 2011 18:43:58 +0000 (19:43 +0100)]
Version 0.0.6 of user manual

Corrected some typo's
Modified chapter 12. Importing dives from JDivelogAdded chapter 13.
Importing dives from Suunto Divemanager 3.*
Added Appendix B: very tiny example script for importing Suunto
Divemanager 3.* xml files

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoparse-xml: read the file into memory separately
Linus Torvalds [Mon, 19 Dec 2011 02:30:31 +0000 (18:30 -0800)]
parse-xml: read the file into memory separately

Using xmlParseFile() was simple, but I'm planning on extending the file
parsing past just XML, since we want to be able to import other formats
too.  And quite frankly, that means that we'll want to read the file
into memory to look at it before we start parsing it.

We could decide do it by file extensions too, and I'll look at that
approach as well, but regardless of how we do things it's almost
certainly a good idea to do the file access in one place.  The XML
parsing might as well happen from a memory buffer instead anyway.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoUse an ellipsis for Nitrox O2% ranges
Linus Torvalds [Mon, 19 Dec 2011 02:29:32 +0000 (18:29 -0800)]
Use an ellipsis for Nitrox O2% ranges

The plain dash may look a bit too much like a trimix specification.  Is
the ellipsis better? Maybe.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMultiple cylinder support for JDiveLog import
Miika Turkia [Sun, 18 Dec 2011 12:36:28 +0000 (14:36 +0200)]
Multiple cylinder support for JDiveLog import

Support for multiple cylinders and gas change events when Importing
JDiveLog logs to Subsurface. This is tested with manually crafted data
and not real data (originating from dive computer).

NOTE: Subsurface does not handle importing multiple cylinders
correctly but imports only the first cylinder. However, manually
converting data to a file and opening that in Subsurface works
correctly.
 (xsltproc jdivelog2subsurface.xslt jdivelog-gas.jlb > gas.xml)

Some minor tweaking on importing JDiveLog specific fields to notes
fields in Subsurface is also included.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd more details to import chapter of user-manual
Dirk Hohndel [Fri, 16 Dec 2011 21:11:29 +0000 (13:11 -0800)]
Add more details to import chapter of user-manual

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoVersion 0.0.5 of user manual
Jacco van Koll [Fri, 16 Dec 2011 19:14:15 +0000 (20:14 +0100)]
Version 0.0.5 of user manual

Added chapter 12. Importing dives from JDivelog
Adding some divecomputers to Appendix A

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
12 years agoMerge branch 'forlinus' of git://git.hohndel.org/subsurface
Linus Torvalds [Thu, 15 Dec 2011 05:06:00 +0000 (21:06 -0800)]
Merge branch 'forlinus' of git://git.hohndel.org/subsurface

* 'forlinus' of git://git.hohndel.org/subsurface:
  Return is not a function

12 years agoReturn is not a function
Dirk Hohndel [Thu, 15 Dec 2011 04:49:40 +0000 (20:49 -0800)]
Return is not a function

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'forlinus' of git://git.hohndel.org/subsurface
Linus Torvalds [Thu, 15 Dec 2011 02:19:48 +0000 (18:19 -0800)]
Merge branch 'forlinus' of git://git.hohndel.org/subsurface

* 'forlinus' of git://git.hohndel.org/subsurface:
  Improve Makefile for MacOS
  Add reasonable default device names for divecomputer import
  More intuitive label for "not saving" when exiting

12 years agoImprove Makefile for MacOS
Dirk Hohndel [Wed, 14 Dec 2011 19:22:12 +0000 (11:22 -0800)]
Improve Makefile for MacOS

Some macs appear to need "-framework CoreFoundation" added to the linking
step, others (which appear to have the exact same OS and tools installed),
don't. But as it doesn't appeart to hurt, I unconditionally add this.

Switched to using pkgconfig to find libdivecomputer on the Mac.

Tried to clean up the Makefile a bit

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Acked-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoAdd reasonable default device names for divecomputer import
Dirk Hohndel [Wed, 14 Dec 2011 04:34:56 +0000 (20:34 -0800)]
Add reasonable default device names for divecomputer import

So far we hard coded /dev/ttyUSB0 - which is a good starting point in
Linux but not so useful on Windows or MacOS. This was now moved into one
of our OS helper functions with (somewhat) reasonable defaults.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoClarify documentation about connecting dive computers
Dirk Hohndel [Wed, 14 Dec 2011 04:15:19 +0000 (20:15 -0800)]
Clarify documentation about connecting dive computers

This works rather differently on the different OSs

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoVersion 0.0.4 of user manual
Jacco van Koll [Wed, 14 Dec 2011 03:55:26 +0000 (19:55 -0800)]
Version 0.0.4 of user manual

Cleanup of the layout
Changed line-length to 74
Added chapter 11. How to find the Device Name
Added Appendix A: Supported divecomputers

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
12 years agoMore intuitive label for "not saving" when exiting
Dirk Hohndel [Tue, 13 Dec 2011 22:34:42 +0000 (14:34 -0800)]
More intuitive label for "not saving" when exiting

Right now the options are "Save" and "Cancel". I wrote that code and it
always bugged me - "Cancel" could mean that I want to cancel the the whole
operation, i.e. that I don't want to quit after all. Showing "Save" and
"No" seems much more logical.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFixing whitespace, line wrapping
Dirk Hohndel [Mon, 12 Dec 2011 22:45:27 +0000 (14:45 -0800)]
Fixing whitespace, line wrapping

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoVersion 0.0.3 of user manual
Jacco van Koll [Mon, 12 Dec 2011 22:37:07 +0000 (14:37 -0800)]
Version 0.0.3 of user manual

Added missing chapters. Now includes adding information.

12 years agoVersion 0.0.2 of user manual
Jacco van Koll [Mon, 12 Dec 2011 20:47:42 +0000 (12:47 -0800)]
Version 0.0.2 of user manual

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
12 years agoReformat, reorganize and slightly modify user manual
Dirk Hohndel [Mon, 12 Dec 2011 20:18:32 +0000 (12:18 -0800)]
Reformat, reorganize and slightly modify user manual

Getting started on better user documentation. Awesome.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFirst draft of user documentation
Jacco van Koll [Mon, 12 Dec 2011 20:03:04 +0000 (12:03 -0800)]
First draft of user documentation

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
12 years agoMerge branch 'forlinus' of git://git.hohndel.org/subsurface
Linus Torvalds [Mon, 12 Dec 2011 19:20:36 +0000 (11:20 -0800)]
Merge branch 'forlinus' of git://git.hohndel.org/subsurface

* 'forlinus' of git://git.hohndel.org/subsurface:
  Small improvement to plot info debugging code
  Add three more trimix test dives
  Make test dive 15 a bit more useful
  Two test dives I added a couple of months ago
  Add libxslt to Windows packaging file

12 years agoSmall improvement to plot info debugging code
Dirk Hohndel [Mon, 12 Dec 2011 18:13:03 +0000 (10:13 -0800)]
Small improvement to plot info debugging code

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd three more trimix test dives
Dirk Hohndel [Mon, 12 Dec 2011 18:12:29 +0000 (10:12 -0800)]
Add three more trimix test dives

This allows us to check what we display in the dive list and how we sort
it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMake test dive 15 a bit more useful
Dirk Hohndel [Mon, 12 Dec 2011 18:11:53 +0000 (10:11 -0800)]
Make test dive 15 a bit more useful

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoTwo test dives I added a couple of months ago
Dirk Hohndel [Mon, 12 Dec 2011 17:19:58 +0000 (09:19 -0800)]
Two test dives I added a couple of months ago

...and never commited

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd libxslt to Windows packaging file
Dirk Hohndel [Mon, 12 Dec 2011 17:15:04 +0000 (09:15 -0800)]
Add libxslt to Windows packaging file

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoPack the star rating on a line of its own
Linus Torvalds [Mon, 12 Dec 2011 17:24:47 +0000 (09:24 -0800)]
Pack the star rating on a line of its own

Packing it next to the divemaster/buddy information may work great on a
big screen with lots of pixes, but it makes the minimum window size way
wide for a small screen.  So don't do it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodivelist: show/sort nitrox dive oxygen percentage as a range
Linus Torvalds [Mon, 12 Dec 2011 17:20:22 +0000 (09:20 -0800)]
divelist: show/sort nitrox dive oxygen percentage as a range

If you are diving multiple nitrox cylinders, we now show them as a range
instead of just the max.  We'll still sort by max O2 (and for the same
max, by min O2).

So now with trimix dives, we'll show the bottom gas (we assume that
"highest He percentage" is that bottom gas), for nitrox dives we'll show
the range of Oxygen percentage, and for all-air dives we'll show just
"air".

For simple nitrox dives (only a single mix), we'll obviously show just
that single percentage.  This should hopefully conclude the whole "show
multiple cylinders in dive list" mess.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake the dive gas record the single highest mix
Linus Torvalds [Mon, 12 Dec 2011 05:28:18 +0000 (21:28 -0800)]
Make the dive gas record the single highest mix

.. using the regular sorting rules: sort by Helium content first, Oxygen
content second.  Air always sorts last (even behind the theoretical
hypoxic Nitrox that nobody sane would use).

This is what Don Kinney implies would be the natural thing for a trimix
diver.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd trimix test dive
Dirk Hohndel [Mon, 12 Dec 2011 00:00:47 +0000 (16:00 -0800)]
Add trimix test dive

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd capability of custom sorts to divelist columns
Linus Torvalds [Sun, 11 Dec 2011 22:38:58 +0000 (14:38 -0800)]
Add capability of custom sorts to divelist columns

.. and use this for the nitrox column, which can now be more complex
than just a single number.

The rule for the "nitrox" column is now:

 - we look up the highest Oxygen and Helium mix for the dive

   (Note: we look them up independently, so if you have a EAN50 deco
   bottle, and a 20% Helium low-oxygen bottle for the deep portion, then
   we'll consider the dive to be a "50% Oxygen, 20% Helium" dive, even
   though you obviously never used that combination at the same time)

 - we sort by Helium first, Oxygen second.  So a dive with a 10% Helium
   mix is considered to be "stronger" than a 50% Nitrox mix.

 - If Helium is non-zero, we show "O2/He", otherwise we show just "O2"
   (or "air").  So "21/20" means "21% oxygen, 20% Helium", while "40"
   means "Ean 40".

 - I got rid of the decimals.  We save them, and you can see them in the
   dive equipment details, but for the dive list we just use rounded
   percentages.

Let's see how many bugs I introduced.  I don't actually have any trimix
dives, but I edited a few for (very limited) testing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake sure to update divelist O2 information after editing
Linus Torvalds [Sun, 11 Dec 2011 20:18:10 +0000 (12:18 -0800)]
Make sure to update divelist O2 information after editing

The divelist airmix display is kind of broken: it only looks at the
first cylinder, and it only looks at Oxygen content, not Helium.

But at least we can make sure to update it when somebody edits the
cylinder information, instead of leaving it extra broken.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd the "Common European Cylinders" as per Henrik
Linus Torvalds [Sun, 11 Dec 2011 20:03:55 +0000 (12:03 -0800)]
Add the "Common European Cylinders" as per Henrik

This is Henrik's list of common metric sized cylinders, although my
experience differs from this one.  In Cyprus, I was diving double 12L
cylinders, but they were 200 bar, not the 232 bar ones Henrik has on the
list.

Also, I really think we should just have a checkbox for "double" instead
of naming them explicitly like this.  Henrik does have the 12L 200 bar
ones in his singles list.

But as a stop-gap, I'm just taking the values from Henrik's patch, but
converted to the new cleaned-up reference tank model setup.

Based-on-patch-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoClean up reference tank information table
Linus Torvalds [Sun, 11 Dec 2011 19:54:17 +0000 (11:54 -0800)]
Clean up reference tank information table

This makes the reference tanks ("struct tank_info") use a saner format
which specifies explicitly whether the size is in ml or cubic feet, and
whether the pressure is in psi or bar.

So instead of having magic rules ("size is in cuft if < 1000, otherwise
mliter"), just set the size explicitly:

{ "11.1 l", .ml = 11100 },
{ "AL80",  .cuft =  80, .psi = 3000 },

and then the code can just convert to standard measurements without any
odd rules, and the initialization table becomes self-explanatory too.

This is in preparation for doing the metric tanks with pressure: Henrik
Aronsen sent a really ugly patch using the previous setup, I just
couldn't stand the additional hackery.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake the cylinder table columns unsortable
Linus Torvalds [Sun, 11 Dec 2011 19:40:17 +0000 (11:40 -0800)]
Make the cylinder table columns unsortable

They were never intended to be sortable, but using common code with the
dive list picked up that "sort by index" thing by mistake.

If we really want to be able to sort cylinders by O2 percentage (which
really doesn't seem to make much sense, considering that you usually
have just one or two cylinders) we will need to also handle the case of
editing the (differently sorted) cylinder table.  Which we don't do now.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAllow editing of Helium values in cylinder info
Linus Torvalds [Sun, 11 Dec 2011 19:09:37 +0000 (11:09 -0800)]
Allow editing of Helium values in cylinder info

Henrik Aronsen points out that we've not made it possible to edit the He
percentages for trimix diving.  It's easy enough to do, I just didn't
have any dives that needed it myself.  So here goes.

Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoRound the maximum depth on dive list
Miika Turkia [Fri, 9 Dec 2011 16:56:34 +0000 (18:56 +0200)]
Round the maximum depth on dive list

Round maximum depth on dive list to get consistent data between the dive
list and dive info.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoUse common helper function for the "no cylinder info" case
Linus Torvalds [Fri, 9 Dec 2011 17:52:59 +0000 (09:52 -0800)]
Use common helper function for the "no cylinder info" case

Miika fixed the statistics code that didn't properly check for the "no
cylinder info" case - this cleans it up and just uses the helper
function in equipment.c.

Rename the helper to be slightly better named while at it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoShow O2 per cent if given in cylinder info
Miika Turkia [Fri, 9 Dec 2011 17:27:01 +0000 (19:27 +0200)]
Show O2 per cent if given in cylinder info

O2 per cent from dive computer should be shown in Dive Info if one is
given even without pressure information for the cylinder.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoSubsurface 1.2
Linus Torvalds [Thu, 8 Dec 2011 20:20:05 +0000 (12:20 -0800)]
Subsurface 1.2

With the whole UI change (three-paned window and different look with new
colors), let's just make a new release, as Dirk points out.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'stars' of git://git.hohndel.org/subsurface
Linus Torvalds [Thu, 8 Dec 2011 20:14:27 +0000 (12:14 -0800)]
Merge branch 'stars' of git://git.hohndel.org/subsurface

* 'stars' of git://git.hohndel.org/subsurface:
  Fix some issues with star rating code
  Add typical 0 to 5 star rating for dives

Still not great editing, but other than that it looks good.

12 years agoFix some issues with star rating code
Dirk Hohndel [Thu, 8 Dec 2011 04:49:22 +0000 (20:49 -0800)]
Fix some issues with star rating code

To waste less space in the tree view heading we simply put a star in the
heading instead of "Rating".

We now treat "zero stars" to mean "not rated" and don't store that value
in the XML file.

Rating is no longer a top level tag in the dive entry but instead a
property of the dive tag.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd typical 0 to 5 star rating for dives
Dirk Hohndel [Wed, 7 Dec 2011 19:58:16 +0000 (11:58 -0800)]
Add typical 0 to 5 star rating for dives

This works ok-ish, but doesn't allow us to click on the stars and edit
them in the divelist, which a user might expect to be able to do - in
most "star rating UIs" you simply click on the n-th star to set that
rating. Here you need to edit the dive and pick the rating from a drop
down menu.

Minor oddity: you can actually (if you force it) write anything you want
into the star rating. But anything that isn't one of the predefined
strings simply results in a zero star rating.

Overall the UI feels a bit... forced. But I think this is quite useful
anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMake view action shortcuts be ctrl-[1-4] instead of Fn keys
Linus Torvalds [Wed, 7 Dec 2011 16:08:29 +0000 (08:08 -0800)]
Make view action shortcuts be ctrl-[1-4] instead of Fn keys

Suggested by Henrik Aronsen, and seems much more natural.  Especially
with lots of keyboards having function keys oddly mapped.

Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd shorthand actions for showing just one of the panes
Linus Torvalds [Tue, 6 Dec 2011 21:00:01 +0000 (13:00 -0800)]
Add shorthand actions for showing just one of the panes

Currently just tied to F1-F4 (for divelist, profile, info, and "all
three" respectively), which is just crazy.  But using "ctrl-P" for
"Profile" isn't sane either, that's the standard printer keyboard
shortcut.  So what would be good keyboard shortcuts for these things?

I also wonder how I can get gtk to shut up about the fact that a pane
becomes too small for the contents of that pane? We very much want to do
that, and it's very intentional.  Gtk does the right thing apart from
the whining (and apart from the visually ugly part of a widget that
doesn't fit, but making it pretty doesn't really seem possible).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'grid-to-back' of git://github.com/henrik242/subsurface
Linus Torvalds [Tue, 6 Dec 2011 18:58:06 +0000 (10:58 -0800)]
Merge branch 'grid-to-back' of git://github.com/henrik242/subsurface

* 'grid-to-back' of git://github.com/henrik242/subsurface:
  Move depth/time grid back

12 years agoMove depth/time grid back
Henrik Brautaset Aronsen [Tue, 6 Dec 2011 18:42:20 +0000 (19:42 +0100)]
Move depth/time grid back

The temperature profile was behind the white depth/time grid.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoRemove commented code
Henrik Brautaset Aronsen [Thu, 1 Dec 2011 11:28:38 +0000 (12:28 +0100)]
Remove commented code

I left some printer-spesific commented code in there.  Away with it.

Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoClean up color definitions
Henrik Brautaset Aronsen [Thu, 1 Dec 2011 11:14:21 +0000 (12:14 +0100)]
Clean up color definitions

Fix ugly printout, give colors proper names, make grid lines and alert
marker easier to see, and specify printer colors independently.

Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoDefine all colors in one place
Henrik Brautaset Aronsen [Mon, 28 Nov 2011 17:17:33 +0000 (18:17 +0100)]
Define all colors in one place

The profile colors were defined all over the place, so I put them all in one spot.  I'm unsure if this is the best solution to that problem, but I guess it's a step in the right direction.

Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agoPrettier profile colors
Henrik Brautaset Aronsen [Mon, 28 Nov 2011 12:43:04 +0000 (13:43 +0100)]
Prettier profile colors

The profile colors aren't very pretty, and the grid lines are too thick.
This commit tries to improve that.

Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
12 years agomakefile: use dumpmachine instead of grep for Target
Martin Gysel [Sun, 27 Nov 2011 19:22:46 +0000 (20:22 +0100)]
makefile: use dumpmachine instead of grep for Target

grep for Target doesn't work on non english platforms
-dumpmachine is (hopefully) supposed to always return
the target machine tuple

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge git://github.com/JoachimSchipper/subsurface
Linus Torvalds [Sun, 27 Nov 2011 20:12:13 +0000 (12:12 -0800)]
Merge git://github.com/JoachimSchipper/subsurface

* git://github.com/JoachimSchipper/subsurface:
  README spelling, capitalization