Compare commits

...

4 commits

Author SHA1 Message Date
Michael Keller
cedccbc340 Import: Update the libdivecomputer Submodule.
Update the libdivecomputer submodule.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-02-28 15:38:48 +13:00
Michael Keller
3ccd7e4bc7 Import: Add Support for New Dive Computer Models Supported by Libdivecomputer.
Add support for the new dive computer models that have been added in the
latest version of libdivecomputer.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-02-28 15:38:48 +13:00
Michael Keller
f495c4f002 Import: Update libdivecomputer to the Latest Version.
Update `libdivecomputer` to the latest upstream version.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-02-28 15:38:48 +13:00
Miika Turkia
4642f12e29 Divelogs.de integration update
Adding temp support for divelogs.de import/export.

Adding export of divecomputer model to divelogs.de export

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2024-02-27 15:44:32 -08:00
9 changed files with 95 additions and 69 deletions

View file

@ -1,3 +1,4 @@
import: update libdivecomputer version, add support for the Scubapro G3 / Luna and Shearwater Tern
desktop: add a button linking to the 'Contribute' page
mobile: fix configuration of decompression ceiling and gradient factors
desktop: fix gas switches in UDDF exports

View file

@ -38,6 +38,12 @@
<dt>DiveSystem</dt><dd><ul>
<li>Orca, iDive DAN, iDive Deep, iDive Easy, iDive Free, iDive Pro, iDive Reb, iDive Stealth, iDive Tech, iDive X3M</li></ul>
</dd>
<dt>Divesoft</dt><dd><ul>
<li>Freedom, Liberty</li></ul>
</dd>
<dt>FIT</dt><dd><ul>
<li>File import</li></ul>
</dd>
<dt>Garmin</dt><dd><ul>
<li>Descent Mk1, Descent Mk2/Mk2i</li></ul>
</dd>
@ -66,7 +72,7 @@
<li>S1</li></ul>
</dd>
<dt>Ratio</dt><dd><ul>
<li>iDive Color Deep, iDive Color Easy, iDive Color Fancy, iDive Color Free, iDive Color Pro, iDive Color Reb, iDive Color Tech+, iDive Deep, iDive Easy, iDive Fancy, iDive Free, iDive Pro, iDive Reb, iDive Tech+, iX3M 2 Deep, iX3M 2 Easy, iX3M 2 Gauge, iX3M 2 Pro, iX3M 2 Tech+, iX3M 2021 GPS Deep, iX3M 2021 GPS Easy, iX3M 2021 GPS Fancy, iX3M 2021 GPS Pro , iX3M 2021 GPS Reb, iX3M 2021 GPS Tech+, iX3M 2021 Pro Deep, iX3M 2021 Pro Easy, iX3M 2021 Pro Fancy, iX3M 2021 Pro Pro, iX3M 2021 Pro Reb, iX3M 2021 Pro Tech+, iX3M GPS Deep, iX3M GPS Easy, iX3M GPS Fancy, iX3M GPS Pro , iX3M GPS Reb, iX3M GPS Tech+, iX3M Pro Deep, iX3M Pro Easy, iX3M Pro Fancy, iX3M Pro Pro, iX3M Pro Reb, iX3M Pro Tech+</li></ul>
<li>ATOM, iDive 2 Deep, iDive 2 Easy, iDive 2 Fancy, iDive 2 Free, iDive 2 Pro, iDive 2 Reb, iDive 2 Tech, iDive Color Deep, iDive Color Easy, iDive Color Fancy, iDive Color Free, iDive Color Pro, iDive Color Reb, iDive Color Tech+, iDive Deep, iDive Easy, iDive Fancy, iDive Free, iDive Pro, iDive Reb, iDive Tech+, iX3M 2 Deep, iX3M 2 Easy, iX3M 2 GPS Deep, iX3M 2 GPS Easy, iX3M 2 GPS Gauge, iX3M 2 GPS Pro, iX3M 2 GPS Reb, iX3M 2 GPS Tech, iX3M 2 Gauge, iX3M 2 Pro, iX3M 2 Tech+, iX3M 2021 GPS Deep, iX3M 2021 GPS Easy, iX3M 2021 GPS Fancy, iX3M 2021 GPS Pro , iX3M 2021 GPS Reb, iX3M 2021 GPS Tech+, iX3M 2021 Pro Deep, iX3M 2021 Pro Easy, iX3M 2021 Pro Fancy, iX3M 2021 Pro Pro, iX3M 2021 Pro Reb, iX3M 2021 Pro Tech+, iX3M GPS Deep, iX3M GPS Easy, iX3M GPS Fancy, iX3M GPS Pro , iX3M GPS Reb, iX3M GPS Tech+, iX3M Pro Deep, iX3M Pro Easy, iX3M Pro Fancy, iX3M Pro Pro, iX3M Pro Reb, iX3M Pro Tech+</li></ul>
</dd>
<dt>Reefnet</dt><dd><ul>
<li>Sensus, Sensus Pro, Sensus Ultra</li></ul>
@ -75,7 +81,7 @@
<li>Alpha</li></ul>
</dd>
<dt>Scubapro</dt><dd><ul>
<li>Aladin A1, Aladin A2, Aladin H Matrix, Aladin Sport Matrix, Aladin Square, Chromis, G2, G2 Console, G2 HUD, G2 TEK, Mantis, Mantis 2, Meridian, XTender 5</li></ul>
<li>Aladin A1, Aladin A2, Aladin H Matrix, Aladin Sport Matrix, Aladin Square, Chromis, G2, G2 Console, G2 HUD, G2 TEK, G3, Luna 2.0, Luna 2.0 AI, Mantis, Mantis 2, Meridian, XTender 5</li></ul>
</dd>
<dt>Seabaer</dt><dd><ul>
<li>T1, H3, HUDC</li></ul>
@ -87,7 +93,7 @@
<li>XP5</li></ul>
</dd>
<dt>Shearwater</dt><dd><ul>
<li>Nerd, Nerd 2, Perdix, Perdix 2, Perdix AI, Peregrine, Petrel, Petrel 2, Petrel 3, Predator, Teric</li></ul>
<li>Nerd, Nerd 2, Perdix, Perdix 2, Perdix AI, Peregrine, Petrel, Petrel 2, Petrel 3, Predator, Teric, Tern</li></ul>
</dd>
<dt>Sherwood</dt><dd><ul>
<li>Amphos, Amphos 2.0, Amphos Air, Amphos Air 2.0, Beacon, Insight, Insight 2, Sage, Vision, Wisdom, Wisdom 2, Wisdom 3, Wisdom 4</li></ul>
@ -105,7 +111,7 @@
<li>DiveComputer.eu</li></ul>
</dd>
<dt>Tusa</dt><dd><ul>
<li>Element II (IQ-750), IQ-700, TC1, Talis, Zen (IQ-900), Zen Air (IQ-950)</li></ul>
<li>Element II (IQ-750), IQ-700, Talis, Zen (IQ-900), Zen Air (IQ-950)</li></ul>
</dd>
<dt>Uemis</dt><dd><ul>
<li>Zürich SDA</li></ul>

View file

@ -12,6 +12,8 @@ Deep Six: Excursion
Deepblu: Cosmiq+
Dive Rite: NiTek Q, NiTek Trio
DiveSystem: Orca, iDive DAN, iDive Deep, iDive Easy, iDive Free, iDive Pro, iDive Reb, iDive Stealth, iDive Tech, iDive X3M
Divesoft: Freedom, Liberty
FIT: File import
Garmin: Descent Mk1, Descent Mk2/Mk2i
Genesis: Centauri, React Pro, React Pro White
Heinrichs Weikamp: Frog, OSTC, OSTC 2, OSTC 2 TR, OSTC 2C, OSTC 2N, OSTC 3, OSTC 4, OSTC Mk2, OSTC Plus, OSTC Sport, OSTC cR
@ -21,20 +23,20 @@ Mares: Airlab, Darwin, Darwin Air, Genius, Horizon, Icon HD, Icon HD Net Ready,
McLean: Extreme
Oceanic: Atom 1.0, Atom 2.0, Atom 3.0, Atom 3.1, Datamask, F10, F11, Geo, Geo 2.0, Geo 4.0, Geo Air, OC1, OCS, OCi, Pro Plus 2, Pro Plus 2.1, Pro Plus 3, Pro Plus 4, Pro Plus X, VT 4.1, VT Pro, VT3, VT4, VTX, Veo 1.0, Veo 180, Veo 2.0, Veo 200, Veo 250, Veo 3.0, Veo 4.0, Versa Pro
Oceans: S1
Ratio: iDive Color Deep, iDive Color Easy, iDive Color Fancy, iDive Color Free, iDive Color Pro, iDive Color Reb, iDive Color Tech+, iDive Deep, iDive Easy, iDive Fancy, iDive Free, iDive Pro, iDive Reb, iDive Tech+, iX3M 2 Deep, iX3M 2 Easy, iX3M 2 Gauge, iX3M 2 Pro, iX3M 2 Tech+, iX3M 2021 GPS Deep, iX3M 2021 GPS Easy, iX3M 2021 GPS Fancy, iX3M 2021 GPS Pro , iX3M 2021 GPS Reb, iX3M 2021 GPS Tech+, iX3M 2021 Pro Deep, iX3M 2021 Pro Easy, iX3M 2021 Pro Fancy, iX3M 2021 Pro Pro, iX3M 2021 Pro Reb, iX3M 2021 Pro Tech+, iX3M GPS Deep, iX3M GPS Easy, iX3M GPS Fancy, iX3M GPS Pro , iX3M GPS Reb, iX3M GPS Tech+, iX3M Pro Deep, iX3M Pro Easy, iX3M Pro Fancy, iX3M Pro Pro, iX3M Pro Reb, iX3M Pro Tech+
Ratio: ATOM, iDive 2 Deep, iDive 2 Easy, iDive 2 Fancy, iDive 2 Free, iDive 2 Pro, iDive 2 Reb, iDive 2 Tech, iDive Color Deep, iDive Color Easy, iDive Color Fancy, iDive Color Free, iDive Color Pro, iDive Color Reb, iDive Color Tech+, iDive Deep, iDive Easy, iDive Fancy, iDive Free, iDive Pro, iDive Reb, iDive Tech+, iX3M 2 Deep, iX3M 2 Easy, iX3M 2 GPS Deep, iX3M 2 GPS Easy, iX3M 2 GPS Gauge, iX3M 2 GPS Pro, iX3M 2 GPS Reb, iX3M 2 GPS Tech, iX3M 2 Gauge, iX3M 2 Pro, iX3M 2 Tech+, iX3M 2021 GPS Deep, iX3M 2021 GPS Easy, iX3M 2021 GPS Fancy, iX3M 2021 GPS Pro , iX3M 2021 GPS Reb, iX3M 2021 GPS Tech+, iX3M 2021 Pro Deep, iX3M 2021 Pro Easy, iX3M 2021 Pro Fancy, iX3M 2021 Pro Pro, iX3M 2021 Pro Reb, iX3M 2021 Pro Tech+, iX3M GPS Deep, iX3M GPS Easy, iX3M GPS Fancy, iX3M GPS Pro , iX3M GPS Reb, iX3M GPS Tech+, iX3M Pro Deep, iX3M Pro Easy, iX3M Pro Fancy, iX3M Pro Pro, iX3M Pro Reb, iX3M Pro Tech+
Reefnet: Sensus, Sensus Pro, Sensus Ultra
Scorpena: Alpha
Scubapro: Aladin A1, Aladin A2, Aladin H Matrix, Aladin Sport Matrix, Aladin Square, Chromis, G2, G2 Console, G2 HUD, G2 TEK, Mantis, Mantis 2, Meridian, XTender 5
Scubapro: Aladin A1, Aladin A2, Aladin H Matrix, Aladin Sport Matrix, Aladin Square, Chromis, G2, G2 Console, G2 HUD, G2 TEK, G3, Luna 2.0, Luna 2.0 AI, Mantis, Mantis 2, Meridian, XTender 5
Seabaer: T1, H3, HUDC
Seac: Action, Guru, Jack, Screen
Seemann: XP5
Shearwater: Nerd, Nerd 2, Perdix, Perdix 2, Perdix AI, Peregrine, Petrel, Petrel 2, Petrel 3, Predator, Teric
Shearwater: Nerd, Nerd 2, Perdix, Perdix 2, Perdix AI, Peregrine, Petrel, Petrel 2, Petrel 3, Predator, Teric, Tern
Sherwood: Amphos, Amphos 2.0, Amphos Air, Amphos Air 2.0, Beacon, Insight, Insight 2, Sage, Vision, Wisdom, Wisdom 2, Wisdom 3, Wisdom 4
Sporasub: SP2
Subgear: XP Air, XP-10, XP-3G, XP-Air
Suunto: Cobra, Cobra 2, Cobra 3, D3, D4, D4f, D4i, D5, D6, D6i, D9, D9tx, DX, EON Core, EON Steel, EON Steel Black, Eon, Gekko, HelO2, Mosquito, Solution, Solution Alpha, Solution Nitrox, Spyder, Stinger, Vyper, Vyper 2, Vyper Air, Vyper Novo, Vytec, Zoop, Zoop Novo
Tecdiving: DiveComputer.eu
Tusa: Element II (IQ-750), IQ-700, TC1, Talis, Zen (IQ-900), Zen Air (IQ-950)
Tusa: Element II (IQ-750), IQ-700, Talis, Zen (IQ-900), Zen Air (IQ-950)
Uemis: Zürich SDA
Uwatec: Aladin 2G, Aladin Air Twin, Aladin Air Z, Aladin Air Z Nitrox, Aladin Air Z O2, Aladin Prime, Aladin Pro, Aladin Pro Ultra, Aladin Sport, Aladin Sport Plus, Aladin Tec, Aladin Tec 2G, Aladin Tec 3G, Galileo Luna, Galileo Sol, Galileo Terra, Galileo Trimix, Memomouse, Smart Com, Smart Pro, Smart Tec, Smart Z
Zeagle: N2iTiON3

