aboutsummaryrefslogtreecommitdiffstats
path: root/uemis.c
AgeCommit message (Collapse)Author
2011-10-24Stop including regex.hGravatar Dirk Hohndel
I removed the regex code from the uemis parser a long time ago, but forgot to remove the #include <regex.h> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-20Fixed off by one error in uemis importerGravatar Dirk Hohndel
I clearly had never tried this with a dive that used the "just air" setting the uemis. With this fix the cylinder data for that one tank is read correctly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-04Fix small typo in uemis event nameGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-03Much nicer implementation of uemis sample parsing - and add events, tooGravatar Dirk Hohndel
This is something I wanted to do for a while. Every uemis sample is simply a packed structure with no padding. Instead of grabbing random bytes from the middle of an unstructured data blob let's just define the structure and access its members. And while we do that, add support for the more useful uemis events as well. A couple of the warnings are disabled by default (compile time flag) as they are just crazy - any normal dive will give you dozens and dozens of speed warnings. Same goes for the PO2 green warning (I haven't looked but this seems to trigger on a PO2 over 1.0 or something). Completely useless and just hides actually useful info. I still want to redo the way we visualize events in general - just printing the text ontop of the profile really is suboptimal. Especially as the uemis really seems to love to repeat several of the warnings quite frequently. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-03Add working pressure to uemis tank dataGravatar Dirk Hohndel
Turns out they use 202.6bar as default working pressure. WTF? Also I had misunderstood the way I should record the pressure internally (which happened to work since I didn't set the working pressure). This is now fixed as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-03Remove the ability to 'Import' .SDA filesGravatar Dirk Hohndel
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>
2011-10-02Integrate loading of uemis SDA files into the regular xml parsingGravatar Dirk Hohndel
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>
2011-10-02First steps towards integrating SDA files into the default XML loadingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-02prepare_sample reallocs the dive - don't keep pointers aroundGravatar Dirk Hohndel
Thanks Valgrind This diff looks pointless at first until you see that I reference dive again earlier in the loop and then after the end of the loop. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Correctly parse the braindamaged tank size information from uemisGravatar Dirk Hohndel
Admittedly the cuft ratings are stupid, but still, it's not that hard. In order to correctly describe a tank based on the cuft system you need to know the cuft AND the working pressure. But the uemis Zurich always assumes that the working pressure is 200bar. That's pretty close to 3000psi and therefore works "good enough" for Aluminum tanks - but in general this will of course fail (e.g. for HP or LP tanks). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-29Fix uemis parser to work with base64 data that isn't a multiple of 3Gravatar Dirk Hohndel
I had forgotten the '=' sign as valid character in base64 code Signed-off-by: Dirk Hohndel <dirk@hohndel.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-15Fix depth calculations in SDA importGravatar Dirk Hohndel
stole and fixed Linus' code in the uemis XML importer Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-15Fix incorrect data dereferenceGravatar Dirk Hohndel
This caused incorrect "missing Dive100" messages when importing SDA file from the uemis Zurich. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-15First pass to parse uemis Zurich '.SDA' filesGravatar Dirk Hohndel
This is missing a ton of the information in the .SDA files It only parses the divelog.SDA file, not the dive.SDA file It ignores the information on the gas(es) used and all the data on the tanks. It still draws some strange artefacts at the end of the dive But it correctly hooks into the import dialogue, it gives you a file select box (somewhere, I'm sure, a gtk developer cries quietly) and then parses enough of this file to serve as a proof of concept. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>