aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-10-02Start hooking up the cylinder editing widgetGravatar Linus Torvalds
We don't actually fill the widget info correctly yet, nor do we take the actual size from the changes, but this starts to hook things up. Soon. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-02Add the ability to add new cylindersGravatar Linus Torvalds
This is totally useless since you cannot actually *edit* the resulting new dive yet, but we'll get there. And this already conceptually shows a capability that we didn't use to have with the old interface. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-02cylinder list: set edit/delete button sensitivityGravatar Linus Torvalds
They are only sensitive when there is a cylinder selected. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-02Start re-organizing the cylinder entry in equipment.cGravatar Linus Torvalds
This leaves the actual editing code unconnected, so now you can only see the cylinder information, not actually edit it. However, with the big re-organization I really do want to have this as a half-way point where I have created the new cylinder tree-view. I now need to connect the "add/edit" buttons to dialogs that then use the editing widgets - so I've left that widget code around, because I'll be able to reuse a lot of it. Not all, but the cylinder type model code in particular will be re-used pretty much as-is. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-02Split up generic code to generate a gtk tree view columnGravatar Linus Torvalds
We used to do this just for the dive list, but the new cylinder view will want to do a lot of the same boilerplate gtk stuff, so make it a bit more generic and move it to gtk-gui.c. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-02prepare_sample reallocs the dive - don't keep pointers aroundGravatar Dirk Hohndel
Thanks Valgrind This diff looks pointless at first until you see that I reference dive again earlier in the loop and then after the end of the loop. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-30We forgot to pick up the 'value' field of a dive eventGravatar Linus Torvalds
Just missed that one entirely in the xml parser for some reason. Probably because the fields don't have much semantic meaning, so I didn't even realize that I had missed one of the random integer values in an event. On my suunto, the 'value' field seems to contain things like the new Oxygen percentage of a gas change event etc. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-30Distinguish internally between min pressure and end pressureGravatar Dirk Hohndel
And don't artificially end dives on min pressure This may be a problem for dive computers like Linus' Suunto Vyper Air where the failure mode seems to be _high_ pressure readings (that's scary, btw). If the transmitter fails at the end of the dive the pressure plot ends with incorrect high pressure. But that's simply a bug with the dive computer and not something that subsurface should hack around. Maybe we should offer a way to edit the incorrect data points instead. Always ending on the minimum pressure is definitely wrong as it causes bogus plots when you do a valve shutdown during the dive (which means that valid data gets plotted incorrectly). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Fix the profile coloringGravatar Dirk Hohndel
We were missing the last sample (which is usually a fast ascent). Also, reduced the velocity smoothing to 15 seconds as the 30 seconds were hiding too much valid information Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Correctly parse the braindamaged tank size information from uemisGravatar Dirk Hohndel
Admittedly the cuft ratings are stupid, but still, it's not that hard. In order to correctly describe a tank based on the cuft system you need to know the cuft AND the working pressure. But the uemis Zurich always assumes that the working pressure is 200bar. That's pretty close to 3000psi and therefore works "good enough" for Aluminum tanks - but in general this will of course fail (e.g. for HP or LP tanks). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Fix uemis parser to work with base64 data that isn't a multiple of 3Gravatar Dirk Hohndel
I had forgotten the '=' sign as valid character in base64 code Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Yes Linus, gas pressure can indeed go up during a diveGravatar Dirk Hohndel
At first glance it seems logical to make the ending pressure be the lowest pressure observed during a dive. But if you do valve shut down drills with a tech setup (where you have a fully redundant double tank setup with two valves, two regulators and a manifold in between), then you continue to breath from what is indeed the same "tank", but still the valve on which your air pressure transmitter sits does get shut down and de-pressurized. So your pressure goes down by quite a bit, and then comes back up when the valve is turned back on. And the ending pressure of the dive (which is used for things like the SAC calculation) is indeed potentially higher than the lowest pressure observed during a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Allow larger tanks (change maximum from 200 to 300 cuft)Gravatar Dirk Hohndel
We don't handle doubles any different than single tanks - so while 200 cuft was a sane maximum size for a tank, once you dive with doubles this logic fails. We may or may not decide to implement special handling for doubles at some point, but for now simply allow for tanks all the way up to double-150. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-28Remove average depth from printGravatar Dirk Hohndel
It looks confusing in black and white Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-27Merge branch 'ui' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'ui' of git://github.com/dirkhh/subsurface: The notebook pages can only be dropped back into the main notebook Linus would like to be less on the bleeding edge of Gtk+ Use the correct signal to avoid Gtk-CRITICAL error message Clean up the drag and drop code and allow ripping off the Dive Profile
2011-09-27The notebook pages can only be dropped back into the main notebookGravatar Dirk Hohndel
Disable the secondary notebooks that are created when ripping off a page (dive_list or dive_profile) as drop targets for other pages. Also fix the incorrect arguments for the drag callback function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-27Linus would like to be less on the bleeding edge of Gtk+Gravatar Dirk Hohndel
So we go back to the old interfaces to identify the notebook as part of one group - the one that was just recently deprecated Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-27Use the correct signal to avoid Gtk-CRITICAL error messageGravatar Dirk Hohndel
We used the wrong signal - "data-drag-received" is intended to check whether the target will accept the drop. What we want is the "drag-drop" signal which tells the widget that something was dropped on it. Also fix an embarrassing lack of NULL pointer checks in my string comparisons... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-27Clean up the drag and drop code and allow ripping off the Dive ProfileGravatar Dirk Hohndel
Linus had used some deprecated interfcase and didn't correctly untangle the new window that he created (hiding it the window... very nifty). I think I'm closer to the real solution with a data structure that keeps track of the components of the new top level window that I need to be able to untangle (and eventually, destroy) at the end. The one error I also can't seem to get rid of is the Clean up the drag and drop code and allow ripping of the Dive Profile Gtk-CRITICAL **: IA__gtk_selection_data_set: assertion `length <= 0' failed Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-27Add note on dive computers using the same import engineGravatar Linus Torvalds
Lots of dive computers are just variations on a theme, or sometimes even just rebadged copies of each others with different manufacturer and model names. The import dialog may not mention your exact dive computer by name, but that doesn't necessarily mean that you cannot import data from it. Make that clearer in the README, and list the rough list of dive computers supported by libdivecomputer. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-27Add drag-n-drop support to be able to re-integrate the dive listGravatar Linus Torvalds
This is somewhat hacky, and there is clearly something I still don't understand about gtk selections and drag-n-drop. Dropping it back works, but I get a nasty error when I do it: (subsurface:8512): Gtk-CRITICAL **: IA__gtk_selection_data_set: assertion `length <= 0' failed even though I actually never set any selection at all directly. So there must be some internal gtk rule that I am violating, but I can't see what it is. I probably shouldn't commit it with a known ugly wart like that, but I really have no clue. Maybe somebody else can figure out what is up. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-27Don't mark the divelist window transientGravatar Linus Torvalds
That also makes it always stay in front of the other window, which is just annoying. I only did it because I wanted to make sure it dies when the main window does, but since we just kill the main loop when closing either window, that just isn't an issue. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-27Merge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'otu-tracking-v2' of git://github.com/dirkhh/subsurface: Store options in gconf Add preference option to chose if SAC and/or OTU should be in divelist Fix up trivial conflicts in gtk-gui.c (cleanup in gtk dialog wrt gtk_dialog_get_content_area() having introduced a new 'vbox' widget)
2011-09-27A Makefile 'clean' target is quite standard.Gravatar Cristian Ionescu-Idbohrn
Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-27Store options in gconfGravatar Dirk Hohndel
While it's not the most elegant way to do this I opted to store the options with "inverted polarity" - i.e., the options that are supposed to default to "True" are stored inverted since gconf reports an unset option (first time the user runs the program) as "False". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-27Merge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'otu-tracking-v2' of git://github.com/dirkhh/subsurface: Make OTU column invisible by default Add OTU to divelist Calculate OTUs for every dive Fix up trivial conflicts in dive.h (due to dive event handling also adding a field to the dive structure)
2011-09-27Make the dive list start as a plain notebook pageGravatar Linus Torvalds
I've been wondering how to make 'subsurface' work better on a small screen (I used to travel with a crappy netbook - I may have upgraded my laptop since, but it is still a design goal of mine to make sure it all works fine in that kind of environment). And ever since the dive list was made much wider and moved below the notebook, it's annoyed me how much room it all takes if I want to have both a reasonable plot window and several dives visible at the same time. The solution seems to be to just make the dive list be a notebook page. That makes the default layout very dense. At the same time, when you have the pixels, it's horrible, because you would want to see the dive list and move between dives while at the same time also seeing the dive profile change. But that is solvable by simply making the dive list notebook page be detachable, so if you have a nice big screen, just detach the dive list page and now you have independent windows for the dive list and the dive info. NOTE! I don't have any way to re-attach the dang thing. I think I'd need to learn about drag-and-drop targets etc. So once you've detached the dive list, it stays detached. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-27Add preference option to chose if SAC and/or OTU should be in divelistGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-26Make OTU column invisible by defaultGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-26Update Mares IconHd parsing to current libdivecomputer interfaceGravatar Linus Torvalds
The libdivecomputer interfaces are pure crap. There are no generic "open the dive computer" or "create a parser for the dive computer" interfaces, instead each dive computer you support has its own open and parser generator interface. And they change. Happily fairly seldom, but they change. And two days ago, Jef changed the interface for the Mares Icon HD computer in order to support the newer HD Net Ready variant. I've asked Jef to make a sane interface for "open the dive computer" and "just create the parser" for libdivecomputer, but he claims that he cannot just track the device model details internally. Which is obviously a completely bogus claim, since the way *we* track the model details is to just feed it back from the silly event. libdivecomputer should just do that internally and not bother us with its crazy internal model numbers. But whatever. In the meantime, work around this braindamage, and hope that libdivecomputer comes to its senses some day. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Stop libdivecomputer import when we start seeing old divesGravatar Linus Torvalds
I don't know about other dive computers, but the Suunto Vyper Air is slow as hell to import all the dives from. And libdivecomputer seems to be importing dives "most recent first", so this just makes it stop importing dives when it finds a dive that we've already seen. Caveat: libdivecomputer has this fancy notion of "dive fingerprints", and claims that's the way to do things. That seems to be overly complicated, and not worth the bother. If you worry about the import finishing early due to already having some dives with the same date in your dive list, just import starting from an empty state, and thus get a pure "dive computer only" state with no early out. Then you can just load the old dives afterwards, and depend on subsurface merging any duplicates. But for normal operation, when you just want to import a couple of new dives from your dive computer, the "exit import early when you see a duplicate" is the right thing to do. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Add a copy of the GPL v2 to the projectv1.0Gravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Add the version to the MakefileGravatar Linus Torvalds
Not quite the same format as for the kernel, but I want to do the normal "edit the makefile before making a release" model that I'm used to. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Update README to reflect the fact that /dev/ttyUSB0 is no longer hardcodedGravatar Linus Torvalds
Yay. It's not like we're all done, but the hardcoded dive computer location was one of those "I don't want to release 1.0 with this". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Add a GtkEntry to allow editing of the device nameGravatar Linus Torvalds
Ok, so some file chooser widget with a popup dialog would have been more professional, but I'm lazy. Plus I suspect the popup would look horrible when populated with /dev entries, and I don't think there is any sane filter function. So this works, and means that you don't *have* to recompile the whole program just because you have your dive computer on something else than a USB serial line. I suspect I should save the default name as a config variable too. Maybe a setting in the preferences dialog. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Add a "Dive Computer" frame around the dive computer choice in importGravatar Linus Torvalds
I'll add a widget to allow the user to select the device too, so let's name things to make them more obvious. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Add a xml file filter to the file open dialogGravatar Linus Torvalds
My home directory is a mess. Don't show all the crap, just the stuff that might be relevant. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-24Add an 'About' dialogGravatar Linus Torvalds
It's really just about the logo, but whatever. Dirk tells me I need one of these in order to call it 1.0. And I'm not going to fall into the trap of thinking that 1.0 needs to be something polished, it just needs to be working well enough.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-24Use 'gtk_dialog_get_content_area()' instead of accessing dialog directlyGravatar Linus Torvalds
I'm reading gtk docs, and trying to clean things up a bit. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Show events on the dive profileGravatar Linus Torvalds
This is *really* ugly. We really should just create some kind of widget that when moused over will show the event. Or something. Rather than putting text on top of other text: the events - when they happen - are usually bunched together (PO2 warnings, max depth, fast ascent leading to mandatory safety stop, you name it). But at least this way we see that the data is there, even if we see it in ugly ways. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Add cheesy "install" targetGravatar Linus Torvalds
It just puts the subsurface binary in $(HOME)/bin. .. and then the binary won't find the icon file, so this is really not enough of an install to get it really working, but whatever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Drop surface events when reading from an XML file tooGravatar Linus Torvalds
Remember those useless surface events that we ignore when we import a dive from a dive computer? Yeah, they exist in the libdivelog xml files too. So ignore them when we see them there too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Merge latitude and longitude data properlyGravatar Linus Torvalds
When merging two identical dives and one of them has lat/long data, pick it up correctly for the merged dive. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Merge dive events correctly tooGravatar Linus Torvalds
It's very similar to the sample merging. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Start handling dive eventsGravatar Linus Torvalds
Parse them, save them, take them from libdivecomputer. This doesn't merge them or show them in the profile yet, though. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Properly merge dive buddies and divemaster informationGravatar Linus Torvalds
When we merge dives, we didn't merge these fields properly. Do it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Improve libdivecomputer event printoutGravatar Linus Torvalds
Ignore surface events - they are meaningless anyway and just add noise. Print out other events properly, including correct time offset etc. We still don't actually *save* the events, but now it might be worth doign so. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Clean up event handling from libdivecomputerGravatar Linus Torvalds
This just moves the event handling out into its own helper function. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Fix progress bar during libdivecomputer importsGravatar Linus Torvalds
As reported by Mauro Dreissig, the progress bar doesn't work and causes a SIGSEGV due to a missing allocation. The code broke when Dirk separated out the GUI from the core code, and I hadn't tried divecomputer downloads since. Reported-by: Mauro Dreissig <mukadr@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Add OTU to divelistGravatar Dirk Hohndel
and change OTUs to be tracked as int, not double Signed-off-by: Dirk Hohndel <dirk@hohndel.org>