mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
29d4716af0
commit
51fdf86a2b
1 changed files with 32 additions and 6 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue