aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-09-12Flesh out the libdivecomputer interfaces some moreGravatar Linus Torvalds
.. start some error reporting, and register some early (empty) callbacks. This still doesn't actually do anything. But commit early, commit often: when I start seriously breaking things, I want to have a "hey, this still at least compiled" state. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-12Make 'report_error()' usable from outside of main.cGravatar Linus Torvalds
The dive computer import code will want to show errors too.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-12Avoid using type 'gasmix_t': use 'struct gasmix' insteadGravatar Linus Torvalds
libdivecomputer already uses 'gasmix_t' for its own gasmix thing. I don't like th eway we step on each others name spaces, but hey, might as well just use 'struct gasmix' and avoid the typedef. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-12Start some very initial libdivecomputer integrationGravatar Linus Torvalds
Ok, so this is quite broken right now: it doesn't actually really *do* anything, and it now requires that you have libdivecomputer all set up and installed. That is fairly easy: mkdir ../src cd ../src git clone git://libdivecomputer.git.sourceforge.net/gitroot/libdivecomputer/libdivecomputer cd libdivecomputer autoreconf --install ./configure make sudo make install but you may feel that this is not exactly useful considering that nothing actually *works* yet. Some day. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Clean up dive info box tooGravatar Linus Torvalds
Make it denser by putting the dive number/location in the frame label, and make it size up and down more naturally. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Accept a smaller profile windowGravatar Linus Torvalds
I'm trying to make sure that we can shrink the main window and still get a useful experience. Sometimes you have small bad netbooks when diving.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Add a 'Renumber' menu choiceGravatar Linus Torvalds
If you want to re-number your dives - either because they didn't have any numbering at all, or because you forgot about other dives - you now can. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Pack all the equipment widgets into boxesGravatar Linus Torvalds
We really do want to "pack" them, rather than use up the whole size. I think. I may end up playing around more with this. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Oops. Fix 'buffered dive' informationGravatar Linus Torvalds
When fixing the unit changes, I broke the dive buffering logic entirely for switching between dives. Duh. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Work around more Diving Log bugs..Gravatar Linus Torvalds
The Diving Log temperature reading is in Fahrenheit for the samples (for the per-dive water/air temperature it's in Celsius). But it seems to have a bug where a lack of a sample has been turned into 32 Fahrenheit (which is 0 celsius). This is despite the dive itself having a water temperature of 8 degF. Just throw away those bogus freezing temperatures. Sure, they can happen, and ice divers are crazy - but in this case I know it's just an error in the log, and it looks very much like a Diving Log bug. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Call an LP85 an LP85 even when it's "10% extra".Gravatar Linus Torvalds
The LP85+ name is not something we'd normally want to recognize. The LP cylinder names all tend to be by the "+" pressure anyway, and that's what we do in the equipment handling naming. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Be more careful about unit changesGravatar Linus Torvalds
When we change units, we need to flush any currently active dive information in the old units, and then carefully reload it in the new units. Otherwise crazy stuff happens - like having current cylinder working pressure values that are in PSI because that *used* to be the output unit, but then interpreting those values as BAR, because we changed the units. Also, since we now properly import working pressure from Diving Log, stop importing the (useless) cylinder description. The Diving Log cylinder descriptions are things like "Alu" or "Steel". We're better off just making up our own. Finally, since Diving Log has cylinder size in metric, make sure that we do the "match standard cylinder sizes" *after* we've done all the cylinder size conversions to proper units. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Parse 'Diving Log' cylinder working pressureGravatar Linus Torvalds
Oh Gods. Why are all other scuba programs so f*&% messed up? The Diving Log cylinder working pressure is in bar - which is all good. But their pressure *samples* are in PSI. Why the h*ll do people mix up units in the same damn file like that? I despair at the pure incompetence sometimes. I suspect the pressure samples aren't "really" in PSI: they are probably in some user-specified units. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Fix up dive number namingGravatar Linus Torvalds
Use "dive->number" instead of "dive->nr". And make the XML match too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Show dive number (if it exists) in the location noteGravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-11Save and restore a "dive number"Gravatar Linus Torvalds
Some people want to know how many dives they have under their belt, so let's save and restore the dive number if it exists. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Add more static cylinder types - and pick them up from the dive logGravatar Linus Torvalds
This adds a few more predefined cylinder types to the static list, but perhaps more importantly, if we try to show a cylinder description that we haven't seen before, we automatically add that description to the list as well. This way, if people have their own cylinder types, our cylinder management will automatically figure them out and make it easy to enter them. NOTE! It might be best to add the new cylinder description at dive log load time, rather than at 'show' time. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Add new cylinder models to the cylinder model storeGravatar Linus Torvalds
We also need to actually fill the model store with the cylinder models we have in our dive lists to begin with. This makes it all *trivial* to add a new cylinder model: just use a new description, fill in the size and working pressure, and you're done. The type automatically gets filled in, unless that description already existed (in which case we leave it alone). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Let people manage their cylinders in cuft and psiGravatar Linus Torvalds
If the output units are set to cuft and psi, then we should show the cylinder size and pressure properly. NOTE! In the absense of pressure data, we *always* show the cylinder volume in liter. There's no way to convert it to imperial units, since the imperial units are not in physical size, but in air volume normalized to surface pressure.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Declare 'update_dive()' properlyGravatar Linus Torvalds
Avoid a compiler warning.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Now that we don't mess up import, we can save the cylinder working pressureGravatar Linus Torvalds
We used to have the heuristic that if we saw a cylinder working pressure, then the cylinder size would be in cuft. Which meant that we couldn't export our working pressures, because it would mess things up on import. But working pressure is actually nice to know, if you ever work with cylinders in imperial units. So now that the import is fixed, add the working pressure to the export. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Don't guess input cylinder size as cubic feetGravatar Linus Torvalds
That just screws up the good xml files that have everything in well-defined units and chose the sane metric units. So do the cuft -> liter conversion only if the input units are explicitly CUFT, or known ambiguous input (SUUNTO). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-10Actually connect the cylinder configuration with the diveGravatar Linus Torvalds
It seems to be sufficiently useful to be worth updating the dive information now. This still doesn't handle multiple cylinders in any way. I need to think about the interface for that. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09Getting closer to a usable cylinder management interfaceGravatar Linus Torvalds
Not quite there yet, though. And never mind multiple cylinders.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09First (broken) try at actually tracking cylinder typesGravatar Linus Torvalds
This doesn't actually change the cylinder type info in the dive, because it's too broken for that. Instead it prints out what it would change things to. The gtk2 notion of text input focus is *really* odd. Why is the cylinder type sometimes selected, and sometimes not? Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09Rename 'cylinder.c' as 'equipment.c'Gravatar Linus Torvalds
Make it about general equipment management, and start hooking up functions to show new equipment information when changing dives (and to flush changes to equipment information for the previously active dive). Nothing is hooked up yet, and it's now showing just one (really big) cylinder choice, so this is all broken. But it should make it possible to at least get somewhere some day. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09Show tank type and O2 mix for air usageGravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-09Add a notebook for cylinder informationGravatar Linus Torvalds
Ok, so it's not connected to anything yet, and the tank choices (that don't do anything) are some random hardcoded collection, but maybe it will do something some day. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-08Use the analyzed local minima/maxima for depth text plottingGravatar Linus Torvalds
Instead of relying on our ad-hoc minmax finder, just use the local minima/maxima information directly. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-08Use an indirect pointer to min/max entry rather than valueGravatar Linus Torvalds
This way we can always find the actual min/max entry that generated the local minima/maxima. Which is useful for visualization. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-08Save default units using GConfGravatar Linus Torvalds
That seems to be the gtk2 way. Whatever. diveclog ends up defaulting to metric units, because we all know that's the right thing to do. However, I learnt to dive in the US, so I'm used to seeing psi and feet. So despite the sane defaults, I want diveclog to use the broken imperial units for me. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-08Show the min/max data in funky purple shadingGravatar Linus Torvalds
Dirk likes purple. I mean - Dirk REALLY likes purple. And what's better than "purple"? You got it: "funky purple". So this shows the one- two- and three-minute min/max information in some seriously funky purple fringing. It's not really necessarily meant to be serious, but it's a quick hack to visualize the data until we figure out what to *really* do with it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-08Start analyzing depth profile: smoothing and time-based min/max/avgGravatar Linus Torvalds
This turns the depth profile into a generic "plot_info" and calculates minima, maxima and averages over 1-, 2- and 3-minute intervals for each point. It also creates a smoothed version. We currently don't actually show the results, but that's the next step.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Remove unused variableGravatar Dirk Hohndel
This fixes a compile warning Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Show the shallow points of the dive tooGravatar Linus Torvalds
.. unless they are so shallow that they are basically at the surface. These show up automatically in out min/max logic, so just go ahead and show them. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Move text rendering function upwardsGravatar Linus Torvalds
No change in semantics, I'm just contemplating doing some text renderign from within the "minmax" function itself. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Add font size to the text_render_options structureGravatar Linus Torvalds
Ok, so it's really a 'double', but for now we're only using integer font sizes, so let's see if we ever want to do anything but that. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Add vertical alignment setting to text outputGravatar Dirk Hohndel
Add new valign enum to text_render_options_t and update all callers to plot_text Signed-off-by: Dirk Hohndel <dirk@hohndel.org> [ Fixed spelling, updated to newer base - Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Turn tail recursion back into a loopGravatar Linus Torvalds
I still think there should be some way to partition the space automatically, but the algorithm that worked best was the simple tail-recursive one. Which might as well be expressed as a loop. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Get rid of timelimit code and corner casesGravatar Linus Torvalds
The recursive minmax is now robust without them. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Clean up plot_text_samples() furtherGravatar Linus Torvalds
We don't actually use the 'dive' structure any more, since we now always have the sample pointers directly. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Simplify/clean up depth min/max finderGravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Fix up horribly broken cairo scalingGravatar Linus Torvalds
The way cairo does scaling is really really inconvenient, and one of the things in cairo that is fundamentally mis-designed. Cairo scaling always affects both coordinates and object sizes, and the two can apparently never be split apart. Which is very much not what we want: we want just coordinate scaling. So we cannot use 'cairo_scale()' to scale our canvas, because that screws up lines and text size too. And no, you cannot "fix" that by de-scaling the line size etc - because line size is one-dimensional, so you can't undo the (different) scaling in X/Y. Sad. I realize that often you do want to scale object size with coordinate transformation, but quite often you *don't* want to. Yeah, we could do random context save/restore in odd places etc, but that's just a sign of the bad design of cairo scaling. Work around it by introducing our own graphics context with scaling, which does it right. I don't like this, but it seems to be better than the alternatives. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Use a recursive (instead of iterative) minmax depth finderGravatar Linus Torvalds
This is a bit more natural, and makes it much easier to do scale independence. In particular, I want to make it possible to grow and shrink the graph, and this should make it particularly simple to react by giving more or fewer minmax points. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Tweak depth next_minmax() interfaceGravatar Linus Torvalds
Use start/end sample pointers to make a recursive algorithm possible. Also, clean up the end condition - we don't want to return an uninteresting minmax result just because we ran out of samples. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Update the dive units without destroyng and rebuilding the dive listGravatar Linus Torvalds
Just iterate over the dive list entries, updating them one by one. This avoids the "selection destroyed" when the dive units are changed. And it's cleaner anyway. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Add Ok/Cancel buttons to unit dialogGravatar Linus Torvalds
.. instead of just having a live running dialog all the time. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Do output unit conversion in the dive info window tooGravatar Linus Torvalds
This should take care of it all, unless I missed some case. Now we should just save the default units somewhere, and I should do the divelist update much cleaner (instead of re-doing the divelist entirely, it should just repaint it - now we lose the highlited dive etc). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Honor depth unit settings when plotting the depth profileGravatar Linus Torvalds
This shows the depth properly in meter or feet depending on unit selection. It also changes the horizontal depth rulers to be at 10m/30ft intervals rather than the previous 15ft. With the textual depth markers, the horizontal lines aren't as important any more. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Make divelist honor the length unitsGravatar Linus Torvalds
Show dives in meter or feet depending on the output unit setting. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>