aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-09-20Don't show the smoothed dive profile or the min/max infoGravatar Linus Torvalds
It was good for debugging, it's not something we really want to show people. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Fix divelist sortingGravatar Linus Torvalds
That was stupid. The divelist column generation cleanup (commit d3feb78df527: "Make helper function for creating TreeView columns in the dive list") had a but too much copy-paste going on, and didn't always have the right column indexes.. t still *looked* right, but sorting didn't work at all. Reported-by: Chris Lewis <chrislewis915@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Fix preferences dialogGravatar Linus Torvalds
Dirk took some old code when he did the merge of the newly split gui code. Fix it up. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Separate out the UI from the program logicGravatar Dirk Hohndel
The following are UI toolkit specific: gtk-gui.c - overall layout, main window of the UI divelist.c - list of dives subsurface maintains equipment.c - equipment / tank information for each dive info.c - detailed dive info print.c - printing The rest is independent of the UI: main.c i - program frame dive.c i - creates and maintaines the internal dive list structure libdivecomputer.c uemis.c parse-xml.c save-xml.c - interface with dive computers and the XML files profile.c - creates the data for the profile and draws it using cairo This commit should contain NO functional changes, just moving code around and a couple of minor abstractions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-20Make the divelist font configurableGravatar Linus Torvalds
Instead of the hardcoding to "Sans 8", allow people to set it in the preferences. Also, make the unit choice be a frame in the preferences dialog instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Merge git://github.com/sirowain/subsurfaceGravatar Linus Torvalds
* git://github.com/sirowain/subsurface: Fix Segmentation fault when trying to print an empty plot. Provide an icon for subsurface. Added a comment about libusb dependency in Makefile.
2011-09-20Merge branch 'for-linus' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'for-linus' of git://github.com/dirkhh/subsurface: Attempt to get the location column to resize in a sensible way Minor tweaks to column headers [ Fixed up minor semantic merge conflict due to the change to make 'dive_list' internal to divelist.c ]
2011-09-20Make 'struct DiveList' entirely internal to divelist.cGravatar Linus Torvalds
Passing it around is just annoying, and we only ever have one. Let's not burden all the users with the silly thing. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Add "Apply"/"Cancel" buttons to dive equipment pageGravatar Linus Torvalds
It's too damn easy to make mistakes and not even notice them (odd gtk widget selection and keyboard input), or just start editing a cylinder thing and realize it was wrong. So instead of always saving the equipment information implicitly, add explicit "Apply" and "Cancel" buttons that save the information (or re-load it from the dive data structure) So now you need to press an extra button for your changes to *really* take effect. It can be a bit annoying, but it's better than the silent accidental equipment change that could happen before. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Attempt to get the location column to resize in a sensible wayGravatar Dirk Hohndel
Previously the SAC column was the one that expanded which is silly We also used to cut the location off at 16 characters Now we try to make the location the one that expands and allow up to 40 characters, but there's something broken, still. If you manually shrink the location column to its minimum size then subsequently resizing the window gets the desired behavior. But if you don't manually resize the location column it doesn't shrink correctly for windows that are smaller than the space we need for all columns to fully display (instead we get a horizontal scrollbar) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-20Minor tweaks to column headersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-20Make a separate "Log" menuGravatar Linus Torvalds
Instead o fhaving everything in the "File" menu, make a separate menu for things that are very much specific about divelogs, rather than "generic" things like open/save/import. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Fix Segmentation fault when trying to print an empty plot.Gravatar Riccardo Albertini
When printing an empty plot, the function was missing nullability check for 'current_dive'. Now the print of an empty plot results with an empty blank page. A better solution could be making unsensitive the Print entry in the menu, until a plot is loaded. Signed-off-by: Riccardo Albertini <ssirowain@gmail.com>
2011-09-20Provide an icon for subsurface.Gravatar Riccardo Albertini
I designed a simple blue icon for subsurface with a diver in the middle. As suggested by Dirk Hohndel, I added the surface line above diver's head, so that now the icon reflects better the new application name. Signed-off-by: Riccardo Albertini <ssirowain@gmail.com>
2011-09-20Added a comment about libusb dependency in Makefile.Gravatar Riccardo Albertini
Due to libdivecomputer's dependency, can be necessary to add libusb to pkg-config in order to compile, so I exported the pkg-config line in the subsurface target to LIBS variable, and added a comment about libusb. Signed-off-by: Riccardo Albertini <ssirowain@gmail.com>
2011-09-19Reinstate the main window titleGravatar Linus Torvalds
It got removed by some of my overly aggressive cleanup in commit fefcbf125e89 ("Remove dive info frame") because the dive info frame initialization also initialized the main window title.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Switch the dive list and dive profile panes aroundGravatar Linus Torvalds
It looks better this way, I think. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Hacky hard-coded font for dive list entriesGravatar Linus Torvalds
This really is too wrong for words, but I do think the dive list may look better with a smaller font. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Make helper function for creating TreeView columns in the dive listGravatar Linus Torvalds
Let's not repeat the boiler-plate code more than necessary. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Add cylinder description to dive listGravatar Linus Torvalds
And I *really* would want to make the dive list be a ComboBox or something like that, rather than a ListView. I need to really understand those things, though. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Turn the rest of the duplicate string fields to use render functionsGravatar Linus Torvalds
So instead of having a depth field (in mm) for sorting, and the text field that contains the same thing in text, we now have all the fields we use in "native" format, and we just render them as text dynamically. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Use renderer function for divelist depth field tooGravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Use a renderer function on the date fieldGravatar Linus Torvalds
Instead of creatign an extra column containing the date text, use a renderer function to create the text dynamically. Just the date right now, but we'll do them all this way. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Oops, fix typo. EAN, not EADGravatar Linus Torvalds
Typo turned EAN (Enriched Air Nitrox) to EAD. Which does mean something too, just to confuse people - but while it's still nitrox-related, it's entirely the wrong thing (Equivalent Air Depth). I don't think anybody would ever care to see *that*. With computers, why would you care? Anyway, Dirk noticed it, and suggested I just use O2% instead. It's not like EAN is all that readable either. Reported-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Update the divelist when dive info changesGravatar Linus Torvalds
This flushes the dive changes to the dive list, the way the old dive info frame would update as you update dive fields. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Add air usage calculations to dive listGravatar Linus Torvalds
Hey, now you can sort your dives by how good your SAC is. Which sounds more useful than it probably actually is. But maybe you can see patterns in what makes your SAC suck.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Add location to divelist tooGravatar Linus Torvalds
Sure, it's visible elsewhere, but this way you can search and sort for it, and see several entries at once. So again, having it visible in the dive list is a good thing. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Clean up divelist generation some moreGravatar Linus Torvalds
.. and make the date string much more readable, now that we aren't actually size-constrained any more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Start filling in temperature and nitrox data in dive listGravatar Linus Torvalds
Still more to go, but it's slowly fleshing out.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Add temp/nitrox/sac entries to divelistGravatar Linus Torvalds
This doesn't really fill them, it just adds them to the possible entries. I'll get to it later. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Make the pane split be vertical rather than horizontalGravatar Linus Torvalds
Ok, this makes that dive list look empty and ugly, but as mentioned, we really should start filling it with all the useful information that we can sort by, like temperature and air use. And even stuff that might not make sense to sort by (would you want to sort by cylinder size or name? Or by nitrox percentage) could still be *shown* in the list fairly naturally. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Remove dive info frameGravatar Linus Torvalds
It has always been problematic, and I've been moving things in and out of it. And it just isn't a very powerful widget. You can't *do* anything with it. The information it shows you may be useful, but the core stuff already shows up in the dive list. And the dive list is actually a much superior widget over that static dive info frame. The information that shows up in the dive list can be sorted by column, for example. So when we show temperatures or SAC numbers in the dive info frame, that's actually a very bad place to show them: we would be much better off showing it in the dive list, and then we could sort by SAC or by temperature. In other words: just remove the thing. Instead, plan to extend the dive list to contain all the information. That will probably mean that we need to change the current pane widget to be a vertical pane, rather than a horizontal one, but what's wrong with that? Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-19Make the divelist column naming clearerGravatar Linus Torvalds
Currently we use random hard-coded integers, and it's not always clear what is going on. Make it much more explicit with an enumeration of the different divelist columns. And change the column order to make it more logical, and make sure we actually catch all uses while at it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Attempt to smooth out the velocity readingsGravatar Dirk Hohndel
If the velocity is slower than FAST then we look back up to 30 seconds and calculate the velocity for the past 30 seconds instead. For the first version I'm not doing the average of the changes but simply the change from beginning to end. The alternative would be to do another triangle smoothing or something like that - but as we don't know how many samples we have in the 30 second window, it's a little harder here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Flip tank pressure graph to show the RIGHT wayGravatar Dirk Hohndel
This annoyed me from the first moment Linus added the tank pressure graph. As the pressure goes down, the graph needs to go down. Seriously. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Stop plotting the gas / consumption information into the profileGravatar Dirk Hohndel
And move the code into info.c where it now belongs Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Make handling of empty airconsumption string consistentGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16More fixes to positioning of gas / consumption information in info_frameGravatar Dirk Hohndel
This gives the airconsumption label a fixed size and changes its alignment so it is anchored to the right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Stop tank / gas / consumption info from changing info_frame sizeGravatar Dirk Hohndel
Simply set it to an empty string with TWO lines when there is nothing to display Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Indicate vertical velocity through colorGravatar Dirk Hohndel
So far Linus has hated all of my attempts to visualize vertical velocity through color. This time I'm trying something dramatically new: there is no PURPLE involved. Maybe that will convince him of the value. We simply calculate the vertical velocity for the current plot segment (last sample point to this sample point - in this version even without divisions by zero) and assign a label based on the rate of change. These labels are translated through a predefined table into colors: Dark green is +/- 5ft/min (stable) Light green is descents up to 30ft/min and ascents up to 15ft/min Yellow is descents up to 60ft/min and ascents up to 30ft/min Orange is descents up to 100ft/min and ascents up to 60ft/min Red is outside of those ranges - you are most likely in danger Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Show tank / nitrox / air consumption information in the info_frameGravatar Dirk Hohndel
Even though we go down to an 8pt font the info_frame changes size when the air info is added. I don't like this but want to see how Linus would like this resolved before going overboard. Minor tweaks to the formating (we don't need two decimals when printing the liters of air consumed). This patch does NOT remove the plot of the air information in the profile graph. I think we want to remove that once we like the text where it is, but I wanted to do one thing at a time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Dirk can't count to tenGravatar Linus Torvalds
That's ok, Dirk. I've got your back. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Remove dive number from frame labelGravatar Dirk Hohndel
It's now in the window title - no point in having it twice. Also added a little "Dive #xx - " template. The old "##. " was a bit too minimalistic for my liking. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Put the dive number and location in the window title barGravatar Linus Torvalds
I suspect the "info" area is better used for actual values, so move the dive location into the window title instead (using date if no location info), and title the info frame with date and time. This just means that the date/time gets removed from inside the frame: we may want to put air consumption info in there instead? Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Tweak temperature plot to look better for small fluctuationsGravatar Dirk Hohndel
If the temperature is in a very narrow range the existing code visually exaggerated the fluctuations. This tries to dampen that effect a bit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-16Tweak plot scaling a bitGravatar Linus Torvalds
Change the duration max rounding as noted by Dirk, and move the air consumption down further towards the bottom right corner. In particular, I make the text positions not scale with the window size, purely by the size of the text. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Minor corrections to printing of the last temperatureGravatar Dirk Hohndel
- the time stamp where we printed the last temp was wrong - we really shouldn't check mK for being identical - especially on dive computers that store a lot of samples Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Use plot_info for final remaining temperature and pressure data plots tooGravatar Linus Torvalds
Ok, this is pretty much it now. Instead of having various random checks for "is the time of the sample past the end of the dive" hacks, we not plot all graphs from the cleaned-up plot_info structure instead of the raw samples. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Plot pressure data based on 'struct plot_info' rather than raw dive dataGravatar Linus Torvalds
Further movement to using the sanitized and cleaned-up plot info rather than the raw data. The raw dive data contains samples from the end of the dive that we don't want to drop, but that we also don't want to actually use for plotting the dive. So the eventual end goal here is to not ever use the raw dive samples directly for plotting, but use the diveplot data that we have analyzed for min/max (properly ignoring final entries) etc. There's still some data that we take from the samples when plotting, but it's getting rarer. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-16Do min/max pressure and temperature based on the non-surface dataGravatar Linus Torvalds
Do the min/max calculations only *after* we have removed the extra surface events at the end. The Uemis data in particular has a lot of surface events after the dive, and we don't really want to take them into account since we won't be plotting them anyway. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>