Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uemis integration #49

Merged
merged 3 commits into from
Oct 3, 2011
Merged

Uemis integration #49

merged 3 commits into from
Oct 3, 2011

Conversation

dirkhh
Copy link
Collaborator

@dirkhh dirkhh commented Oct 3, 2011

I think this is a much better idea than doing separate parsing for SDA files based on the file name

The next step of course is to cull the importer routines in the same way and remove the code that is no longer needed.
Hey, tomorrow I should be able to send you commits with more lines deleted than added :-)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are a few interesting issues with this:

- this requires a change to the SDA file format; thankfully I control that
  format, too (the default files are not valid XML files)
- once again, the fact that adding samples can change the dive pointer
  messes with me - I decided to change the interface of ALL of the
  XXX_dive_match functions to take a struct dive**
  I know this is not ideal as all the other functions don't need that -
  but I would have hated the inconsistency
- there is the issue that we now overload two _different_ uemis formats in
  the same function - that's certainly a potential point of confusion
- a minor detail is the problem that the SDA format is kinda odd to parse
  and that we trigger on the duration field by it being the only float.
  Yeah, that's not ideal - but again, I control the format, so I _know_
  this is true.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We can instead 'Open' these files as they are just bastardized XML files.

This gets us back to a more consistent point where 'Import' gets data
directly from the dive computer (and hopefully soon we will add the
ability to load a dive directly from a uemis SDA to libdivecomputer),
and 'Open' loads a file from the filesystem of the computer we are
running on (this last sentence phrased so awkwardly as the uemis Zurich
SDA is a computer and presents a file system when connected via USB - it
just doesn't have the dive data in an accessible format in that file
system).

As a bonus we get to throw away quite a bit of code (the uemis specific
file handling, mini-XML parser with helper functions, the file open dialog
in the importer). Yay!

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
@dirkhh
Copy link
Collaborator Author

dirkhh commented Oct 3, 2011

I naively believe that you'll like the diffstats of that last commit:

dive.h | 2 -
gtk-gui.c | 42 +-------------------
libdivecomputer.c | 4 --
uemis.c | 113 -----------------------------------------------------
uemis.h | 4 --
5 files changed, 2 insertions(+), 163 deletions(-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants