summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-10-25Remember the event names as we encounter themGravatar Dirk Hohndel
First step to being able to filter the events that we display in the profile. We could (in theory) walk all the dives in the divelist when we need this data, but it seems much more convenient to have them in an array in one place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Avoid using strptimeGravatar Dirk Hohndel
It's less portable (missing on Windows, for example) and it's kind of overkill here - the same is easily done with a sscanf. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Annotate Makefile with hints about building under WindowsGravatar Dirk Hohndel
You can build subsurface with MinGW. It requires installing lots of random packages, plus some things still don't work. One is that xml2-config appears to be missing. So this annotates the Makefile to tell a person building under Windows how to work around this. But we can't make this platform conditional as this workaround is hardcoding the install path. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Stop including regex.hGravatar Dirk Hohndel
I removed the regex code from the uemis parser a long time ago, but forgot to remove the #include <regex.h> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Merge branch 'bugfixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'bugfixes' of git://github.com/dirkhh/subsurface: Updated changes file Create packaging directory and add spec and changes file Makefile fixes
2011-10-24Updated changes fileGravatar Dirk Hohndel
Turns out that I forgot the -a in the last commit. Sorry Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Create packaging directory and add spec and changes fileGravatar Dirk Hohndel
These work for me on OBS Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Makefile fixesGravatar Dirk Hohndel
The stupid lib vs lib64 problem. I'm sure there's a more portable way to handle this, but this at least seems to work. Also fix the install target. Seriously, you create a directory with mode 644 and claim that this ever worked? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Subsurface 1.1v1.1Gravatar Linus Torvalds
We've added a fair amount of features since 1.0 (like multi-tank) and we've made things a lot prettier and supports editing much more information. So let's make a new release. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-24Merge branch 'ui' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'ui' of git://github.com/dirkhh/subsurface: Disable sorting by dive number Fix oversight in preference implementation Make columns for temperature, cylinder, and nitrox optional Show dive number in dive list Improve time marker handling and add printing of some time labels
2011-10-23Disable sorting by dive numberGravatar Dirk Hohndel
This is based on Linus idea and code - just adding it to my UI branch in case he didn't actually add it to his code... It makes no sense to sort by dive number - every sane person will have dive numbers be chronological; so they can sort by date instead. But removing this option wastes less space and makes the dive list look much better Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Fix oversight in preference implementationGravatar Dirk Hohndel
Not being careful enough doing copy and paste and then making manual changes... this inconsistency caused subsurface to always store the opposite of what you wanted in the preferences for SAC and O2%. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Make columns for temperature, cylinder, and nitrox optionalGravatar Dirk Hohndel
Just like SAC and OTU these can now be turned on and off through the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Show dive number in dive listGravatar Dirk Hohndel
Make sure that renumbering the divelist correctly shows up on the display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Improve time marker handling and add printing of some time labelsGravatar Dirk Hohndel
We now draw time markers at most every 5 min, but no more than 12 markers. For convenience we do 5, 10, 15 or 30 min intervals. This allows for 6h dives - enough (I hope) for even the craziest divers - but just in case, for those 8h depth-record-breaking dives, we double the interval if this still doesn't get us to 12 or fewer time markers. We label the first and then every other time marker with the minute text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Handle 'gas change' events correctlyGravatar Linus Torvalds
Dirk wrote the multi-cylinder support assuming that the dive computer always gives the selected cylinder index in the sample data - that's what his Uemis does, and it makes sense for any dive computer that supports multiple pressure transmitters. However, the other case is a dive computer where the pressure samples are all from cylinder 0, and any other cylinder will have the starting and ending pressure set by hand. And the gas change events show when the cylinder change happened. So this creates a "turn gas change events into pressure sample fixups" phase just before we actually analyze the pressures. That way the pressure analysis can alway sdo the right thing, regardless of how the data was originally stores in the dive. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Split the cylinder pressure analysis into a second loopGravatar Linus Torvalds
For the dive computers that give cylinder change events, we want to re-write the cylinder index and pressure information with the event information before we start analyzing the pressures. So instead of filling the plot info and analyzing in one loop, split it up into two phases. We'll do the "fix up cylinder pressure info based on events" in between those phases. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Merge branch 'plot-multitank' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'plot-multitank' of git://github.com/dirkhh/subsurface: Plot tank pressures for multiple tanks Change plot_info to use depth (instead of val) for depth value
2011-10-23Plot tank pressures for multiple tanksGravatar Dirk Hohndel
The code keeps track of the segments of time when a specific tank was used and interpolates the pressure values for that tank based on a simulated average SAC rate for the times in which no pressure readings are available. This changes the way we used to plot the pressure when only beginning and end pressure of a tank are known; it used to be a straight line, now it is a sloped line where the steepness of the slope is proportional to the depth at that point - which is much more realistic. We also plot the pressures in two colors now. The old green for pressure data that came from the input file (that is not the same thing as saying it came from the computer - divelog for example appear to create pressure readings in the samples even if it only has beginning and end pressure). Interpolated values are plotted in yellow. If you have a sub-standard dive computer which has a frequently failing pressure sensor, you can now tell the parts of the plot where data was missing and we are filling in. The function that prints the pressure text labels had to be completely redone as it previously assumed one tank for the whole dive and simplisticly printed that tank's start and end pressure at the beginning and end of the profile plot with the y-values being the maximum and minimum pressure... This commit introduces a custom simplistic single linked list data structure to keep track of the pressure information per segment - Linus hated the idea of using GList for this purpose, and I have to admit that in the end this was very straight forward to implement and made the code easier to read and debug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Enable inline completion/selection for the location/buddy/dm fieldsGravatar Linus Torvalds
This makes Tab completion work, and seems a whole lot more natural. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Keep the people/location lists sortedGravatar Linus Torvalds
This makes the combo box entry drop-down list be a whole lot more useful. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Make the divemaster/buddy/location text entries be combo box entriesGravatar Linus Torvalds
The text entries have completions, but if you want to see the full list of possibilities, I'm not seeing how to do that without turning the GtkEntry into a GtkComboBoxEntry. The list of people/locations are not sorted, though, which makes the full list less than readable. Will have to do that too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Add completions to the dive location, buddy and divemaster entriesGravatar Linus Torvalds
This way you can just type the first few characters of a location you've been to before, and it will show you a list of possible completions. Same for buddies and divemasters (which take the completions from a list of people you've used before). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Add 'activate' callback for the cylinder completionGravatar Linus Torvalds
This makes us fill in the size/pressure data for a cylinder even if we just type the name (rather than pick an entry from the list) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-22Change plot_info to use depth (instead of val) for depth valueGravatar Dirk Hohndel
Also changed a couple of corresponding local variables Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-22Add a completion for the cylinder type entry combo boxGravatar Linus Torvalds
This allows us to start typing the cylinder description and we'll get a matching list that we can select. This is similar to selecting one from the model, and works in addition to the explicit selection. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-22Add cylinder data to cylinder model as we record each diveGravatar Linus Torvalds
This way the cylinder model list will contain all the different cylinders that we have ever seen, rather than only containing the models that we have *edited*. That makes it much more practical to add new dives with the same cylinders that we've used before, because now those cylinders will show up as cylinder models even if we haven't looked and edited the old dives first. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-22Fix the reading of the cylinder start/end pressure from cylinder modelsGravatar Linus Torvalds
The cylinder model doesn't contain the start/end pressures, they just contain the cylinder type information. So trying to read the start and end pressure from the cylinder model change callback is totally bogus. We need to set the start/end pressures from the cylinder info when we create the cylinder widget, and not touch them when the type changes. So split up the "set_cylinder_spinbuttons()" function in two: one that sets the type information, and one that sets the start/end pressure. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-21Merge branch 'minor-fixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'minor-fixes' of git://github.com/dirkhh/subsurface: Fix "Keep window size for new notebook pages" to not set minimum size Make the first filename on the command line the default filename
2011-10-21Fix "Keep window size for new notebook pages" to not set minimum sizeGravatar Dirk Hohndel
Turns out I used the wrong function to keep the size of notebook pages that were ripped off. Using gtk_widget_set_size_request on the new notebook creates a hard minimum size for this window. Instead we should use gtk_window_set_default_size on the new window that is the parent of the notebook. This has the desired effect of creating the new window with the same size as the one the page was ripped off from - without making that the minimum size for this window. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-21Repaint dive after equipment change only after updating the cylinder infoGravatar Linus Torvalds
Repainting the dive will end up touching the cylinder list store, so we should finish setting the cylinder info before we repaint it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-21Make the first filename on the command line the default filenameGravatar Dirk Hohndel
From a usecase point of view - if we call with multiple file names then most likely it's subsurface MyDives.xml new_dive1.xml new_dive2.xml and therefore the existing "database" is the first filename, not the last one (as the current implementation assumes). Frankly, this is a bit arbitrary - but this one seems to make more sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-21Repaint the dive after equipment changesGravatar Linus Torvalds
Those changes may have changed cylinder sizes and beginning/end pressures, so the dive profile and SAC rate may be different. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-21Merge branch 'multiple_selection' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
2011-10-20Allow multiple selections in the dive listGravatar Dirk Hohndel
At this point we don't do anything with this - the commit just provides the infrastructure changes so that this becomes possible. Subsurface behaves the same if exactly one dive is selected and simply keeps the last selected dive if zero or more than one dives are selected. The goal is to be able to select multiple dives and then do actions on them. For example pick a tank used for all of them. Or edit the location or (yet to be implemented) other equipment data like weight carried. And also to be able to merge multiple dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-20Fixed off by one error in uemis importerGravatar Dirk Hohndel
I clearly had never tried this with a dive that used the "just air" setting the uemis. With this fix the cylinder data for that one tank is read correctly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-20Merge branch 'guifixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
2011-10-20Add quick hack for "no sample pressure but tank index changed" caseGravatar Linus Torvalds
This isn't right if you switch back to the same cylinder multiple times, but for the first time it kind of works - just take the beginning cylinder pressure if we have one. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-20Fix up multi-cylinder code as per DirkGravatar Linus Torvalds
Too much cut-and-paste, as Dirk points out. With multiple cylinders, we're not necessarily going to start at time zero. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-20Keep window size for new notebook pagesGravatar Dirk Hohndel
We used to set a fixed size instead of just copying the size that the existing notebook has - which didn't really feel right when resizing and then ripping of a page. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-19Parse the xml sample cylinder index properlyGravatar Linus Torvalds
We would save it in the xml file, but then not actually read it back properly. Oops. Not that we actually have any multi-tank dives yet, so it doesn't matter. Yet. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-19Start some rough multi-cylinder pressure data plot infrastructureGravatar Linus Torvalds
It doesn't actually do multiple cylinders correctly yet, but it should be a nice framework for it. And accidentally (not) it also ends up drawing the final line for the end pressure of a single-cylinder dive that has been fixed up by hand too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-19Don't overwrite the end pressure with sample data if one already existsGravatar Linus Torvalds
If we have en explicit end pressure in the dive information, we should not change it just because we also have some samples. The sample data may not be complete (read: "Linus wireless connection dropped during the dive again, and he fixed up the end pressure manually afterwards"). The beginning pressure already works correctly, because it will only use the sample data for the first sample if no pressure existed before. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-17Add start/end pressure to cylinder edit dialogGravatar Linus Torvalds
This finally allows you to set the start/end pressures by hand. HOWEVER! Right now, if we have samples with pressures, those samples will always end up overriding anything you set manually. Which can be very annoying if your wireless air integration fails halfway through. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-17declare a var for libdivecomputer's cflagsGravatar Martin Gysel
This allows us the specifiy libdivecomputer's cflags (and also the library, static or dynamic) outside of the Makefile Signed-off-by: Martin Gysel <me@bearsh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-17create man dir before installing files in itGravatar Martin Gysel
Signed-off-by: Martin Gysel <me@bearsh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-17use DESTDIR according to my understanding of GNU standardsGravatar Martin Gysel
make DESRDIR a prefix of everything according my understanding of the GNU standards. This is also useful(/needed) for installing in Gentoo. Declare BINDIR for bin/program directory. Signed-off-by: Martin Gysel <me@bearsh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-14Don't use dynamic linking for libdivecomputerGravatar Linus Torvalds
Commit bd8948386d55 ("Since we don't want configure, use gnumake to find libdivecomputer") was totally broken. Sure, using GNU make features is fine. But then hiding in that commit is the fact that it also changed it to use "-ldivecomputer" instead of just linking with the static libdivecomputer archive. And that's just a really bad idea. Dynamic linking is useful for things like libc, where it allows sharing of the code pages across all the programs using it. For something like libdivecomputer it's just a *bad* idea, and doesn't even work. The libdivecomputer interfaces aren't stable enough to make it a good idea even if it *did* work, and the libdivecomputer "make install" phase doesn't do the proper ldconfig etc setup anyway. Static linking is just simpler and better. It also means that the binary will work even if you move it around to another machine - since libdivecomputer isn't exactly a "standard library".. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-12Install manpageGravatar Dirk Hohndel
(and fix two white space issues) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-12Add a simplistic man pageGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>