mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Compare commits
4 commits
c3aa505f2b
...
cedccbc340
Author | SHA1 | Date | |
---|---|---|---|
|
cedccbc340 | ||
|
3ccd7e4bc7 | ||
|
f495c4f002 | ||
|
4642f12e29 |
9 changed files with 95 additions and 69 deletions
|
@ -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
|
desktop: add a button linking to the 'Contribute' page
|
||||||
mobile: fix configuration of decompression ceiling and gradient factors
|
mobile: fix configuration of decompression ceiling and gradient factors
|
||||||
desktop: fix gas switches in UDDF exports
|
desktop: fix gas switches in UDDF exports
|
||||||
|
|
|
@ -38,6 +38,12 @@
|
||||||
<dt>DiveSystem</dt><dd><ul>
|
<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>
|
<li>Orca, iDive DAN, iDive Deep, iDive Easy, iDive Free, iDive Pro, iDive Reb, iDive Stealth, iDive Tech, iDive X3M</li></ul>
|
||||||
</dd>
|
</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>
|
<dt>Garmin</dt><dd><ul>
|
||||||
<li>Descent Mk1, Descent Mk2/Mk2i</li></ul>
|
<li>Descent Mk1, Descent Mk2/Mk2i</li></ul>
|
||||||
</dd>
|
</dd>
|
||||||
|
@ -66,7 +72,7 @@
|
||||||
<li>S1</li></ul>
|
<li>S1</li></ul>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Ratio</dt><dd><ul>
|
<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>
|
</dd>
|
||||||
<dt>Reefnet</dt><dd><ul>
|
<dt>Reefnet</dt><dd><ul>
|
||||||
<li>Sensus, Sensus Pro, Sensus Ultra</li></ul>
|
<li>Sensus, Sensus Pro, Sensus Ultra</li></ul>
|
||||||
|
@ -75,7 +81,7 @@
|
||||||
<li>Alpha</li></ul>
|
<li>Alpha</li></ul>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Scubapro</dt><dd><ul>
|
<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>
|
</dd>
|
||||||
<dt>Seabaer</dt><dd><ul>
|
<dt>Seabaer</dt><dd><ul>
|
||||||
<li>T1, H3, HUDC</li></ul>
|
<li>T1, H3, HUDC</li></ul>
|
||||||
|
@ -87,7 +93,7 @@
|
||||||
<li>XP5</li></ul>
|
<li>XP5</li></ul>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Shearwater</dt><dd><ul>
|
<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>
|
</dd>
|
||||||
<dt>Sherwood</dt><dd><ul>
|
<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>
|
<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>
|
<li>DiveComputer.eu</li></ul>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Tusa</dt><dd><ul>
|
<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>
|
</dd>
|
||||||
<dt>Uemis</dt><dd><ul>
|
<dt>Uemis</dt><dd><ul>
|
||||||
<li>Zürich SDA</li></ul>
|
<li>Zürich SDA</li></ul>
|
||||||
|
|
|
@ -12,6 +12,8 @@ Deep Six: Excursion
|
||||||
Deepblu: Cosmiq+
|
Deepblu: Cosmiq+
|
||||||
Dive Rite: NiTek Q, NiTek Trio
|
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
|
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
|
Garmin: Descent Mk1, Descent Mk2/Mk2i
|
||||||
Genesis: Centauri, React Pro, React Pro White
|
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
|
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
|
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
|
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
|
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
|
Reefnet: Sensus, Sensus Pro, Sensus Ultra
|
||||||
Scorpena: Alpha
|
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
|
Seabaer: T1, H3, HUDC
|
||||||
Seac: Action, Guru, Jack, Screen
|
Seac: Action, Guru, Jack, Screen
|
||||||
Seemann: XP5
|
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
|
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
|
Sporasub: SP2
|
||||||
Subgear: XP Air, XP-10, XP-3G, XP-Air
|
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
|
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
|
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
|
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
|
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
|
Zeagle: N2iTiON3
|
|
@ -62,6 +62,7 @@ static struct namePattern name[] = {
|
||||||
{ "NERD 2", "Shearwater", "NERD 2" },
|
{ "NERD 2", "Shearwater", "NERD 2" },
|
||||||
{ "NERD", "Shearwater", "NERD" }, // order is important, test for the more specific one first
|
{ "NERD", "Shearwater", "NERD" }, // order is important, test for the more specific one first
|
||||||
{ "Predator", "Shearwater", "Predator" },
|
{ "Predator", "Shearwater", "Predator" },
|
||||||
|
{ "Tern", "Shearwater", "Tern" },
|
||||||
// Suunto dive computers
|
// Suunto dive computers
|
||||||
{ "EON Steel", "Suunto", "EON Steel" },
|
{ "EON Steel", "Suunto", "EON Steel" },
|
||||||
{ "EON Core", "Suunto", "EON Core" },
|
{ "EON Core", "Suunto", "EON Core" },
|
||||||
|
@ -69,9 +70,12 @@ static struct namePattern name[] = {
|
||||||
// Scubapro dive computers
|
// Scubapro dive computers
|
||||||
{ "G2", "Scubapro", "G2" },
|
{ "G2", "Scubapro", "G2" },
|
||||||
{ "HUD", "Scubapro", "G2 HUD" },
|
{ "HUD", "Scubapro", "G2 HUD" },
|
||||||
|
{ "G3", "Scubapro", "G3" },
|
||||||
{ "Aladin", "Scubapro", "Aladin Sport Matrix" },
|
{ "Aladin", "Scubapro", "Aladin Sport Matrix" },
|
||||||
{ "A1", "Scubapro", "Aladin A1" },
|
{ "A1", "Scubapro", "Aladin A1" },
|
||||||
{ "A2", "Scubapro", "Aladin A2" },
|
{ "A2", "Scubapro", "Aladin A2" },
|
||||||
|
{ "Luna 2.0 AI", "Scubapro", "Luna 2.0 AI" },
|
||||||
|
{ "Luna 2.0", "Scubapro", "Luna 2.0" },
|
||||||
// Mares dive computers
|
// Mares dive computers
|
||||||
{ "Mares Genius", "Mares", "Genius" },
|
{ "Mares Genius", "Mares", "Genius" },
|
||||||
{ "Mares", "Mares", "Quad" }, // we actually don't know and just pick a common one - user needs to fix in UI
|
{ "Mares", "Mares", "Quad" }, // we actually don't know and just pick a common one - user needs to fix in UI
|
||||||
|
|
|
@ -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.
|
* @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
|
* 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);
|
clear_cylinder_table(&dive->cylinders);
|
||||||
for (i = 0; i < MAX(ngases, ntanks); i++) {
|
for (i = 0; i < MAX(ngases, ntanks); i++) {
|
||||||
cylinder_t cyl = empty_cylinder;
|
cylinder_t cyl = empty_cylinder;
|
||||||
|
cyl.cylinder_use = NOT_USED;
|
||||||
|
|
||||||
if (i < ngases) {
|
if (i < ngases) {
|
||||||
dc_gasmix_t gasmix = { 0 };
|
dc_gasmix_t gasmix = { 0 };
|
||||||
int o2, he;
|
int o2, he;
|
||||||
|
|
||||||
rc = dc_parser_get_field(parser, DC_FIELD_GASMIX, i, &gasmix);
|
rc = dc_parser_get_field(parser, DC_FIELD_GASMIX, i, &gasmix);
|
||||||
if (rc != DC_STATUS_SUCCESS && rc != DC_STATUS_UNSUPPORTED)
|
if (rc == DC_STATUS_SUCCESS) {
|
||||||
return rc;
|
o2 = lrint(gasmix.oxygen * 1000);
|
||||||
|
he = lrint(gasmix.helium * 1000);
|
||||||
|
|
||||||
o2 = lrint(gasmix.oxygen * 1000);
|
/* Ignore bogus data - libdivecomputer does some crazy stuff */
|
||||||
he = lrint(gasmix.helium * 1000);
|
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 */
|
switch (gasmix.usage) {
|
||||||
if (o2 + he <= O2_IN_AIR || o2 > 1000) {
|
case DC_USAGE_DILUENT:
|
||||||
if (!shown_warning) {
|
cyl.cylinder_use = DILUENT;
|
||||||
shown_warning = true;
|
|
||||||
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
|
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 (i < ntanks) {
|
||||||
// If we've run out of gas mixes, assign this cylinder to bottom
|
// 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
|
// 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.size.mliter = lrint(tank.volume * 1000);
|
||||||
cyl.type.workingpressure.mbar = lrint(tank.workpressure * 1000);
|
cyl.type.workingpressure.mbar = lrint(tank.workpressure * 1000);
|
||||||
|
|
||||||
cyl.cylinder_use = OC_GAS;
|
if (tank.type & DC_TANKVOLUME_IMPERIAL) {
|
||||||
// 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 (same_string(devdata->model, "Suunto EON Steel")) {
|
if (same_string(devdata->model, "Suunto EON Steel")) {
|
||||||
/* Suunto EON Steele gets this wrong. Badly.
|
/* Suunto EON Steele gets this wrong. Badly.
|
||||||
* but on the plus side it only supports a few imperial sizes,
|
* 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
|
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;
|
static unsigned int nsensor = 0;
|
||||||
|
dc_sample_value_t value = *pvalue;
|
||||||
struct divecomputer *dc = userdata;
|
struct divecomputer *dc = userdata;
|
||||||
struct sample *sample;
|
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.
|
// Create a new sample.
|
||||||
// Mark depth as negative
|
// Mark depth as negative
|
||||||
sample = prepare_sample(dc);
|
sample = prepare_sample(dc);
|
||||||
sample->time.seconds = value.time;
|
sample->time.seconds = value.time / 1000;
|
||||||
sample->depth.mm = -1;
|
sample->depth.mm = -1;
|
||||||
// The current sample gets some sticky values
|
// The current sample gets some sticky values
|
||||||
// that may have been around from before, these
|
// 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;
|
break;
|
||||||
case DC_SAMPLE_PPO2:
|
case DC_SAMPLE_PPO2:
|
||||||
if (nsensor < MAX_O2_SENSORS)
|
if (nsensor < MAX_O2_SENSORS)
|
||||||
sample->o2sensor[nsensor].mbar = lrint(value.ppo2 * 1000);
|
sample->o2sensor[nsensor].mbar = lrint(value.ppo2.value * 1000);
|
||||||
else
|
else
|
||||||
report_error("%d is more o2 sensors than we can handle", nsensor);
|
report_error("%d is more o2 sensors than we can handle", nsensor);
|
||||||
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->stopdepth.mm = stopdepth = lrint(value.deco.depth * 1000.0);
|
||||||
sample->stoptime.seconds = stoptime = value.deco.time;
|
sample->stoptime.seconds = stoptime = value.deco.time;
|
||||||
}
|
}
|
||||||
|
sample->tts.seconds = value.deco.tts;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -833,18 +838,12 @@ static int dive_cb(const unsigned char *data, unsigned int size,
|
||||||
|
|
||||||
import_dive_number++;
|
import_dive_number++;
|
||||||
|
|
||||||
rc = create_parser(devdata, &parser);
|
rc = dc_parser_new(&parser, devdata->device, data, size);
|
||||||
if (rc != DC_STATUS_SUCCESS) {
|
if (rc != DC_STATUS_SUCCESS) {
|
||||||
download_error(translate("gettextFromC", "Unable to create parser for %s %s"), devdata->vendor, devdata->product);
|
download_error(translate("gettextFromC", "Unable to create parser for %s %s"), devdata->vendor, devdata->product);
|
||||||
return true;
|
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();
|
dive = alloc_dive();
|
||||||
|
|
||||||
// Fill in basic fields
|
// 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_OSTC:
|
||||||
case DC_FAMILY_HW_FROG:
|
case DC_FAMILY_HW_FROG:
|
||||||
case DC_FAMILY_HW_OSTC3:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
report_error("Device type not handled!");
|
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);
|
dc_parser_destroy (parser);
|
||||||
return rc;
|
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 parse Aladin/Memomouse headers as they are fakes
|
||||||
// Do not return on error, we can still parse the samples
|
// 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) {
|
if (dc_descriptor_get_type(data->descriptor) != DC_FAMILY_UWATEC_ALADIN && dc_descriptor_get_type(data->descriptor) != DC_FAMILY_UWATEC_MEMOMOUSE) {
|
||||||
|
|
|
@ -142,8 +142,8 @@ static const struct uuid_match serial_service_uuids[] = {
|
||||||
{ "98ae7120-e62e-11e3-badd-0002a5d5c51b", "Suunto (EON Steel/Core, G5)" },
|
{ "98ae7120-e62e-11e3-badd-0002a5d5c51b", "Suunto (EON Steel/Core, G5)" },
|
||||||
{ "cb3c4555-d670-4670-bc20-b61dbc851e9a", "Pelagic (i770R, i200C, Pro Plus X, Geo 4.0)" },
|
{ "cb3c4555-d670-4670-bc20-b61dbc851e9a", "Pelagic (i770R, i200C, Pro Plus X, Geo 4.0)" },
|
||||||
{ "ca7b0001-f785-4c38-b599-c7c5fbadb034", "Pelagic (i330R, DSX)" },
|
{ "ca7b0001-f785-4c38-b599-c7c5fbadb034", "Pelagic (i330R, DSX)" },
|
||||||
{ "fdcdeaaa-295d-470e-bf15-04217b7aa0a0", "ScubaPro G2"},
|
{ "fdcdeaaa-295d-470e-bf15-04217b7aa0a0", "ScubaPro (G2, G3)"},
|
||||||
{ "fe25c237-0ece-443c-b0aa-e02033e7029d", "Shearwater (Perdix/Teric/Peregrine)" },
|
{ "fe25c237-0ece-443c-b0aa-e02033e7029d", "Shearwater (Perdix/Teric/Peregrine/Tern)" },
|
||||||
{ "0000fcef-0000-1000-8000-00805f9b34fb", "Divesoft" },
|
{ "0000fcef-0000-1000-8000-00805f9b34fb", "Divesoft" },
|
||||||
{ NULL, }
|
{ NULL, }
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 78710ab2f1bf5843ab61d2ab2177ef2e3f8b90b3
|
Subproject commit 62a29eea15137ba7b0f2e10fae095517cc9d8341
|
|
@ -23,6 +23,11 @@
|
||||||
<TIME>
|
<TIME>
|
||||||
<xsl:value-of select="@time"/>
|
<xsl:value-of select="@time"/>
|
||||||
</TIME>
|
</TIME>
|
||||||
|
<xsl:if test="divecomputer/@model != ''">
|
||||||
|
<COMPUTERMODEL>
|
||||||
|
<xsl:value-of select="divecomputer/@model"/>
|
||||||
|
</COMPUTERMODEL>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:variable name="duration">
|
<xsl:variable name="duration">
|
||||||
<xsl:call-template name="time2sec">
|
<xsl:call-template name="time2sec">
|
||||||
|
@ -385,6 +390,11 @@
|
||||||
<DEPTH>
|
<DEPTH>
|
||||||
<xsl:value-of select="substring-before(./@depth, ' ')"/>
|
<xsl:value-of select="substring-before(./@depth, ' ')"/>
|
||||||
</DEPTH>
|
</DEPTH>
|
||||||
|
<xsl:if test="./@temp != ''">
|
||||||
|
<TEMP>
|
||||||
|
<xsl:value-of select="substring-before(./@temp, ' ')"/>
|
||||||
|
</TEMP>
|
||||||
|
</xsl:if>
|
||||||
</SAMPLE>
|
</SAMPLE>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
@ -394,6 +404,11 @@
|
||||||
<DEPTH>
|
<DEPTH>
|
||||||
<xsl:value-of select="substring-before(./@depth, ' ')"/>
|
<xsl:value-of select="substring-before(./@depth, ' ')"/>
|
||||||
</DEPTH>
|
</DEPTH>
|
||||||
|
<xsl:if test="./@temp != ''">
|
||||||
|
<TEMP>
|
||||||
|
<xsl:value-of select="substring-before(./@temp, ' ')"/>
|
||||||
|
</TEMP>
|
||||||
|
</xsl:if>
|
||||||
</SAMPLE>
|
</SAMPLE>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
|
@ -162,6 +162,11 @@
|
||||||
<xsl:attribute name="depth">
|
<xsl:attribute name="depth">
|
||||||
<xsl:value-of select="concat(., ' m')"/>
|
<xsl:value-of select="concat(., ' m')"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
|
<xsl:if test="../TEMP != ''">
|
||||||
|
<xsl:attribute name="temp">
|
||||||
|
<xsl:value-of select="../TEMP"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
</xsl:if>
|
||||||
</sample>
|
</sample>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue