diff options
author | Martin Long <martin@longhome.co.uk> | 2014-12-14 23:23:49 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-14 23:22:05 -0800 |
commit | 51fdf86a2bd3e86e10d27bf1b568ef785542fe8b (patch) | |
tree | ee346e183b70bd044c4187843cfac2e7db1e4e6e /xslt | |
parent | 29d4716af06aab895f7c76cb379e5566b581061f (diff) | |
download | subsurface-51fdf86a2bd3e86e10d27bf1b568ef785542fe8b.tar.gz |
Fix event/alarm types in UDDF export.
UDDF only supports a specific set of alarms. Some events also don't map
to alarms but map to other types of elements in UDDF.
This patch adds a map of the accepted types. Where a map doesn't exist
the type will not be mapped to an alarm, the option then remains to
map it to another kind of element, in the same way that happened with
headings and gas switches.
This removes the need for the specific exclusion of heading and
gas switch, as they are now simply not included in the map.
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/uddf-export.xslt | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt index 89bf6c137..d1d46a9b9 100644 --- a/xslt/uddf-export.xslt +++ b/xslt/uddf-export.xslt @@ -18,6 +18,24 @@ </xsl:for-each> </xsl:variable> + <xsl:variable name="eventmap"> + <!--entry key="safety stop (mandatory)"></entry--> + <!--entry key="deco"></entry--> + <entry key="ascent">ascent</entry><!--Not sure of definitions in our file. Ascent too fast??--> + <entry key="violation">deco</entry><!--Assume this is missed deco--> + <!--entry key="below floor">error</entry--> + <entry key="divetime">rbt</entry> + <!--entry key="maxdepth"></entry--> + <!--entry key="OLF"></entry--> + <!--entry key="PO2"></entry--> + <!--entry key="airtime"></entry--> + <entry key="ceiling">error</entry> + <!--entry key="heading"></entry--> + <entry key="surface">surface</entry> + <!--entry key="bookmark"></entry--> + <entry key="unknown">error</entry> + </xsl:variable> + <xsl:template match="/divelog/settings"/> @@ -348,9 +366,12 @@ <xsl:if test="$timesecond != $time"> <waypoint> - <xsl:if test="not(@name = 'heading') and not(@name = 'gaschange')"> + <xsl:variable name="name"> + <xsl:value-of select="@name"/> + </xsl:variable> + <xsl:if test="xt:node-set($eventmap)/entry[@key = $name]"> <alarm> - <xsl:value-of select="@name"/> + <xsl:value-of select="xt:node-set($eventmap)/entry[@key = $name]"/> </alarm> </xsl:if> @@ -406,10 +427,15 @@ <xsl:value-of select="@time"/> </xsl:variable> - <xsl:for-each select="preceding-sibling::event[@time = $time and not(@name='heading' or @name='gaschange')]/@name"> - <alarm> - <xsl:value-of select="."/> - </alarm> + <xsl:for-each select="preceding-sibling::event[@time = $time]"> + <xsl:variable name="name"> + <xsl:value-of select="@name"/> + </xsl:variable> + <xsl:if test="xt:node-set($eventmap)/entry[@key = $name]"> + <alarm> + <xsl:value-of select="xt:node-set($eventmap)/entry[@key = $name]"/> + </alarm> + </xsl:if> </xsl:for-each> <depth> |