View file

@ -62,6 +62,7 @@ static struct namePattern name[] = {
{ "NERD 2", "Shearwater", "NERD 2" },
{ "NERD", "Shearwater", "NERD" }, // order is important, test for the more specific one first
{ "Predator", "Shearwater", "Predator" },
{ "Tern", "Shearwater", "Tern" },
// Suunto dive computers
{ "EON Steel", "Suunto", "EON Steel" },
{ "EON Core", "Suunto", "EON Core" },
@ -69,9 +70,12 @@ static struct namePattern name[] = {
// Scubapro dive computers
{ "G2", "Scubapro", "G2" },
{ "HUD", "Scubapro", "G2 HUD" },
{ "G3", "Scubapro", "G3" },
{ "Aladin", "Scubapro", "Aladin Sport Matrix" },
{ "A1", "Scubapro", "Aladin A1" },
{ "A2", "Scubapro", "Aladin A2" },
{ "Luna 2.0 AI", "Scubapro", "Luna 2.0 AI" },
{ "Luna 2.0", "Scubapro", "Luna 2.0" },
// Mares dive computers
{ "Mares Genius", "Mares", "Genius" },
{ "Mares", "Mares", "Quad" }, // we actually don't know and just pick a common one - user needs to fix in UI

View file

@ -95,11 +95,6 @@ const char *errmsg (dc_status_t rc)
}
}
static dc_status_t create_parser(device_data_t *devdata, dc_parser_t **parser)
{
return dc_parser_new(parser, devdata->device);
}
/**
* @brief get_deeper_gasmix Returns the gas mix with the deeper MOD.
* NOTE: Parameters are passed by value in order to use them as local working
@ -170,45 +165,60 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
clear_cylinder_table(&dive->cylinders);
for (i = 0; i < MAX(ngases, ntanks); i++) {
cylinder_t cyl = empty_cylinder;
cyl.cylinder_use = NOT_USED;
if (i < ngases) {
dc_gasmix_t gasmix = { 0 };
int o2, he;
rc = dc_parser_get_field(parser, DC_FIELD_GASMIX, i, &gasmix);
if (rc != DC_STATUS_SUCCESS && rc != DC_STATUS_UNSUPPORTED)
return rc;
if (rc == DC_STATUS_SUCCESS) {
o2 = lrint(gasmix.oxygen * 1000);
he = lrint(gasmix.helium * 1000);
o2 = lrint(gasmix.oxygen * 1000);
he = lrint(gasmix.helium * 1000);
/* Ignore bogus data - libdivecomputer does some crazy stuff */
if (o2 + he <= O2_IN_AIR || o2 > 1000) {
if (!shown_warning) {
shown_warning = true;
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
}
o2 = 0;
}
if (he < 0 || o2 + he > 1000) {
if (!shown_warning) {
shown_warning = true;
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
}
he = 0;
}
cyl.gasmix.o2.permille = o2;
cyl.gasmix.he.permille = he;
bottom_gas = get_deeper_gasmix(bottom_gas, cyl.gasmix);
/* Ignore bogus data - libdivecomputer does some crazy stuff */
if (o2 + he <= O2_IN_AIR || o2 > 1000) {
if (!shown_warning) {
shown_warning = true;
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
switch (gasmix.usage) {
case DC_USAGE_DILUENT:
cyl.cylinder_use = DILUENT;
break;
case DC_USAGE_OXYGEN:
cyl.cylinder_use = OXYGEN;
break;
case DC_USAGE_OPEN_CIRCUIT:
cyl.cylinder_use = OC_GAS;
break;
default:
if (dive->dc.divemode == CCR)
cyl.cylinder_use = DILUENT;
else
cyl.cylinder_use = OC_GAS;
break;
}
o2 = 0;
}
if (he < 0 || o2 + he > 1000) {
if (!shown_warning) {
shown_warning = true;
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
}
he = 0;
}
cyl.gasmix.o2.permille = o2;
cyl.gasmix.he.permille = he;
bottom_gas = get_deeper_gasmix(bottom_gas, cyl.gasmix);
}
if (rc == DC_STATUS_UNSUPPORTED)
// Gasmix is inactive
cyl.cylinder_use = NOT_USED;
else if (dive->dc.divemode == CCR)
cyl.cylinder_use = DILUENT;
else
cyl.cylinder_use = OC_GAS;
if (i < ntanks) {
// If we've run out of gas mixes, assign this cylinder to bottom
// gas. Note that this can be overridden below if the dive computer
@ -222,14 +232,7 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
cyl.type.size.mliter = lrint(tank.volume * 1000);
cyl.type.workingpressure.mbar = lrint(tank.workpressure * 1000);
cyl.cylinder_use = OC_GAS;
// libdivecomputer treats these as independent, but a tank cannot be used for diluent and O2 at the same time
if (tank.type & DC_TANKINFO_CC_DILUENT)
cyl.cylinder_use = DILUENT;
else if (tank.type & DC_TANKINFO_CC_O2)
cyl.cylinder_use = OXYGEN;
if (tank.type & DC_TANKINFO_IMPERIAL) {
if (tank.type & DC_TANKVOLUME_IMPERIAL) {
if (same_string(devdata->model, "Suunto EON Steel")) {
/* Suunto EON Steele gets this wrong. Badly.
* but on the plus side it only supports a few imperial sizes,
@ -372,9 +375,10 @@ static void handle_gasmix(struct divecomputer *dc, struct sample *sample, int id
}
void
sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample_cb(dc_sample_type_t type, const dc_sample_value_t *pvalue, void *userdata)
{
static unsigned int nsensor = 0;
dc_sample_value_t value = *pvalue;
struct divecomputer *dc = userdata;
struct sample *sample;
@ -398,7 +402,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
// Create a new sample.
// Mark depth as negative
sample = prepare_sample(dc);
sample->time.seconds = value.time;
sample->time.seconds = value.time / 1000;
sample->depth.mm = -1;
// The current sample gets some sticky values
// that may have been around from before, these
@ -457,7 +461,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
break;
case DC_SAMPLE_PPO2:
if (nsensor < MAX_O2_SENSORS)
sample->o2sensor[nsensor].mbar = lrint(value.ppo2 * 1000);
sample->o2sensor[nsensor].mbar = lrint(value.ppo2.value * 1000);
else
report_error("%d is more o2 sensors than we can handle", nsensor);
nsensor++;
@ -484,6 +488,7 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
sample->stopdepth.mm = stopdepth = lrint(value.deco.depth * 1000.0);
sample->stoptime.seconds = stoptime = value.deco.time;
}
sample->tts.seconds = value.deco.tts;
default:
break;
}
@ -833,18 +838,12 @@ static int dive_cb(const unsigned char *data, unsigned int size,
import_dive_number++;
rc = create_parser(devdata, &parser);
rc = dc_parser_new(&parser, devdata->device, data, size);
if (rc != DC_STATUS_SUCCESS) {
download_error(translate("gettextFromC", "Unable to create parser for %s %s"), devdata->vendor, devdata->product);
return true;
}
rc = dc_parser_set_data(parser, data, size);
if (rc != DC_STATUS_SUCCESS) {
download_error(translate("gettextFromC", "Error registering the data"));
goto error_exit;
}
dive = alloc_dive();
// Fill in basic fields
@ -1621,7 +1620,7 @@ dc_status_t libdc_buffer_parser(struct dive *dive, device_data_t *data, unsigned
case DC_FAMILY_HW_OSTC:
case DC_FAMILY_HW_FROG:
case DC_FAMILY_HW_OSTC3:
rc = dc_parser_new2(&parser, data->context, data->descriptor, 0, 0);
rc = dc_parser_new2(&parser, data->context, data->descriptor, buffer, size);
break;
default:
report_error("Device type not handled!");
@ -1632,12 +1631,6 @@ dc_status_t libdc_buffer_parser(struct dive *dive, device_data_t *data, unsigned
dc_parser_destroy (parser);
return rc;
}
rc = dc_parser_set_data(parser, buffer, size);
if (rc != DC_STATUS_SUCCESS) {
report_error("Error registering the data.");
dc_parser_destroy (parser);
return rc;
}
// Do not parse Aladin/Memomouse headers as they are fakes
// Do not return on error, we can still parse the samples
if (dc_descriptor_get_type(data->descriptor) != DC_FAMILY_UWATEC_ALADIN && dc_descriptor_get_type(data->descriptor) != DC_FAMILY_UWATEC_MEMOMOUSE) {

View file

@ -142,8 +142,8 @@ static const struct uuid_match serial_service_uuids[] = {
{ "98ae7120-e62e-11e3-badd-0002a5d5c51b", "Suunto (EON Steel/Core, G5)" },
{ "cb3c4555-d670-4670-bc20-b61dbc851e9a", "Pelagic (i770R, i200C, Pro Plus X, Geo 4.0)" },
{ "ca7b0001-f785-4c38-b599-c7c5fbadb034", "Pelagic (i330R, DSX)" },
{ "fdcdeaaa-295d-470e-bf15-04217b7aa0a0", "ScubaPro G2"},
{ "fe25c237-0ece-443c-b0aa-e02033e7029d", "Shearwater (Perdix/Teric/Peregrine)" },
{ "fdcdeaaa-295d-470e-bf15-04217b7aa0a0", "ScubaPro (G2, G3)"},
{ "fe25c237-0ece-443c-b0aa-e02033e7029d", "Shearwater (Perdix/Teric/Peregrine/Tern)" },
{ "0000fcef-0000-1000-8000-00805f9b34fb", "Divesoft" },
{ NULL, }
};

@ -1 +1 @@
Subproject commit 78710ab2f1bf5843ab61d2ab2177ef2e3f8b90b3
Subproject commit 62a29eea15137ba7b0f2e10fae095517cc9d8341

View file

@ -23,6 +23,11 @@
<TIME>
<xsl:value-of select="@time"/>
</TIME>
<xsl:if test="divecomputer/@model != ''">
<COMPUTERMODEL>
<xsl:value-of select="divecomputer/@model"/>
</COMPUTERMODEL>
</xsl:if>
<xsl:variable name="duration">
<xsl:call-template name="time2sec">
@ -385,6 +390,11 @@
<DEPTH>
<xsl:value-of select="substring-before(./@depth, ' ')"/>
</DEPTH>
<xsl:if test="./@temp != ''">
<TEMP>
<xsl:value-of select="substring-before(./@temp, ' ')"/>
</TEMP>
</xsl:if>
</SAMPLE>
</xsl:when>
</xsl:choose>
@ -394,6 +404,11 @@
<DEPTH>
<xsl:value-of select="substring-before(./@depth, ' ')"/>
</DEPTH>
<xsl:if test="./@temp != ''">
<TEMP>
<xsl:value-of select="substring-before(./@temp, ' ')"/>
</TEMP>
</xsl:if>
</SAMPLE>
</xsl:otherwise>
</xsl:choose>

View file

@ -162,6 +162,11 @@
<xsl:attribute name="depth">
<xsl:value-of select="concat(., ' m')"/>
</xsl:attribute>
<xsl:if test="../TEMP != ''">
<xsl:attribute name="temp">
<xsl:value-of select="../TEMP"/>
</xsl:attribute>
</xsl:if>
</sample>
</xsl:for-each>