summaryrefslogtreecommitdiffstats
path: root/dive.h
AgeCommit message (Collapse)Author
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-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-10Declare 'update_dive()' properlyGravatar Linus Torvalds
Avoid a compiler warning.. 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-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-06Start "output unit management" supportGravatar Linus Torvalds
This doesn't actually *do* anything yet, but it introduces the notion of output units, and allows you to pick metric or imperial. Of course, since the output doesn't currently care, the units you pick are irrelevant. But just wait.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-05Report errors when opening filesGravatar Nathan Samson
Signed-off-by: Nathan Samson <nathansamson@gmail.com>
2011-09-05Sanitize and fix cylinder pressure overviewGravatar Linus Torvalds
Doing per-dive cylinder start/end pressures is insane, when we can have up to eight cylinders. The cylinder start/end pressure cannot be per dive, it needs to be per cylinder. This makes the save format cleaner too, we have all the cylinder data in just one place. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-04Parse uemis cylinder dataGravatar Linus Torvalds
This is some seriously crazy stuff. Instead of making sense as a divelog, the uemis xml makes more sense as a "dive computer settings dump". And I guess I can see why they'd do that. But it makes parsing it just incredibly annoying. The thing is more of a "these are the configurations I support as a dive computer thing" than a "this was the tank you were diving with". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-04Generate date string for the dive list dynamicallyGravatar Linus Torvalds
.. and sort based on the 'time_t' value itself. This allows us to use a more compact date format that doesn't need to sort alphabetically, because sorting by date is always based on the date value. So we can use just a two-digit year, and skip the seconds, to keep the column narrow, while still sorting correctly. Also, "Depth" is a nice header string, but it is wider than the column itself, which makes the whole column wider than necessary. So put the units in the header instead of in the string, keeping things narrow. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-04Add placeholder for cylinder type descriptionGravatar Linus Torvalds
So we don't want to save working pressure, but cylinder type knowledge would be lovely and useful. And we can probably make a good initial guess, or at least let people fill it in later. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-03Do better cylinder information managementGravatar Linus Torvalds
Instead of just tracking gasmix, track the size and workng pressure of the cylinder too. And use "cylinder" instead of "tank" throughout. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-03Add various dive fixups, and show pressure (if any) in the plotGravatar Linus Torvalds
Now the dive profile plot *really* needs some units. The pressure is just a random line otherwise. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-02Do a dive de-dup passGravatar Linus Torvalds
If given multiple dives at the same time, just de-dup the dives. This happens when you've dumped the whole dive-computer several times, and some dives show up in multiple dumps. When de-duping, try to avoid dropping data. So if one dive has notes attached to it, and the other one does not, pick the notes from the dive that does have them. Obvious stuff like that. The sample merge is also written so that it should be possible to merge two dives. Which we don't actually do yet. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Save and parse notes and locationsGravatar Linus Torvalds
It's pretty rough, but it seems to work. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Add ability to 'save' divesGravatar Linus Torvalds
This just generates another xml file. Don't get me wrong: I still don't like xml, but this way we can save in the same format we load things from. Except the save-format is a *lot* cleaner than the abortion that is Suunto or libdivecomputer xml. Don't bother with some crazy xml library crap for saving. Just do it! Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01gasmix: stop tracking nitrogen percentagesGravatar Linus Torvalds
The only thing you can do with that thing is screw things up (like libdivecomputer did). There's no value in tracking the "filler" gas, since you can always just calculate it from the gases that actually matter. So just track Oxygen and Helium - and make sure they have sane values. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-01Start parsing gas mixesGravatar Linus Torvalds
The suunto xml is just completely crazy. What's the helium percentage companion to "o2pct"? Would it be "hepct"? No. It's "hepct_0". Ok, so they didn't number the first o2pct, which could be seen as sane: that's the only mix value that should always exist. And they clearly started their indexing with 0. So with multiple mixes, you'd then expect "o2pct_1" and "hepct_1", right? Wrong! Because XML people are crazy, the second O2 mix percentage is obviously "o2pct_2". So the O2 percentages are one-based, with an implicit one. But the He percentages are zero-based with an explicit zero. So the second mix is "o2pct_2" and "hepct_1". I'd like to ask what drugs Suunto people are on, but hey, it's a Finnish company. No need to ask. Vodka explains everything. LOTS AND LOTS OF VODKA. In comparison, the libdivecomputer output is nice and sane, and uses a 'gasmix' node. Of course, now we have so many different XML nesting nodes to check that I just made it an array of different noces. That also allows me to mark the suunto case, so that we only do the "check for crazy alcoholic xml entries" when it's a suunto file. The "type of file" thing is probably a good idea for deciding on default units too. Some day. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31Start cleaning up dive accessorsGravatar Linus Torvalds
I'm going to add a menu to import (and eventually export) dives, and so we'd like to be able to start out with no dives at all. Right now we croak if that happens - it's not like the code has been written with actual end users in mind. So start cleaning things up. First make the 'current_dive' macro work right even for invalid dives. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-31Split up profile frame generation into its own file.Gravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30Generate a default name for a dive, if it doesn't have one alreadyGravatar Linus Torvalds
The name is a string containint date, time, depth and length. So it's useful even with nothing else going on. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30Start moving some of the non-parsing stuff out of 'parse.c'Gravatar Linus Torvalds
Create a 'main.c' with the main routine and argument "parsing" etc. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-30Split up dive data structure declarations into 'dive.h'Gravatar Linus Torvalds
The dive parser should eventually be just a part of the program, not the whole thing. So start preparing for that. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>