aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2012-01-27Add some initial cochran CAN file parsingGravatar Linus Torvalds
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>
2012-01-27Import: always open and read the file before checking the filename extensionGravatar Linus Torvalds
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>
2012-01-27Fix typo ('suundo' instead of 'suunto')Gravatar Linus Torvalds
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>
2012-01-26Add "native" Suunto SDE zip file readingGravatar Linus Torvalds
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>
2012-01-26Split up file reading from 'parse-xml.c' into 'file.c'Gravatar Linus Torvalds
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>
2012-01-17Merge branch 'info-split' of git://git.hohndel.org/subsurfaceGravatar Linus Torvalds
* '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
2012-01-15Link with libm for 'pow()'Gravatar Cristian Ionescu-Idbohrn
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>
2012-01-15Add statistics for longest, shortest, and shallowest diveGravatar Dirk Hohndel
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>
2012-01-15Create separate single dive and total stats pagesGravatar Dirk Hohndel
No additional statistics added, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-15Separate out single dive statistics and total statisticsGravatar Dirk Hohndel
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>
2012-01-05Avoiding some potentially confusing name space clashesGravatar Dirk Hohndel
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>
2012-01-05More removal of unused argumentsGravatar Dirk Hohndel
Just trying to clean up the code a bit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-05Oddly, finishing a sample doesn't require a sampleGravatar Dirk Hohndel
So let's not pass it around Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-03More Mac improvementsGravatar Henrik Brautaset Aronsen
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>
2012-01-03Even more Mac-i-nessGravatar Dirk Hohndel
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>
2012-01-03Adding the right header file for R_OK on WindowsGravatar Dirk Hohndel
Dang, I should have compile tested this on Windows before the last commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02Only set the window icon if the icon file existsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02Correctly free the GSList in file_openGravatar Dirk Hohndel
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>
2012-01-02Use the right function to get resource path on MacGravatar Dirk Hohndel
Much better than hacking together my own... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-02Use a more standard approach to save preferences on MacOSXGravatar Henrik Brautaset Aronsen
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>
2012-01-01More AsciiDoc updatesGravatar Dirk Hohndel
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>
2012-01-01Update asciidoc headers and deal with internal linksGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-01-01First try at converting user-manual to AsciiDocGravatar Linus Torvalds
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>
2012-01-01Merge branch 'mac' of git://git.hohndel.org/subsurfaceGravatar Linus Torvalds
* 'mac' of git://git.hohndel.org/subsurface: Turn subsurface into a real Mac application
2012-01-01Turn subsurface into a real Mac applicationGravatar Dirk Hohndel
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>
2011-12-31Define O2 permille for air in one spotGravatar Henrik Brautaset Aronsen
Having the O2 permille defined once is more readable. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-31Display OTU for dives using airGravatar Henrik Brautaset Aronsen
Zero o2 means 20.9% o2, which can be confusing... Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-30Move the gasmix cleanups from XML parsing to the generic dive fixup stageGravatar Linus Torvalds
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>
2011-12-28Make icon file name OS helper functionGravatar Dirk Hohndel
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>
2011-12-27Merge branches 'windows', 'docs' and 'forlinus' of ↵Gravatar Linus Torvalds
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
2011-12-26Remove unused return valueGravatar Dirk Hohndel
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>
2011-12-26Version 0.0.7 of user manualGravatar Jacco van Koll
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>
2011-12-26Fixes for the Windows installerGravatar Dirk Hohndel
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>
2011-12-26There's a difference between "it's" and "its"Gravatar Henrik Brautaset Aronsen
Just sayin' Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
2011-12-24Fix incorrect utf-8 in Documentation/user-manual.txtGravatar Cristian Ionescu-Idbohrn
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>
2011-12-23Merge branch 'docs' of git://git.hohndel.org/subsurfaceGravatar Linus Torvalds
* 'docs' of git://git.hohndel.org/subsurface: Version 0.0.6 of user manual
2011-12-23Version 0.0.6 of user manualGravatar Jacco van Koll
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>
2011-12-18parse-xml: read the file into memory separatelyGravatar Linus Torvalds
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>
2011-12-18Use an ellipsis for Nitrox O2% rangesGravatar Linus Torvalds
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>
2011-12-18Multiple cylinder support for JDiveLog importGravatar Miika Turkia
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>
2011-12-16Add more details to import chapter of user-manualGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-16Version 0.0.5 of user manualGravatar Jacco van Koll
Added chapter 12. Importing dives from JDivelog Adding some divecomputers to Appendix A Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
2011-12-14Merge branch 'forlinus' of git://git.hohndel.org/subsurfaceGravatar Linus Torvalds
* 'forlinus' of git://git.hohndel.org/subsurface: Return is not a function
2011-12-14Return is not a functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-14Merge branch 'forlinus' of git://git.hohndel.org/subsurfaceGravatar Linus Torvalds
* '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
2011-12-14Improve Makefile for MacOSGravatar Dirk Hohndel
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>
2011-12-13Add reasonable default device names for divecomputer importGravatar Dirk Hohndel
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>
2011-12-13Clarify documentation about connecting dive computersGravatar Dirk Hohndel
This works rather differently on the different OSs Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-12-13Version 0.0.4 of user manualGravatar Jacco van Koll
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>
2011-12-13More intuitive label for "not saving" when exitingGravatar Dirk Hohndel
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>