aboutsummaryrefslogtreecommitdiffstats
path: root/parse-xml.c
AgeCommit message (Collapse)Author
2015-01-10Refactor dctype -> divemodeGravatar Robert C. Helling
... and repair a failed rebase (sorry). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09Add more infrastructure for a separate dive tableGravatar Dirk Hohndel
This will allow us to download the dives from the dive computer into a separate table just for that purpose and not into the main dive_table. I really dislike the code that's in place that dates back to the very earliest code written for Subsurface. Dumping the dives straight into the main dive_table seems really stupid to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05DLF import: Document unknown fieldsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2015-01-05DLF import: Decode and import ceiling informationGravatar Anton Lundin
This imports the ceiling information as stopdepth, our way of showing a ceiling. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05DLF import: Decode and import temperatureGravatar Anton Lundin
These decodings and constants makes the numbers line up perfectly with the numbers presented on wetnotes.com. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05DLF import: Decode and import NDL and TTSGravatar Anton Lundin
The units of these values are guessed, but these values makes they match up well with the values we calculate ourself. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05DLF import: Decode ppO2Gravatar Anton Lundin
This decodes the ppO2 value stored in the DLF files. It looks like the DiveSoft Freedom computers always stores the ppO2 value, even for OC dives. This import only stores the ppO2 value from CCR and PSCR dives, where these values comes from sensors and makes sense to store. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05DLF import: Restructure depth decodingGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-30Record the cylinder idx on DLF gaschangeGravatar Anton Lundin
Use the new and fancy cylinder idx to record which cylinder we change to on the DLF import. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Parse more DLF event typesGravatar Anton Lundin
These event types and names where found by sending different data to the wetnotes.com web page. I couldn't find where the setpoint settings where stored for the SP-events, but when looking at the web page, it was clearly stating that it saw a setpoint of 0.0 bar somewhere in there. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Document a DLF-event type more.Gravatar Anton Lundin
This event type is found in the DLF file Robert got sent. The wetnotes application can't display files containing this event type. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Use GASCHANGE2 constant for DLF GASCHANGEGravatar Anton Lundin
And this encodes helium part to in the gaschange. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Restructure DLF sample parsingGravatar Anton Lundin
There are more event types than 1, so parse that as a unsigned char and not as a bool. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Verify the file header magic before importing DLFGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Add the dive start DLF event typeGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Parse info from the DLF headerGravatar Anton Lundin
After some reverse-engineering i managed to figure out a couple of values stored in the dive header. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Parse time on only one place in DLF importGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Switch to using unsigned char in DLF importGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Fix compiler warning: parse_dlf_buffer needs to return 0 on successGravatar Dirk Hohndel
Simply running off the end of a non-void function isn't nice. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Set dive_table for Divesoft importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Support gaschange events on Divesoft Freedom importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Initial support for Divesoft FreedomGravatar Miika Turkia
This parses the dive profile from Divesoft Freedom log file. Only the depth profile is currently supported. There is also something wrong as the log file cannot be given as parameter but must be opened or imported once Subsurface is running. Note that so far no metadata is parsed. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-26Preconfigured import of Subsurface CSV log fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Improve error messages on database importsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Import location from Cobalt DBGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Remove placeholder location and buddy fieldsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Stub for collecting visibility on Cobalt DB importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Add buddy support to Cobalt DB importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Fix maximum depth on Cobalt importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Include cylinder information in Cobalt importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-20Bare implementation of Cobalt Divelog ProgramGravatar Miika Turkia
This implements importing of dive profile and temperature graph along with some meta data from a Cobalt Divelog database. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08Don't ignore when we can't parse a fileGravatar Dirk Hohndel
We are quite inconsistent when it comes to reporting back errors. One case where this caused somewhat unexpected behavior was when the user would try to open a .csv file by passing it as command line argument. The file was silently ignored, but treated as if it had been opened successfully. Now we issue a somewhat reasonable error message. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-04Fix DM4/DM5 importGravatar Miika Turkia
The implementation of import for DM5 removed the profileBlob from SQL query, thus breaking the backward compatibility on import of old dives. Need to have bot profile and sample blobs within the query... Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-03Parse converted DM4 logs on DM5 importGravatar Miika Turkia
"Converted" DM4 logs are not actually converted, only the database structure is updated. According to Rainer we should be able to read the dive profile from the old format in this case. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-03Fix crash with converted DM5 logGravatar Miika Turkia
If DM4 log file is converted to DM5, the sampleBlob is empty. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18Remove unused variablesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18Limit pressure and temperature valuesGravatar Miika Turkia
Limit temperatures and cylinder pressures to somewhat sensible values. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17Use cylinder use helper functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17For CCR dives, the diluent cylinder is the current cylinderGravatar Robert C. Helling
Change the meaning that _the_ cylinder (as we treat it in OC dives) is the diluent cylinder (rather than the O2 cylinder). This eliminates special cases. Now, for CCR, we have to handle the O2 cylinder in addition (rather than the diluent in addition). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16Load and save the dc type for CCR divesGravatar Dirk Hohndel
Oddly we already had code to load this from XML, but nothing else. This makes the load from XML work like the rest of our code and adds the save to XML plus the load and save for the git format. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-16Save CCR cylinder use in XML and gitGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-15Initial support for Suunto DM5 importGravatar Miika Turkia
This implements import from Suunto DM5 database, but there is something wrong with some of the sample dives in the database I received as sample. It seems that we should detect missing/bogus data and treat it properly as divelogs.de does with the same dives. Anyway, when we have proper data, this import appears to produce sensible results. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Load and save extra data in Subsurface XML formatGravatar Dirk Hohndel
Includes test dive to test missing attributes and the overall syntax. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28Fix reading of CDATA elementsGravatar Miika Turkia
If the element we are parsing is of type XML_CDATA_SECTION_NODE, we have to check the node's name from the parent. Fixes #718 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-26Make the buffers const char *Gravatar Dirk Hohndel
Addresses a warning, but also seems more correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-26Support for importing Poseidon MK6 logsGravatar Miika Turkia
This patch adds support for importing the logs from a Poseidon MK6 rebreather. This DC produces logs that contain of a .txt file that has all the meta data and a .csv file that contains the sample readings. The CSV file is different from the others in that it has a line per each sample reading at given time. Thus we have to merge all the lines from one point in time into one sample reading of ours. [Dirk Hohndel: addressed some compiler warnings] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-22Set dctype of dives with pO2 setpoint information to CCR.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19Make planner work again for CCR divesGravatar Robert C. Helling
The latest CCR patches had rendered the planner not usable for CCR dives. This patch corrects this (and reenables the CCR set point column for segments). The problem was that a new member setpoint of struct divepoint had been introduced, but there was already po2 which had the same meaning. This patch merges the two and renames them setpoint to prevent future confusion. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12Start sanitizing gaschange event informationGravatar Linus Torvalds
Decode the gasmix data into a sane format when creating the event, and add the (currently unused) ability to specify a gas change to a particular cylinder rather than (or in addition to) the gasmix. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-11CCR patch: Import and store oxygen sensor dataGravatar willem ferguson
This patch allows the importing of oxygen sensor and setpoint data from Poseidon CCR dive logs. 1) Change parse-xml.c to read up to three oxygen sensor values from xml. and to store the information in sample structures 2) Change parse-xml.c to read o2 setpoint values fro xml and to store it in sample structures 3) Change dive.c to delete all sensor and setpoint values where subsequent samples have sensor/setpoint values that are the same. 4) Change profile.c to store the sensor/setpoint values from the samples into plotinfo. 5) Change the sample Poseidon xml log in the dives directory to ensure the correct order and hierarchy of the dive and divecomputer nodes. [Dirk Hohndel: minor cleanup, removed debug code, whitespace] Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>