]> git.tdb.fi Git - ext/subsurface.git/log
ext/subsurface.git
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

12 years agoMerge branch 'windows-fixes' of git://git.hohndel.org/subsurface
Linus Torvalds [Sun, 27 Nov 2011 20:07:49 +0000 (12:07 -0800)]
Merge branch 'windows-fixes' of git://git.hohndel.org/subsurface

* 'windows-fixes' of git://git.hohndel.org/subsurface:
  fix mingw-win32 specific warnings in libdivecomputer.c
  Fix mingw-make.sh to find correct xslt-config

12 years agoREADME spelling, capitalization
Joachim Schipper [Sun, 27 Nov 2011 16:53:14 +0000 (17:53 +0100)]
README spelling, capitalization

Spelling: paragrahps -> paragraphs.

Update the README's example commit message to start with a capital
letter. Capitalize "Java".

Signed-off-by: Joachim Schipper <joachim@joachimschipper.nl>
12 years agofix mingw-win32 specific warnings in libdivecomputer.c
Dirk Hohndel [Sun, 27 Nov 2011 17:10:37 +0000 (09:10 -0800)]
fix mingw-win32 specific warnings in libdivecomputer.c

1) since %lld is not defined in the MSVC runtime, use
the portable PRId64 macro from inttypes.h for 64bit integers

notice in inttypes.h from mingw-win32:
/* 7.8.1 Macros for format specifiers
 *
 * MS runtime does not yet understand C9x standard "ll"
 * length specifier. It appears to treat "ll" as "l".
 * The non-standard I64 length specifier causes warning in GCC,
 * but understood by MS runtime functions.
 */

2) include unistd.h to disable warning:
warning: implicit declaration of function 'usleep'

Lubomir's code then caused a warning building natively under Linux, which
I fixed as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
12 years agoFix mingw-make.sh to find correct xslt-config
Dirk Hohndel [Sun, 27 Nov 2011 17:08:55 +0000 (09:08 -0800)]
Fix mingw-make.sh to find correct xslt-config

I hadn't noticed that xslt was available as cross built library as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'windows-fixes' of git://git.hohndel.org/subsurface
Linus Torvalds [Sat, 26 Nov 2011 05:51:34 +0000 (21:51 -0800)]
Merge branch 'windows-fixes' of git://git.hohndel.org/subsurface

* 'windows-fixes' of git://git.hohndel.org/subsurface:
  Add more typecasts for Windows`
  Fix the Windows preferences support
  Update the Windows installer creation script

12 years agoRemove stale notebook drag-and-drop support
Linus Torvalds [Sat, 26 Nov 2011 05:50:38 +0000 (21:50 -0800)]
Remove stale notebook drag-and-drop support

It doesn't make sense with the new three-pane layout, and I don't think
we're reviving it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd more typecasts for Windows`
Dirk Hohndel [Sat, 26 Nov 2011 04:09:01 +0000 (20:09 -0800)]
Add more typecasts for Windows`

This is based on an older patch by Lubomir I. Ivanov <neolit123@gmail.com>
which no longer applies due to the refactoring of the registry setting
code.

It takes care of all of the casts between actual C types and the Windows
specific types that the Windows API functions expect. It also adds some
comments to the overloading of "value" in our subsurface_set_conf function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix the Windows preferences support
Dirk Hohndel [Sat, 26 Nov 2011 03:48:53 +0000 (19:48 -0800)]
Fix the Windows preferences support

Now that I can test Windows binaries again, the bugs were rather easy to
spot. Because of the different flow of the opening, writing and closing of
the registry key my first attempt got things wrong - we simply always
create the key with all access rights; if it exists Windows will just open
it for us. The second bug was a cut'n'paste error.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUpdate the Windows installer creation script
Dirk Hohndel [Sat, 26 Nov 2011 03:39:30 +0000 (19:39 -0800)]
Update the Windows installer creation script

This now works with a straight out of the box MinGW install on OpenSUSE.
A simple shell script that shows how to invoke the cross build is
included.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoImprove cross compile support and fix windows.c
Dirk Hohndel [Fri, 25 Nov 2011 06:32:10 +0000 (22:32 -0800)]
Improve cross compile support and fix windows.c

This should make the Makefile much more robust when cross compiling.

The windows.c code is now compile tested but not functionally tested.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'mac-fixes' of git://git.hohndel.org/subsurface
Linus Torvalds [Thu, 24 Nov 2011 18:42:37 +0000 (10:42 -0800)]
Merge branch 'mac-fixes' of git://git.hohndel.org/subsurface

* 'mac-fixes' of git://git.hohndel.org/subsurface:
  Split reading/writing preferences into OS specific files

12 years agoSplit reading/writing preferences into OS specific files
Dirk Hohndel [Thu, 24 Nov 2011 06:56:57 +0000 (22:56 -0800)]
Split reading/writing preferences into OS specific files

This adds tested code for Linux and Mac OS, implementing the api that
Linus suggested.

The Windows code was moved into its own file, but hasn't even been compile
tested, yet.

In order to have just one interface to set or get a preference value we
encode TRUE as (void *) 1 and FALSE as NULL. This works consistently on
all platforms and regardless of whether we have 32 or 64 bit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'mac-fixes' of git://git.hohndel.org/subsurface
Linus Torvalds [Tue, 22 Nov 2011 23:57:08 +0000 (15:57 -0800)]
Merge branch 'mac-fixes' of git://git.hohndel.org/subsurface

* 'mac-fixes' of git://git.hohndel.org/subsurface:
  Preference handling on Mac

12 years agoPreference handling on Mac
Dirk Hohndel [Tue, 22 Nov 2011 20:20:36 +0000 (12:20 -0800)]
Preference handling on Mac

This cleans up the platform conditional handling and gets rid of gconf on the Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoExclude surface intervals from sac rate calculation
Dirk Hohndel [Mon, 21 Nov 2011 21:23:13 +0000 (13:23 -0800)]
Exclude surface intervals from sac rate calculation

We assume every sample with a depth of less than 10cm to be on the
surface.

This does not impact our interpolated pressures (one could assume that the
diver is not breathing from the regulator when on the surface - but
without air integration that's just an assumption).

It also doesn't change our tank pressure coloring by sac rate as that
always uses the momentary sac rate. Technically speaking this might impact
the actual colors printed (as those are relative to the total sac on the
dive which may go up due to this change).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoDon't colorize the pressure plot when printing
Dirk Hohndel [Mon, 21 Nov 2011 20:35:42 +0000 (12:35 -0800)]
Don't colorize the pressure plot when printing

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd debugging function to dump tank pressure tracking data
Dirk Hohndel [Mon, 21 Nov 2011 20:29:16 +0000 (12:29 -0800)]
Add debugging function to dump tank pressure tracking data

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove suunto parsing hacks from parse-xml.c
Linus Torvalds [Mon, 21 Nov 2011 19:35:06 +0000 (11:35 -0800)]
Remove suunto parsing hacks from parse-xml.c

We can just depend on Miika's xslt transform instead.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoXSLT to import SDM dive log
Miika Turkia [Wed, 16 Nov 2011 05:12:44 +0000 (07:12 +0200)]
XSLT to import SDM dive log

This is tested with Linus' sample data, all basic functionality seems to
be working properly. Gas changes are implemented but not tested as there
was no samples of those. Multiple cylinders are missing because there
was no samples available.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoSupport for importing multiple XSLT formats
Miika Turkia [Wed, 16 Nov 2011 05:12:43 +0000 (07:12 +0200)]
Support for importing multiple XSLT formats

Have information of multiple XSLT files on an array for importing
"alien" formatted XML dive log files. Adding support for new XSLT
requires updating the array and adding the XSLT file (provided the
format can be identified by root element of the XML).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'multi-pane'
Linus Torvalds [Sun, 20 Nov 2011 18:35:27 +0000 (10:35 -0800)]
Merge branch 'multi-pane'

* multi-pane:
  Experimental hard-coded three-pane layout

Ok, so it's not perfect, but I've been using a version of this for the
last week or so by now, and every time I go back to the old layout I
just cringe.

So the three-pane window approach requires much more display area, and
probably wouldn't work wonderfully on low-resolution devices (ie 720x480
or even 1024x600).  So for anybody doing a cellphone port, you may need
to play around with the interface.  But this should be usable even on a
netbook, although not as good as on a device with more pixels.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDo proper rounding in interpolated pressure calculations
Linus Torvalds [Sun, 20 Nov 2011 18:27:33 +0000 (10:27 -0800)]
Do proper rounding in interpolated pressure calculations

We do all the pressures in mbar, which has plenty of precision for
interpolated pressures - even when we then do our discrete integration
over many samples.

However, when we calculate those interpolated pressure points, we should
make sure that we round the result correctly, otherwise the consistent
rounding errors (from truncating the FP value into our integer mbar
values) will result in a final pressure that is noticeably off in ugly
ways (ie "end pressure set by hand to 750 mbar, but shown as 748").

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoRevert "Correctly plot the tank end pressure if it was set manually"
Linus Torvalds [Sun, 20 Nov 2011 18:27:19 +0000 (10:27 -0800)]
Revert "Correctly plot the tank end pressure if it was set manually"

This reverts commit abdee5b1b8a97c641bca9bc2ebac9555c3e2ea54.

There's no point in doing random hacks.  Instead, do the intermediate
pressure calculations with proper rounding instead of always truncating
to mbar.  With the math done correctly we have enough precision that the
end result of the pressure interpolation doesn't have the kind of errors
that caused Dirk to try to fix things up later.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'sacplot' of git://git.hohndel.org/subsurface
Linus Torvalds [Sat, 19 Nov 2011 21:22:21 +0000 (13:22 -0800)]
Merge branch 'sacplot' of git://git.hohndel.org/subsurface

* 'sacplot' of git://git.hohndel.org/subsurface:
  Fix error when gaschange event is one second before next sample

12 years agoFix error when gaschange event is one second before next sample
Dirk Hohndel [Sat, 19 Nov 2011 21:18:10 +0000 (13:18 -0800)]
Fix error when gaschange event is one second before next sample

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix the Makefile '-c' location, add XML2CFLAGS
Terrance Stanfield [Sat, 19 Nov 2011 17:28:31 +0000 (11:28 -0600)]
Fix the Makefile '-c' location, add XML2CFLAGS

I was getting the following error:

   dive.h:8:25: fatal error: libxml/tree.h: No such file or directory
   compilation terminated.

So I updated the Makefile to fix that error and follow the standard in
the file.

Signed-off-by: Terrance Stanfield <t@hollowcranium.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'sacplot' of git://git.hohndel.org/subsurface
Linus Torvalds [Sat, 19 Nov 2011 20:59:48 +0000 (12:59 -0800)]
Merge branch 'sacplot' of git://git.hohndel.org/subsurface

* 'sacplot' of git://git.hohndel.org/subsurface:
  Correctly plot the tank end pressure if it was set manually

12 years agoExperimental hard-coded three-pane layout
Linus Torvalds [Sat, 19 Nov 2011 20:54:58 +0000 (12:54 -0800)]
Experimental hard-coded three-pane layout

I'm not happy with it, but it looks good and works better than the
alternatives I've looked at so far.

So why not happy? It's not configurable, and gtk really doesn't do a
great job with the case of notebook widgets that are shrunk to be
smaller than the contents (the cut-off gets ugly, and is outside the
notebook page!)

But committing as a way to keep track of this, and let Dirk use it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoCorrectly plot the tank end pressure if it was set manually
Dirk Hohndel [Sat, 19 Nov 2011 20:47:07 +0000 (12:47 -0800)]
Correctly plot the tank end pressure if it was set manually

While printing the last pressure in the calculated sequence may seem more
logical, given that the discrete series will create some amount of error
this simply looks wrong. Instead we pick the end pressure that was
manually set.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'sacplot' of git://git.hohndel.org/subsurface
Linus Torvalds [Sat, 19 Nov 2011 20:25:35 +0000 (12:25 -0800)]
Merge branch 'sacplot' of git://git.hohndel.org/subsurface

* 'sacplot' of git://git.hohndel.org/subsurface:
  Make pressure plot shading by sac rate consistent
  Improve tank pressure sac coloring
  Be more consistent in our handling of rgb value tables
  Remove redundant linear sample tank pressure data

12 years agoMake pressure plot shading by sac rate consistent
Dirk Hohndel [Sat, 19 Nov 2011 19:43:37 +0000 (14:43 -0500)]
Make pressure plot shading by sac rate consistent

Some parts of the existing code used the depth at the time of the sample
to calculate the sac rate - it makes much more sense to use the average
depth. But that requires us to loop over the entries and average the
individual sac rates per segment instead of just using the beginning and
end depth of the multi-segment interval we use for smoothing purposes.

This may seem like a subtle detail, but it does in fact matter when we
plot the synthetic tank pressure values that we create when we have no
tank pressure data in the samples.

Another detail we change here is to not artificially start with a forward
looking segment of the full SAC_WINDOW but instead just start with the
first two data points and then simply let the time window grow until it
hits SAC_WINDOW - at which point it becomes a sliding window.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoImprove tank pressure sac coloring
Dirk Hohndel [Sat, 19 Nov 2011 19:39:35 +0000 (14:39 -0500)]
Improve tank pressure sac coloring

This changes the algorithm that picks the sac color to consider
+/- 1 l/min to be the same color (before the color changed every
time you crossed above or below the average which looked silly with
our synthetic "constant sac" values as those are discrete and oscilate
around the average.

This also changes the order in which things are drawn so so that the
pressure plot goes over the depth profile plot (so the red shading of the
dive no longer changes the color of the tank pressure plot).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoBe more consistent in our handling of rgb value tables
Dirk Hohndel [Sat, 19 Nov 2011 15:17:19 +0000 (10:17 -0500)]
Be more consistent in our handling of rgb value tables

Use rgb_t for the sac colors, create a new set_source_rgb_struct function
and use that for the velocity values (in the depth plot) as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove redundant linear sample tank pressure data
Dirk Hohndel [Sat, 19 Nov 2011 12:09:14 +0000 (07:09 -0500)]
Remove redundant linear sample tank pressure data

I've seen at least DivingLog do this. If you manually enter beginning and
end pressure for a tank it will either linearize the samples in between or
offer to simulate a dive (with constant SAC rate). At least the first case
is reasonably easy to detect. We throw out those samples and ensure that
we still have valid beginning and end pressure for that dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd the cylinder list to the dive info edit dialog
Linus Torvalds [Sat, 19 Nov 2011 19:47:04 +0000 (11:47 -0800)]
Add the cylinder list to the dive info edit dialog

This way, when you have a new dive that you just imported from your dive
computer, you can just double-click on the dive and fill out all the
relevant information: location, notes, buddies and cylinder info.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd dive number and date to the dive info edit dialog
Linus Torvalds [Sat, 19 Nov 2011 17:23:58 +0000 (12:23 -0500)]
Add dive number and date to the dive info edit dialog

It's pretty basic information, and might be hidden behind the dialog
especially on a small screen.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd an 'edit' menu item to the dive info text fields
Linus Torvalds [Sat, 19 Nov 2011 17:06:20 +0000 (12:06 -0500)]
Add an 'edit' menu item to the dive info text fields

It just pops up the dive info edit box.  This way you can be in the dive
info tab, and not have to go to the dive list just to double-click on
the dive.

This thing still needs some polish, but it's now usable.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake double-clicking on the dive list bring up the dive editor
Linus Torvalds [Sat, 19 Nov 2011 15:11:56 +0000 (10:11 -0500)]
Make double-clicking on the dive list bring up the dive editor

Now that the dive info window is read-only, we need to edit the dives
some other way.  We bring up a dive info edit dialog when you
double-click on the dive list entry for that dive.

I do want to have an "edit" button or keyboard shortcut or something
too, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake all the normal widgets uneditable and non-focusing
Linus Torvalds [Fri, 18 Nov 2011 13:13:02 +0000 (11:13 -0200)]
Make all the normal widgets uneditable and non-focusing

We always keep the focus on the dive list, so that the random gtk focus
handling doesn't suddenly randomly make us edit the combo boxes when the
cursor up/down keys start changing them instead of the dive list.

This means that dive location, notes and buddy/divemaster aren't
editable at all any more, but I'll fix that by making a separate dive
edit popup window.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'sacplot' of git://github.com/dirkhh/subsurface
Linus Torvalds [Fri, 18 Nov 2011 12:14:37 +0000 (10:14 -0200)]
Merge branch 'sacplot' of git://github.com/dirkhh/subsurface

* 'sacplot' of git://github.com/dirkhh/subsurface:
  Color tank pressure plot based on relative sac

12 years agoColor tank pressure plot based on relative sac
Dirk Hohndel [Fri, 18 Nov 2011 11:57:49 +0000 (09:57 -0200)]
Color tank pressure plot based on relative sac

Linus suggested that instead of using absolute SAC values to base the
color on (which forced us to pre-define which SAC rates are green and
which are red) we should color the tank pressure plot relative to the avg
SAC rate of that dive - which I think makes the coloring much more useful
to spot when on your dive you were doing well and when you were not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'sacplot' of git://github.com/dirkhh/subsurface
Linus Torvalds [Thu, 17 Nov 2011 20:38:46 +0000 (18:38 -0200)]
Merge branch 'sacplot' of git://github.com/dirkhh/subsurface

* 'sacplot' of git://github.com/dirkhh/subsurface:
  Color pressure plot according to current SAC rate
  Fix minor coding standard issues introduced by my last commit

12 years agoColor pressure plot according to current SAC rate
Dirk Hohndel [Thu, 17 Nov 2011 02:34:50 +0000 (00:34 -0200)]
Color pressure plot according to current SAC rate

Similar to color indicating vertical speed in the profile plot we now use
color in the tank pressure plot to indicate current SAC rate.

We use a 45 sec sliding window to make sure we cover at least two breaths
for each current SAC sample to avoid artificial oscillation based on
breathing rhythm for corputers with high sample resolution.

Not sure about the color coding that I'm using right now - it's green-ish
for SAC rates under 15l/min ~= .55cuft/min and turns yellow and red as you
go higher. That seems to work well for me, but for other divers this may
be way off (or at least not as useful). Maybe this should be configurable?
This is a lot more diver specific than the vertical velocity where there
are clear recommendations based on safety considerations on what is good
and bad.

As a side effect, this removes the color coding that showed you whether
you were looking at pressure data from samples (green) vs. interpolated
pressure data (yellow). Not sure if people really want to see that. We
might be able to indicate this differently (I am thinking different line
width or transparency or something along those line)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove redundant duplicate pressure samples
Linus Torvalds [Thu, 17 Nov 2011 14:03:11 +0000 (12:03 -0200)]
Remove redundant duplicate pressure samples

At least the Suunto pressure transmitter seems to be pretty
"quantisized", and it will send identical samples for a while until the
pressure changes enough.  Then subsurface gives this silly flat line
with a sudden jump downwards, which *could* be you suddenly taking a
deep breath after holding it for a while, but almost certainly it's a
sensor issue.

So just remove successive identical pressure readings.  They aren't
interesting, and subsurface will actually do a good job of interpolating
it according to SAC rate instead.  And they just make the XML look
worse.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoShow dives "latest-first" by default
Linus Torvalds [Wed, 16 Nov 2011 18:30:34 +0000 (16:30 -0200)]
Show dives "latest-first" by default

You can still order them by date by just setting the sort order on the
date column, but normally you'd be more interested in the most recent
dives.

I tried to just scroll down to the last ones automatically instead, but
gtk makes that *really* hard to do.  If you do it in the natural place
for it, the scroll bar wll show up later and then cover up the last
entry anyway.  So you'd have to do some crazy expose event thing or
something.  Which may be the right thing to do eventually anyway, but
not worth the pain right now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoShow more of the dive location in the dive list
Linus Torvalds [Wed, 16 Nov 2011 18:29:38 +0000 (16:29 -0200)]
Show more of the dive location in the dive list

Randomly picked up to 60 characters.  But maybe we should just get rid
of the limit entirely.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix minor coding standard issues introduced by my last commit
Dirk Hohndel [Sun, 13 Nov 2011 17:51:34 +0000 (15:51 -0200)]
Fix minor coding standard issues introduced by my last commit

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'forlinus' of git://github.com/dirkhh/subsurface
Linus Torvalds [Sun, 13 Nov 2011 17:41:05 +0000 (15:41 -0200)]
Merge branch 'forlinus' of git://github.com/dirkhh/subsurface

* 'forlinus' of git://github.com/dirkhh/subsurface:
  Make sure SAC and OTU get recalculated after cylinder info was changed

12 years agoMake sure SAC and OTU get recalculated after cylinder info was changed
Dirk Hohndel [Sun, 13 Nov 2011 17:29:07 +0000 (15:29 -0200)]
Make sure SAC and OTU get recalculated after cylinder info was changed

Also fixed minor coding style issues (prevent useless code from being
executed).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix the stupid gtk combo box text reset issue for real
Linus Torvalds [Sun, 13 Nov 2011 17:17:38 +0000 (15:17 -0200)]
Fix the stupid gtk combo box text reset issue for real

Lubomir's solution to fill them with a newline doesn't work.  Well, it
may work on some versions of gtk, but on mine it just results in an ugly
box for the control character '000a' that tries to show the newline.

So this is a third approach: if we reset the text to empty, first set it
to space (to clear it), and then set it to empty.  That seems to work on
at least one version of gtk, and doesn't have the problem with the space
*remaining* when you cut-and-paste something into the combo box.

Let's see if it breaks anything else, but at worst it should be no worse
than the old "set it to space" approach - iow the combo box might
remember the space, but at least not some random data from the previous
dive that it happened to show.

Lovely gtk bugs.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agogtk_combo_box_entries and empty text
Lubomir I. Ivanov [Thu, 3 Nov 2011 20:44:04 +0000 (22:44 +0200)]
gtk_combo_box_entries and empty text

Passing -1 to gtk_combo_box_set_active, seems not to work as the gtk
documentation explains; there might be a bug in the library or some
special case that is not explained.

could be related to:
  http://mail.gnome.org/archives/gtk-devel-list/2004-March/msg00170.html

passing \n seems to "trick" the cell renderer to clear the entry
completely.  This is a temporary solution.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoSave cylinder O2/He content after the cylinder type description
Linus Torvalds [Thu, 10 Nov 2011 23:42:37 +0000 (21:42 -0200)]
Save cylinder O2/He content after the cylinder type description

This changes the save format xml to be a bit more readable: instead of
putting the gasmix first, put the cylinder type (size, workpressure and
description) first, then gasmix, then pressure details.

It makes no difference for machine parsing, but I think it's a lot more
logical for humans that actually look at the xml file.  And we really do
want to make the xml file readable by humans.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake the sample-vs-cylinder pressure check more liberal
Linus Torvalds [Thu, 10 Nov 2011 23:33:38 +0000 (21:33 -0200)]
Make the sample-vs-cylinder pressure check more liberal

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>
12 years agoThis should fix the missing end pressure for broken dive computers
Dirk Hohndel [Thu, 10 Nov 2011 01:15:48 +0000 (20:15 -0500)]
This should fix the missing end pressure for broken dive computers

Some dive computers randomly drop samples. That was no problem unless it
was the LAST sample. We work around that now

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove unused 'minpressure/endpressure' fields from plot info
Linus Torvalds [Thu, 10 Nov 2011 00:37:18 +0000 (19:37 -0500)]
Remove unused 'minpressure/endpressure' fields from plot info

.. and fix the maxpressure to actually look at *all* the cylinders, so
that if you don't have sample data, but rely onmanually set cylinder
pressures, it now really is the max of all the cylinders.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'bugfixes' of git://github.com/dirkhh/subsurface
Linus Torvalds [Thu, 10 Nov 2011 00:23:59 +0000 (19:23 -0500)]
Merge branch 'bugfixes' of git://github.com/dirkhh/subsurface

* 'bugfixes' of git://github.com/dirkhh/subsurface:
  Fix breakage caused by Linus' changes to tank pressure handling

12 years agoFix breakage caused by Linus' changes to tank pressure handling
Dirk Hohndel [Thu, 10 Nov 2011 00:15:28 +0000 (19:15 -0500)]
Fix breakage caused by Linus' changes to tank pressure handling

We no longer look at the start and end pressure for a tank, if the tank
has valid pressure data in its samples (which makes sense). Sadly that
breaks the current pressure interpolation code. With this patch most of
those problems should be fixed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'testdata' of git://github.com/dirkhh/subsurface
Linus Torvalds [Wed, 9 Nov 2011 23:24:09 +0000 (18:24 -0500)]
Merge branch 'testdata' of git://github.com/dirkhh/subsurface

* 'testdata' of git://github.com/dirkhh/subsurface:
  Improve temperature text plotting in profile display

12 years agoImprove temperature text plotting in profile display
Dirk Hohndel [Wed, 9 Nov 2011 21:01:11 +0000 (13:01 -0800)]
Improve temperature text plotting in profile display

- make the text a lighter color so it stands out more
- change the heuristic when we print text to include both relative change
  in temperature and time since the last text was printed
- print the first temperature we encounter
- allow an ending temperature to be printed if the last printed
  temperature was before the 75% mark of the dive

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'testdata' of git://github.com/dirkhh/subsurface
Linus Torvalds [Wed, 9 Nov 2011 18:31:06 +0000 (12:31 -0600)]
Merge branch 'testdata' of git://github.com/dirkhh/subsurface

* 'testdata' of git://github.com/dirkhh/subsurface:
  Correctly plot dives ending below the surface

12 years agoAdd "enable" button for manual pressure setting
Linus Torvalds [Wed, 9 Nov 2011 16:51:20 +0000 (08:51 -0800)]
Add "enable" button for manual pressure setting

This grays out the pressure settings in the cylinder editing widget if
the pressure data has been taken from the samples.  You can still
manually override the data, but you now need to enable that manual
override explicitly.

This makes the semantics of editing start/end pressures of dives with
pressure sample data a bit more intuitive, I think.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoKeep the start/end spinbuttons as GtkWidget
Linus Torvalds [Wed, 9 Nov 2011 16:37:49 +0000 (08:37 -0800)]
Keep the start/end spinbuttons as GtkWidget

For graying things out, we want a widget, not a spinbutton.  Although
I'm sure we could just cast things back and forth.  But let's be
consistent with what we do, and only ever cast from GtkWidget to
GtkSpinButton, and have the same logic as for the "o2" widget that also
needs to be explicitly enabled.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoequipment: clean up cylinder pressure spinbutton setup
Linus Torvalds [Wed, 9 Nov 2011 16:33:13 +0000 (08:33 -0800)]
equipment: clean up cylinder pressure spinbutton setup

This is just in case I end up doing the graying out of implicit pressure
information: I wanted to clean things up a bit first.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoShow the newly split pressures correctly in the equipment page too
Linus Torvalds [Wed, 9 Nov 2011 16:21:48 +0000 (08:21 -0800)]
Show the newly split pressures correctly in the equipment page too

NOTE! When *editing* the cylinder data, the only thing shown is the
non-sample pressure.  So the cylinder editing widget will show zero for
start/end pressure for a dive that has pressure saples without any
manually set pressure data.

This is intentional, so that you can clearly see that this is not a set
value.  But it may be that we should gray out the spinputton and have an
"edit value" checkbox or something to make it really obvious.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix up the statistics page use of pressure data
Linus Torvalds [Wed, 9 Nov 2011 16:06:17 +0000 (08:06 -0800)]
Fix up the statistics page use of pressure data

The statistics page calculates air use separately, and also needs to be
fixed up for the split of the pressures into sample-vs-start/end.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix up air use calculations for new pressure handling
Linus Torvalds [Wed, 9 Nov 2011 15:51:00 +0000 (07:51 -0800)]
Fix up air use calculations for new pressure handling

Make sure that we calculate air use by using the proper start/end
pressures, with the manually set ones being used preferentially over any
possible sample data.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDon't save cylinder start/end pressures unless set by hand
Linus Torvalds [Wed, 9 Nov 2011 15:37:25 +0000 (07:37 -0800)]
Don't save cylinder start/end pressures unless set by hand

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>
12 years agoIf we don't have cylinder working pressure, we sill want to show the volume
Linus Torvalds [Wed, 9 Nov 2011 15:56:07 +0000 (07:56 -0800)]
If we don't have cylinder working pressure, we sill want to show the volume

.. although in that case we can only ever show the volume in liters, and
cannot do a conversion to cubic feet even if the user has set imperial
units.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoCorrectly plot dives ending below the surface
Dirk Hohndel [Wed, 9 Nov 2011 15:41:41 +0000 (07:41 -0800)]
Correctly plot dives ending below the surface

I thought we had fixed this before - but I guess it got broken again
somewhere. We now make sure that the plot_info ends on an entry with
depth 0.

Added test14 to verify the fix.

Also fixed cut'n'paste errors in a few test dive files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agodon't use strftime() due to locale issues
Lubomir I. Ivanov [Mon, 7 Nov 2011 05:33:49 +0000 (07:33 +0200)]
don't use strftime() due to locale issues

Make statistics.c use snprintf() with weekday(), monthname() instead of
strftime().  The mingw strftime() ends up having lots of problems at
least on Windows unless you set the locale just right, so just avoid the
problem by doing the simple function by hand.  We already did that in
other places anyway.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake the xslt style sheet finding search a set of possible paths
Linus Torvalds [Sat, 5 Nov 2011 20:51:37 +0000 (13:51 -0700)]
Make the xslt style sheet finding search a set of possible paths

This allows us to install the xslt files in multiple places.  Right now
the path defaults to the subsurface xslt install directory, the relative
directory "xslt" and the current working directory.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoUse XSLT file to open JDiveLog logs
Miika Turkia [Sat, 5 Nov 2011 10:39:17 +0000 (12:39 +0200)]
Use XSLT file to open JDiveLog logs

Open JDiveLog files by translating them to subsurface format using XSLT.
These files are identified by the name of the first element (JDiveLog)
and transform is applied to only these.

The XSLT feature is compiled in only if libxslt is installed. The
transformation files are installed globally in Linux under
/usr/share/subsurface/xslt. Windows and OSX still need appropriate Makefile
changes and testing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix missing pressure plot at start of the dive in some situations
Dirk Hohndel [Fri, 4 Nov 2011 22:34:30 +0000 (15:34 -0700)]
Fix missing pressure plot at start of the dive in some situations

In some situations we could end up with no sample pressure and no
interpolated pressure at time = 0. This is now fixed.

Fix notes in test dive the exposed the issue.

Also change the code in create_plot_info to keep the number of samples and
the number of corresponding pi entries in separate variables. This avoids
future changes from breaking if they assume they can access
dive->sample[nr_samples - 1] (which is a reasonable assumption to make).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoDon't test for liquid Helium
Dirk Hohndel [Fri, 4 Nov 2011 22:09:56 +0000 (15:09 -0700)]
Don't test for liquid Helium

Simply accept temperatures that are above absolute zero.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUpdate test dives
Dirk Hohndel [Fri, 4 Nov 2011 21:54:22 +0000 (14:54 -0700)]
Update test dives

The notes now reflect things that were fixed in the last commits.
Also added more test dives to test other boundary cases.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>