The time minimum was in seconds, not minutes, and we really do want to
show at least to 90ft to make shallow dives look shallow rather than
scaled to some full depth.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It should have depth, time, place etc information, but right now it only
has a fake depth that doesn't even get updated. Just to show the idea
of the table usage.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We'll want to add various dive statistics, so... Without them, it all
looks pretty much the same, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. and repaint the profile when the selection changes.
Now, if it just wasn't so ugly, it might even be useful. Except it
obviously needs to also show all the other dive information. And allow
the user to fill in details. And save the end results.
So no, it's not useful.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is all kinds of broken: it doesn't actually follow the selected
dive, and the profile isn't scaled properly etc. But it shows something
new, and not just text.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The "decimal: it's meters, integer: it's feet" logic doesn't work. It's
just always meters, because the xml ends up sometimes having whole meters.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This means you can actually see them all, and walk through them.
It doesn't make any of this *useful*, but whatever.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ok, so I'm not very good at this. I'll need to enclose the dang thing
in a scrollable window, and then make that scrollable thing just part of
the whole window.
But hey, it's pixels on the screen. Pixels that show the names of the
dives we've parsed. At least as many as will fit on screen at one time ;)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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>
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>
Show date, max depth, and time by default. The stuff that matters and
should always exist.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. and fix the 'duration' parsing: it can be either in seconds, or in
mm:ss format. Floating point doesn't make any sense.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This makes it much easier to see the duplicates, but more importantly,
we do need to actually save the dives off to do any real work with them.
Also, require a verbosity level of 1 (-v) to show all the samples.
While (-vv) shows unparsed entries.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I think this gets me dates on all my dives. So now I could start
sorting them and removing duplicates.
But before I try to remove dups, I guess I should compare the
libdivecomputer ones against the suunto ones. Because I bet they have
various "interesting" issues like using Bar vs Atm etc.
"But XML is portable". Crazy people.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. which also showed that the sampletime thing had gotten a bit too much
copy-paste from the temperature parsing ;)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Now that we actually parse some of the dives, don't spam stdout with the
list of stuff we can't parse by default.
Add a 'verbose' flag, which enables that output when set.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. nice compiler warning hidden by the crazy gcc pointer sign warnings
that nobody wants to see (yes, we really do want to do 'strlen()' even
on unsigned strings, don't complain, crazy bitch compiler).
So this also makes our CFLAGS set -Wno-pointer-sign.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(ie all of them)
This also shows the type of entry, which makes it clear that I've
screwed up the sample matching. Oh well.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
.. but don't actually parse anything yet. But hey - now it tells you
how many samples it (hasn't) parsed.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ok, so we have the dive split and the sample splits, so now we could
really just start filling in data.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Of course, now the problem is that the different XML files have
different node names, but at least we've turned it into a half-way sane
format, and have a nice callback place per value.
Soon we could use that to actually fill in useful information.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
They had multiple "root" entries (all called 'dive'), which makes baby
Jesus cry.
So just enclose them all in one root entry (called 'dives') that
magically turns it all into parseable xml.
Yeah, that really helps make the world a better place.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It only works for the Suunto "one xml file per dive" format, not for the
libdivecomputer one that just puts many dives in one file.
Maybe there is some way for libxml2 to handle concatenated xml files
(start again on errors), but I don't know it yet.
I need to get stinking drunk before I look at more xml mess.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(and add a reminder of how they came to be)
Gaah. XML is *stupid*. It's not easy to parse for humans or for
computers, and some of these XML files are just disgusting. But maybe
they can be turned into something usable with libxml.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>