aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-11-13Make sure SAC and OTU get recalculated after cylinder info was changedGravatar Dirk Hohndel
Also fixed minor coding style issues (prevent useless code from being executed). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-10Save cylinder O2/He content after the cylinder type descriptionGravatar Linus Torvalds
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>
2011-11-10Make the sample-vs-cylinder pressure check more liberalGravatar Linus Torvalds
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>
2011-11-09This should fix the missing end pressure for broken dive computersGravatar Dirk Hohndel
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>
2011-11-09Remove unused 'minpressure/endpressure' fields from plot infoGravatar Linus Torvalds
.. 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>
2011-11-09Merge branch 'bugfixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'bugfixes' of git://github.com/dirkhh/subsurface: Fix breakage caused by Linus' changes to tank pressure handling
2011-11-09Fix breakage caused by Linus' changes to tank pressure handlingGravatar Dirk Hohndel
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>
2011-11-09Merge branch 'testdata' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'testdata' of git://github.com/dirkhh/subsurface: Improve temperature text plotting in profile display
2011-11-09Improve temperature text plotting in profile displayGravatar Dirk Hohndel
- 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>
2011-11-09Merge branch 'testdata' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'testdata' of git://github.com/dirkhh/subsurface: Correctly plot dives ending below the surface
2011-11-09Add "enable" button for manual pressure settingGravatar Linus Torvalds
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>
2011-11-09Keep the start/end spinbuttons as GtkWidgetGravatar Linus Torvalds
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>
2011-11-09equipment: clean up cylinder pressure spinbutton setupGravatar Linus Torvalds
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>
2011-11-09Show the newly split pressures correctly in the equipment page tooGravatar Linus Torvalds
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>
2011-11-09Fix up the statistics page use of pressure dataGravatar Linus Torvalds
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>
2011-11-09Fix up air use calculations for new pressure handlingGravatar Linus Torvalds
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>
2011-11-09Don't save cylinder start/end pressures unless set by handGravatar Linus Torvalds
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>
2011-11-09If we don't have cylinder working pressure, we sill want to show the volumeGravatar Linus Torvalds
.. 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>
2011-11-09Correctly plot dives ending below the surfaceGravatar Dirk Hohndel
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>
2011-11-07don't use strftime() due to locale issuesGravatar Lubomir I. Ivanov
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>
2011-11-05Make the xslt style sheet finding search a set of possible pathsGravatar Linus Torvalds
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>
2011-11-05Use XSLT file to open JDiveLog logsGravatar Miika Turkia
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>
2011-11-04Fix missing pressure plot at start of the dive in some situationsGravatar Dirk Hohndel
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>
2011-11-04Don't test for liquid HeliumGravatar Dirk Hohndel
Simply accept temperatures that are above absolute zero. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-04Update test divesGravatar Dirk Hohndel
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>
2011-11-04Improve tank pressure plot for computers that create "gaschange" eventsGravatar Dirk Hohndel
This was exposed by the test dives, but it shows up in small ways with real dives from some dive computers like the Suunto Vyper Air. We now insert synthetic plot_info entries that match the gas change event; to make this look smoother we insert either two events (one for the old tank, one a second later for the new tank) if there is no sample at the time of the event, or one additional event (and move the real sample back by one second) if there is a sample at the time of the event. This does expose another issue with some dives from Linus' computer where the pressure in the samples dips below the end pressure noted for the tank - which creates an odd "yellow up-tick" at the end of using the first tank in the plot. Maybe we should not insert a synthetic "last of old tank" event if we have a sample with valid pressure in the last NN seconds before the gas change? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-04Don't repeat redundant minima or maxima in the profile plotGravatar Dirk Hohndel
If we have more than four identical depth readings, the old code would see those as local maxima and minima and print spurious depth values in the profile plot. Yes, in real sample data identical readings won't happen - but in synthetic data they can and there this looks really bogus. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-04Clear O2/H2 field if there is no tank informationGravatar Dirk Hohndel
Found using the new test dives Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-04Don't display a water temperature of absolute 0 in info/stats pageGravatar Dirk Hohndel
Found using the new test dives Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-04Replace Linus' dives with useful test dives that help test the appGravatar Dirk Hohndel
As much as Linus' dives may be fun to look at, they don't help us test the app. Writing these test dives I already found a couple of bugs - and I'm just getting started. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-02Work around some gtk oddity with gtk_combo_box_entries and empty textGravatar Linus Torvalds
Setting the gtk_combo_box_entry test to th eempty string doesn't "take": the old text remains. Which does all kinds of funky things when you switch between dives, and the location (or buddy or divemaster) entry contains some random stale entry from another dive. This works around it by using a string with a single space in it instead, and then removing the space when reading. Not pretty, and certainly not correct, but it pinpoints the odd behavior. I'm sure somebody will figure out what the magic gtk incantation is for this. Also remove the never-used flags for whether the entries have changed. They were designed to be set by change callbacks, but we never bothered with it, and just always read the value of the entries instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-02Merge branch 'add-info-stats-page' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'add-info-stats-page' of git://github.com/dirkhh/subsurface: Exclude obviously bogus SAC values from statistics calculations
2011-11-02Exclude obviously bogus SAC values from statistics calculationsGravatar Dirk Hohndel
Random cutoff is 2.8l/min (or about 0.1cuft/min) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-02Merge branch 'drag-n-drop-fix' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'drag-n-drop-fix' of git://github.com/dirkhh/subsurface: Fix drag and drop error
2011-11-02Fix drag and drop errorGravatar Dirk Hohndel
Linus noted an odd "CRITICAL" warning when ripping off a page of the notebook and then dropping it within the same notebook. Turns out we need to simply accept a drop on ourselves and gtk does the rest correctly. I also fixed the fact that we incorrectly declared the callback as 'void'. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-02Merge branch 'add-info-stats-page' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'add-info-stats-page' of git://github.com/dirkhh/subsurface: Fix typo that broke min SAC calculation Surface interval is calculated from the END of previous dive
2011-11-02Fix typo that broke min SAC calculationGravatar Dirk Hohndel
Actually more of a cut'n'paste-o Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-02Surface interval is calculated from the END of previous diveGravatar Dirk Hohndel
Silly mistake Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-02Merge branch 'add-info-stats-page' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'add-info-stats-page' of git://github.com/dirkhh/subsurface: Add Info & Stats page to the notebook Even more places with pressure and volume conversions Further cleanup of pressure and volume conversions Use unit functions to get column headers, add unit function for pressure More consistency improvements Add new helper function to get temperature and unit
2011-11-02Add Info & Stats page to the notebookGravatar Dirk Hohndel
This provides the relevant information for the currently selected dive plus a bunch of statistics over all dives in the dive_table. The visual design has lots of room for improvement - right now the different fields change size - it might be nice to have a more modern look for the entries - the O2/He field is odd - for most divers the He value will always be 0, so maybe we should only show He if there's at least one dive that uses He? Also, we simply do a comma separated list of gases for all the tanks used Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-01Even more places with pressure and volume conversionsGravatar Dirk Hohndel
Amazing at how many spots we are re-implementing the wheel. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-01Further cleanup of pressure and volume conversionsGravatar Dirk Hohndel
I'm amazed at how many spots we were doing conversions - some of them subtly different than others. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-01Use unit functions to get column headers, add unit function for pressureGravatar Dirk Hohndel
Finally getting more consistent overall in how we convert between the different units and how we decide which units to display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-01More consistency improvementsGravatar Dirk Hohndel
Treat SAC and OTU consistently: - SAC is now a member of struct dive - it's calculated / populated at the same time with a helper function with consistent API Create get_volume_units function that returns volumes (e.g. used in SAC rates) based on preferred units - make sure we have these conversions just once in the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-01Add new helper function to get temperature and unitGravatar Dirk Hohndel
Designed along the lines of get_depth_units - except we don't define a specific number of digits to show. Use this in the one spot we need it right now in profile.c Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-11-01Fix 'init_ui()' so that it can change argc/argvGravatar Linus Torvalds
That's what gtk_init() does with gtk-specific arguments. IOW, if you do things like subsurface --g-fatal-warnings dives.xml to get a real abort on gtk warnings, gtk_init needs to be able to actually change argc/argv. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31Using RegQueryValueEx instead of RegGetValueGravatar Lubomir I. Ivanov
Provides compatibility with winxp-32bit in gtk-gui.c, since RegGetValue is only available on the 64bit build of the OS. Fixed whitespace issues, fixed obvious typo (this patch clearly wasn't even compile tested) Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-31win32/nsi: added confirmation to store registry settingsGravatar Lubomir I. Ivanov
a yes/no dialog to clear or store data in HKCU "SOFTWARE\subsurface" "Do you wish to store subsurface's settings?" fixed small whitespace issue Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-31Merge branch 'macosx-app-bundle-1' of git://github.com/henrik242/subsurfaceGravatar Linus Torvalds
* 'macosx-app-bundle-1' of git://github.com/henrik242/subsurface: Use the new packaging directory for MacOSX specific files, and provide shell script workaround to make the svg icon reachable. Ignore process serial number argument when run as native MacOSX app Add basic MacOSX app bundle install target
2011-10-31Add Debian packagingGravatar Roland Dreier
Add support for building .deb packages; to use, one can do $ cp -r packaging/debian debian $ dpkg-buildpackage -b This of course requires a libdivecomputer package as a build prerequisite. Signed-off-by: Roland Dreier <roland@digitalvampire.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>