aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-07 13:51:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-07 13:53:09 -0700
commit71291159993b6243ff22b7c49f36eba3a674c44b (patch)
tree3928e1ed9dd9e21190b0be9d784735529d1ad4e4
parent5ea2c6c237c73ec933d8d6543a667eae7d53a9a6 (diff)
downloadsubsurface-71291159993b6243ff22b7c49f36eba3a674c44b.tar.gz
Improve generation of list of supported dive computers
Get it straight from the libdivecomputer sources used... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--SupportedDivecomputers.html33
-rw-r--r--SupportedDivecomputers.txt19
-rwxr-xr-x[-rw-r--r--]scripts/parse-descriptor.pl67
3 files changed, 76 insertions, 43 deletions
diff --git a/SupportedDivecomputers.html b/SupportedDivecomputers.html
index 0cabd137e..c7ac7ba5a 100644
--- a/SupportedDivecomputers.html
+++ b/SupportedDivecomputers.html
@@ -1,6 +1,6 @@
<dl><dt>Aeris</dt><dd>
<ul>
- <li>Atmos 2, A300 AI, Atmos AI, Atmos AI 2, Compumask, Elite, Elite T3, Elite T3, Epic, Epic, F10, Manta, XR-2</li>
+ <li>A300, A300 AI, Atmos 2, Atmos AI, Atmos AI 2, Compumask, Elite, Elite T3, Elite T3, Epic, Epic, F10, Manta, XR-1 NX, XR-2</li>
</ul>
</dd>
<dt>Apeks</dt><dd>
@@ -10,17 +10,22 @@
</dd>
<dt>Atomic Aquatics</dt><dd>
<ul>
- <li>Cobalt</li>
+ <li>Cobalt, Cobalt 2</li>
+ </ul>
+ </dd>
+ <dt>Beuchat</dt><dd>
+ <ul>
+ <li>Voyager 2G</li>
</ul>
</dd>
<dt>Cressi</dt><dd>
<ul>
- <li>Edy, Leonardo</li>
+ <li>Edy, Giotto, Leonardo</li>
</ul>
</dd>
- <dt>DiveRite</dt><dd>
+ <dt>Dive Rite</dt><dd>
<ul>
- <li>NiTek Trio</li>
+ <li>NiTek Q, NiTek Trio</li>
</ul>
</dd>
<dt>Genesis</dt><dd>
@@ -30,12 +35,12 @@
</dd>
<dt>Heinrichs Weikamp</dt><dd>
<ul>
- <li>DR5, Frog, OSTC, OSTC 2N, OSTC 3, OSTC Mk2</li>
+ <li>Frog, OSTC, OSTC 2C, OSTC 2N, OSTC 3, OSTC Mk2</li>
</ul>
</dd>
<dt>Hollis</dt><dd>
<ul>
- <li>DG03</li>
+ <li>DG03, TX1</li>
</ul>
</dd>
<dt>Mares</dt><dd>
@@ -45,7 +50,7 @@
</dd>
<dt>Oceanic</dt><dd>
<ul>
- <li>Atom 1.0, Atom 2.0, Atom 3.0, Atom 3.1, Datamask, Geo, Geo 2.0, OC1, OC1, OC1, OCi, OCS, Pro Plus 2, Pro Plus 2.1, Pro Plus 3, Veo 1.0, Veo 180, Veo 2.0, Veo 200, Veo 250, Veo 3.0, Versa Pro, VT 4.1, VT Pro, VT3, VT4</li>
+ <li>Atom 1.0, Atom 2.0, Atom 3.0, Atom 3.1, Datamask, Geo, Geo 2.0, OC1, OC1, OC1, OCS, OCi, Pro Plus 2, Pro Plus 2.1, Pro Plus 3, VT 4.1, VT Pro, VT3, VT4, Veo 1.0, Veo 180, Veo 2.0, Veo 200, Veo 250, Veo 3.0, Versa Pro</li>
</ul>
</dd>
<dt>Reefnet</dt><dd>
@@ -53,6 +58,11 @@
<li>Sensus, Sensus Pro, Sensus Ultra</li>
</ul>
</dd>
+ <dt>Scubapro</dt><dd>
+ <ul>
+ <li>Meridian, XTender 5</li>
+ </ul>
+ </dd>
<dt>Seemann</dt><dd>
<ul>
<li>XP5</li>
@@ -85,7 +95,7 @@
</dd>
<dt>Uemis</dt><dd>
<ul>
- <li>Zürich</li>
+ <li>Zürich SDA</li>
</ul>
</dd>
<dt>Uwatec</dt><dd>
@@ -93,11 +103,6 @@
<li>Aladin 2G, 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 Plus, Aladin Tec, Aladin Tec 2G, Galileo Luna, Galileo Sol, Galileo Terra, Galileo Trimix, Memomouse, Smart Com, Smart Pro, Smart Tec, Smart Z</li>
</ul>
</dd>
- <dt>xDeep</dt><dd>
- <ul>
- <li>Black</li>
- </ul>
- </dd>
<dt>Zeagle</dt><dd>
<ul>
<li>N2iTiON3</li>
diff --git a/SupportedDivecomputers.txt b/SupportedDivecomputers.txt
index 46ce26055..29d16c0a4 100644
--- a/SupportedDivecomputers.txt
+++ b/SupportedDivecomputers.txt
@@ -1,21 +1,22 @@
-Aeris: Atmos 2, A300 AI, Atmos AI, Atmos AI 2, Compumask, Elite, Elite T3, Elite T3, Epic, Epic, F10, Manta, XR-2
+Aeris: A300, A300 AI, Atmos 2, Atmos AI, Atmos AI 2, Compumask, Elite, Elite T3, Elite T3, Epic, Epic, F10, Manta, XR-1 NX, XR-2
Apeks: Quantum X
-Atomic Aquatics: Cobalt
-Cressi: Edy, Leonardo
-DiveRite: NiTek Trio
+Atomic Aquatics: Cobalt, Cobalt 2
+Beuchat: Voyager 2G
+Cressi: Edy, Giotto, Leonardo
+Dive Rite: NiTek Q, NiTek Trio
Genesis: React Pro, React Pro White
-Heinrichs Weikamp: DR5, Frog, OSTC, OSTC 2N, OSTC 3, OSTC Mk2
-Hollis: DG03
+Heinrichs Weikamp: Frog, OSTC, OSTC 2C, OSTC 2N, OSTC 3, OSTC Mk2
+Hollis: DG03, TX1
Mares: Darwin, Darwin Air, Icon HD, Icon HD Net Ready, M1, M2, Matrix, Nemo, Nemo Air, Nemo Apneist, Nemo Excel, Nemo Steel, Nemo Titanium, Nemo Wide, Nemo Wide 2, Puck, Puck 2, Puck Air, Puck Pro
-Oceanic: Atom 1.0, Atom 2.0, Atom 3.0, Atom 3.1, Datamask, Geo, Geo 2.0, OC1, OC1, OC1, OCi, OCS, Pro Plus 2, Pro Plus 2.1, Pro Plus 3, Veo 1.0, Veo 180, Veo 2.0, Veo 200, Veo 250, Veo 3.0, Versa Pro, VT 4.1, VT Pro, VT3, VT4
+Oceanic: Atom 1.0, Atom 2.0, Atom 3.0, Atom 3.1, Datamask, Geo, Geo 2.0, OC1, OC1, OC1, OCS, OCi, Pro Plus 2, Pro Plus 2.1, Pro Plus 3, VT 4.1, VT Pro, VT3, VT4, Veo 1.0, Veo 180, Veo 2.0, Veo 200, Veo 250, Veo 3.0, Versa Pro
Reefnet: Sensus, Sensus Pro, Sensus Ultra
+Scubapro: Meridian, XTender 5
Seemann: XP5
Shearwater: Petrel, Predator
Sherwood: Amphos, Insight, Insight 2, Wisdom, Wisdom 2, Wisdom 3
Subgear: XP Air, XP-10
Suunto: Cobra, Cobra 2, Cobra 3, D3, D4, D4i, D6, D6i, D9, D9tx, DX, Eon, Gekko, HelO2, Mosquito, Solution, Solution Alpha, Solution Nitrox, Spyder, Stinger, Vyper, Vyper 2, Vyper Air, Vytec, Zoop
Tusa: Element II (IQ-750), Zen (IQ-900), Zen Air (IQ-950)
-Uemis: Zürich
+Uemis: Zürich SDA
Uwatec: Aladin 2G, 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 Plus, Aladin Tec, Aladin Tec 2G, Galileo Luna, Galileo Sol, Galileo Terra, Galileo Trimix, Memomouse, Smart Com, Smart Pro, Smart Tec, Smart Z
-xDeep: Black
Zeagle: N2iTiON3 \ No newline at end of file
diff --git a/scripts/parse-descriptor.pl b/scripts/parse-descriptor.pl
index e29658bee..19d4085e8 100644..100755
--- a/scripts/parse-descriptor.pl
+++ b/scripts/parse-descriptor.pl
@@ -1,37 +1,64 @@
+#!/bin/perl
+#
+# Extract supported divecomputers from libdivecomputer source
+#
+# Usage:
+#
+# parse-descriptor.pl <path to libdivecomputer/src/descriptor.c> <outfile>
+#
+# depending on suffix of the outfile it creates the right content for
+# either a text file or and html file
use Carp;
#set command line arguments
my ($infi, $outfi) = @ARGV;
my ($type) = $outfi =~ /\.([^.]+)$/;
+if ($infi !~ /.*descriptor.c/) {
+ croak "run as $ARGV[0] <path to descriptor.c> <outputfile>\n";
+}
+
open(my $fh, "<", $infi) || croak "can't open $infi: $!";
open(STDOUT, ">", $outfi) || croak "can't open $outfi: $!";
my $lastVend = "";
+my @descriptors = ();
while (<$fh>) {
- my ($vend, $mod, $set) = split('\t', $_);
- if ($type eq "html") {
- if ($vend eq $lastVend) {
- printf(", %s", $mod);
- } else {
- if ($lastVend eq "") {
- printf("<dl><dt>%s</dt><dd>\n\t<ul>\n\t <li>%s", $vend, $mod);
- } else {
- printf("</li>\n\t</ul>\n </dd>\n <dt>%s</dt><dd>\n\t<ul>\n\t <li>%s", $vend, $mod);
- }
+ if (/^\s*{\s*"([^\,]*)"\s*,\s*"([^\,]*)"\s*,\s*([^\,]*).*}/) {
+ push(@descriptors, "$1,$2");
}
- } else {
- if ($vend eq $lastVend) {
- printf(", %s", $mod);
+}
+my @sortedDescriptors = sort @descriptors;
+foreach (@sortedDescriptors) {
+ ($vend, $mod) = split(',', $_);
+ if ($type eq "html") {
+ if ($vend eq $lastVend) {
+ printf(", %s", $mod);
+ } else {
+ if ($lastVend lt "Uemis" && $vend gt "Uemis") {
+ printf("</li>\n\t</ul>\n </dd>\n <dt>Uemis</dt><dd>\n\t<ul>\n\t <li>Zürich SDA");
+ }
+ if ($lastVend eq "") {
+ printf("<dl><dt>%s</dt><dd>\n\t<ul>\n\t <li>%s", $vend, $mod);
+ } else {
+ printf("</li>\n\t</ul>\n </dd>\n <dt>%s</dt><dd>\n\t<ul>\n\t <li>%s", $vend, $mod);
+ }
+ }
} else {
- if ($lastVend eq "") {
- printf("%s: %s", $vend, $mod);
- } else {
- printf("\n%s: %s", $vend, $mod);
- }
+ if ($vend eq $lastVend) {
+ printf(", %s", $mod);
+ } else {
+ if ($lastVend lt "Uemis" && $vend gt "Uemis") {
+ printf("\nUemis: Zürich SDA");
+ }
+ if ($lastVend eq "") {
+ printf("%s: %s", $vend, $mod);
+ } else {
+ printf("\n%s: %s", $vend, $mod);
+ }
+ }
}
- }
- $lastVend = $vend;
+ $lastVend = $vend;
}
if ($type eq "html") {
print("</li>\n\t</ul>\n </dd>\n</dl>");