aboutsummaryrefslogtreecommitdiffstats
path: root/xslt
AgeCommit message (Collapse)Author
2013-04-23XSLT for importing individual DM4 divesGravatar Miika Turkia
This XSLT can be used when exporting single dives from DM4 and importing them to Subsurface. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-23Switch to UTF-8 on .DLD exportGravatar Miika Turkia
Let's use the shiny new UTF-8 encoding on divelogs.de export. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-26Fix end pressure on DLD exportGravatar Miika Turkia
While working on UDDF export I noticed that the grabbing of last sample pressure was not working properly. This will fix it for DLD export. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-26Fix pressures on UDDF exportGravatar Miika Turkia
Examples on UDDF specification indicate that pressures are reported in Pascal. Also prefer the sample data from first dive computer for start and end tank pressures. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-26Gases and events support for UDDF exportGravatar Miika Turkia
This patch generates a gases section on UDDF export. The section consists of all the unique gas mixes sawn on the dive log. The latter part includes events to the export. Gas change and heading events are properly translated to respective UDDF naming. Other events are copied over as is. Some of the events are the same (ascent, deco, rbt, surface) in UDDF some are not available. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-24Export dives to UDDF fileGravatar Miika Turkia
This patch implements exporting dives from Subsurface to UDDF format. Events and cylinder info are the most remarkable things still missing from the export. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-19Added support for UDDf version 3.1Gravatar Miika Turkia
This adds support for UDDF version 3.1 as produced by at least DiversDiary. Basically we have to include the different name space into our selections. This patch also checks if the temperature is zero on all samples and skips temperature readings if it looks like the dive computer does not record them. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-16Only print separator when really needed on importGravatar Miika Turkia
The separator was printed if SITE had data, even if LOCATION was empty. Now print the separator only if both of these contain data. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-15Support divelogs.de exports that include Cyrillic charactersGravatar Miika Turkia
divelogs.de sends us XML files that explicitly state that they are in ISO-8859-1 encoding (which is true). These files contain the HTML encoded Cyrillic characters. Once we decode those characters the resulting file is actually UTF-8 encoded (which is a superset of ISO-8859-1). That seriously confuses libxml when it tries to parse things. So instead recognize divelogs.de files and skip the encoding declaration for them before decoding the HTML encoded non-ISO-8859-1 characters. This does show, however, that divelogs.de incorrectly truncates the encoded strings (at least in some sample data that I created the parsing throws errors because of that). Reported-by: Sergey Starosek <sergey.starosek@gmail.com> Based-on-code-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-14Correct ending pressure for .DLD exportGravatar Miika Turkia
We grab the pressure information from samples, if available. Otherwise, we use information from first cylinder. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-14Fix free form text fields on .DLD uploadGravatar Miika Turkia
We need to have CDATA around text fields to support e.g. Cyrillic alphabet. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-10Fix XSLT when no weight system is givenGravatar Miika Turkia
Summing up weights ended only when there was one parameter left. With no parameters we ended up in an infinite loop. Now we end also in case of no parameters. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-10.DLD generation for uploading to divelogs.deGravatar Miika Turkia
This generates a .DLD file of selected dives to be uploaded to divelogs.de. The actual upload functionality along with sensible user interface is still to be implemented. However, the resulting file from this patch is tested to work (as far as I can tell) using upload API of divelogs.de. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-10Convert Subsurface XML to divelogs.de formatGravatar Miika Turkia
The resulting divelogs.de formatted XML is then to be zipped and uploaded to divelogs.de website. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-08Identify converted files as importedGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-07Translate comma to colon on XML importGravatar Miika Turkia
Translate decimal commas on XML import to decimal points. (As detected from available sample files using Linus' debug printing.) Also check for empty values on MacDive temperature import. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-07Fix import when locale set to decimal commaGravatar Miika Turkia
This should take care of locale caused problems when the input uses decimal point but locale uses decimal comma. Also the sample I have of Suunto DM3 format weight is represented with comma instead of dot so converting that as well. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02Dive computer import improvementsGravatar Miika Turkia
Parse dive computer information or divelog generator information and include it as divecomputerid and divecomputer as appropriate. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-01Grab a bit more info from UDDF importGravatar Miika Turkia
otu and po2 are now grabbed. The po2 value comes from setpo2 tag. Also divecomputerid is constructed from the generator information. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27Parse ISO 8601 time formatGravatar Miika Turkia
This is an XSLT implementation of a function to parse the ISO 8601 datetime format used in uddf. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27Handle one more date/time format for UDDF importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27MacDive import improvementGravatar Miika Turkia
MacDive reports non-existent values as zero and in Imperial units it would be 32F. This patch will try to make an educated guess whether we have the proper temperature and pressure readings and ignore the zero fields if it seems that there are no real samples from the dive computer. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27Fix MacDive import to convert Imperial temperatureGravatar Miika Turkia
MacDive import needs to convert temperatures to Celcius. However, it seems that MacDive reports no reading as 32F (and probably 0C when using Metric). There is no way of knowing whether we have no reading or the temperature is actually zero, so we use the given temperature currently as 0C is a valid temperature... Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26DivingLog import: keep the dive computer name aroundGravatar Dirk Hohndel
We simply set up the model attribute. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26Another update to DivingLog importGravatar Dirk Hohndel
This fixes two bugs: - we overwrote the max depth that we read from an XML file with 0 if there are no samples - we didn't parse the DepthAvg tag in the DivingLog XML Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26UDCF importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26Test divesGravatar Miika Turkia
On Tue, Feb 26, 2013 at 6:19 PM, Dirk Hohndel <dirk@hohndel.org> wrote: > Miika Turkia <miika.turkia@gmail.com> writes: > >> On Tue, Feb 26, 2013 at 5:54 PM, Dirk Hohndel <dirk@hohndel.org> wrote: >>> Miika Turkia <miika.turkia@gmail.com> writes: >>> >>>> On Tue, Feb 26, 2013 at 6:45 AM, Dirk Hohndel <dirk@hohndel.org> wrote: >>>>> I added a few test dives exported from other software (Dm3, DiveLog 5.08, >>>>> JDiveLog 10.2 from Mac - last one doesn't parse because of encoding... Also >>>>> a composed XML zip file from DiveLog isn't supported, yet) >>>>> Find them under dives >>>> >>>> Now this gets interesting. Is there ANY logic in the units in the >>>> dives/TestDiveDiveLog5.08.xml? It seems that some of the temperatures >>>> are in C (Airtemp and Watertemp) and some in F (samples). Otherwise I >>>> would guess we are talking metric here, but I do not see any specs >>>> (another log I have seen from DivingLog had all the units in metric, >>>> as far as I could guess). BTW is the Weight in kg or lb? >>> >>> I have purchased DivingLog and should be able to create any combination >>> of data for the test file that we could possibly want. I'll do a set in >>> a moment that describe what SHOULD be there in their notes, maybe that >>> will clear things up. >>> >>> That said, I really want to release 3.0.1 in the next couple of hours, >>> so this may have to wait for 3.0.2 (if we end up needing that) or 3.1. >>> >>>> The divelogs.de UDCF format looks like it shouldn't take long to write >>>> support for. I'll look into it this evening. >>> >>> It is evening for you, right? No pressure, just making sure I understand >>> what may be coming in in patches in the next hour or two >> >> I currently have one version of the DivingLog XSLT. So a bit of >> verification and that could possibly be used as is. However, this >> could use a bit more testing than a new support to make sure things >> are not going to be any worse than they currently are. >> >> I have not started with the UDCF yet, but that could be reasonably >> fast to implement. However, no guarantees. (And yes, it is evening for >> me) > > I can hold off 3.0.1 a couple hours longer if that is a realistic thing > to do. I don't see the UDCF as that important since we have a different > format from them that we support. So I think the best possible DivingLog > support would be my preference. > > I'll add a few more exported dives from DivingLog next (and fix the > naming of the existing ones). In that case, here is the DivingLog XSLT if anyone can give it a test. miika From 4a62058f4f6fd4780f04bce6e1fe45e20abcf33f Mon Sep 17 00:00:00 2001 From: Miika Turkia <miika.turkia@gmail.com> Date: Tue, 26 Feb 2013 17:46:53 +0200 Subject: [PATCH] XSLT for DivingLog Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24XSLT for UDDF importGravatar Miika Turkia
This XSLT imports the UDDF logs that I have received samples of. This includes kenzooid and Heinrichs Weikamp's DR5. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22JDiveLog import - add ndl=0 when on decoGravatar Miika Turkia
This patch will add ndl='0:00 min' attribute on all the samples that have stoptime or stopdepth set when importing from JDiveLog. This hack ensures that dive computer's deco ceiling is shown. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Divelogs.de import empty value fixGravatar Miika Turkia
This checks that weight and dive durantion are defined before importing. (Empty value concatenated with unit gives an error on import.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20Import divelogs.deGravatar Miika Turkia
This XSLT converts divelogs.de logs into Subsurface format. Data that is discarded: weather, water visibility, boat name. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-09Improvements on MacDive importGravatar Miika Turkia
New information of the upcoming MacDive log format is taken into account, more Imperial conversions are added and a couple of bugs fixed. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-08Support for Imperial units on MacDive log importGravatar Miika Turkia
The cylinder size is treated as metric as the samples received indicate it would be so. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-07Import MacDive divelogsGravatar Miika Turkia
This XSLT converts MacDive logs into Subsurface format. It supports both the current version and the upcoming version of the log format. Conversion was not tested with Imperial units as no samples were available of such logs. Thus functionality with Imperial units is not guaranteed. Note that the gear inventory is currently discarded. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-01-01Treat headings properly when importing Suunto logsGravatar Miika Turkia
This patch will convert a heading bookmark to Subsurface format. Suunto's bookmark uses "Heading: <degrees>°" format and was previously set as the full event name. Now the resulting event will look like: <event name="heading" value="333" time="0:58 min"/> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-12-19Convert deco info from JDiveLog to SubsurfaceGravatar Miika Turkia
This patch correctly converts the available deco data from JDiveLog files. In order for this to work correctly the next patch from Linus is needed as well. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-11-28Count the actual decimal digits for importGravatar Miika Turkia
Apply the decimal time conversion hack for JDiveLog import if there are less than 2 digits in the decimal part (and value is less than 60). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-11-26JDiveLog import fallback for 1 digit numbersGravatar Miika Turkia
Use the decimal time format fallback also for one digit numbers as Linus suggested. Thus 1.1 min would result in 1 min 6 sec. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-11-26Handle seconds in decimal notation (from JDiveLog)Gravatar Miika Turkia
This is a hack to convert time stored in decimal notation to proper seconds. When using metric units the default way of JDiveLog to store seconds is to have the amount of seconds after decimal point (1.20 is 1 minute 20 seconds). In some odd case it is reportedly possible that the seconds are actually 100 based, thus we need to convert that to seconds (1.33333 will become 1 minute 20 seconds). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-11-24Improvements on JDiveLog importGravatar Miika Turkia
If dive computer does not record the sample interval, but records time stamps on the samples, we use those. A couple of corner cases fixed that were noticed in new log samples. Also fixes when importing dives logged in imperial units. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-10-21Map JDiveLog alarms to Subsurface eventsGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2012-08-18Add weight and suit support for JDiveLog importGravatar Miika Turkia
Use the suit and weightsystem support of Subsurface when importing divelogs from JDiveLog. (They were previously included in the notes field as support for these fields was missing from Subsurface.) After import the weightsystem is undefined and weight unit is the default of Subsurface. Unfortunately the weight field in JDiveLog is text field and might contain pounds and kilograms mixed in seemingly random order. Thus 2 pounds of weight might be transformed to 2 kg. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-12Suunto SDE conversion: add boat name to notes if it existsGravatar Linus Torvalds
This is, I think, the last piece of relevant information that I can find in Szymon's SDE file. Which is not to mean that we get all the conversions right, or that we handle the more complex cases (still no multi-cylinder import, for example). But it should be much better than it used to be. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-12Suunto SDE updates, take 178: add weight and visibility infoGravatar Linus Torvalds
This converts the weight information into subsurface weights, and also adds visibility info (if it exists) into the notes for the dive. More fall-out from me looking at the nasty suunto xml files, now that I have a few that actually have some info that isn't just from the computer download. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-12Fix more Suunto SDM xml conversion problemsGravatar Linus Torvalds
Looking at the XML of the two dives Szymon Kosecki sent out to the subsurface list, I notice that our cylinder size conversion was wrong. It looks like CYLINDERUNITS is what determines whether the cylinder size is in metric (0) or imperial (1) units. Of course, if you gave a cylinder size in cuft and didn't give a working pressure, subsurface will just ignore the size as the random crap it is. We *could* default to a working pressure of 3000 psi, of course. This also picks up the CYLINDERDESCRIPTION value, although neither of Szymon's dives actually had any description. I need more SDE xml files to figure out how multi-cylinder dives look etc, but I think this gets most *simple* SDE files converted almost correctly now. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-11Fix dive notes import from Suundo SDMGravatar Linus Torvalds
The xslt translation didn't add the <notes> tag for the notes, so while it did select the notes from the SDM file, that never made it into the subsurface notes. Also added weather info to the notes, mainly as an example. There are probably other things we could do, but this fixes at least the trivial test-case from Szymon Kosecki. Reported-by: Szymon Kosecki <skosecki@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-18Multiple cylinder support for JDiveLog importGravatar Miika Turkia
Support for multiple cylinders and gas change events when Importing JDiveLog logs to Subsurface. This is tested with manually crafted data and not real data (originating from dive computer). NOTE: Subsurface does not handle importing multiple cylinders correctly but imports only the first cylinder. However, manually converting data to a file and opening that in Subsurface works correctly. (xsltproc jdivelog2subsurface.xslt jdivelog-gas.jlb > gas.xml) Some minor tweaking on importing JDiveLog specific fields to notes fields in Subsurface is also included. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-21XSLT to import SDM dive logGravatar Miika Turkia
This is tested with Linus' sample data, all basic functionality seems to be working properly. Gas changes are implemented but not tested as there was no samples of those. Multiple cylinders are missing because there was no samples available. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-30XSLT to transform JDiveLog to Subsurface formatGravatar Miika Turkia
XSLT file to transfer dive logs from JDiveLog format to Subsurface format. It can be used on command line with the following syntax: xsltproc <divelog.jlb> > <divelog.xml> Basic functionality such as depth readings and dive information is currently supported. However, this is only tested in metric units. What is currently missing is at least tank changes and tank pressure (as no sample data was available). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>