2017-04-27 18:13:48 +00:00
// SPDX-License-Identifier: GPL-2.0
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
* An . slg file is composed of a main table ( Dives ) , a bunch of tables directly
2020-03-11 10:30:51 +00:00
* linked to Dives by their indices ( Site , Suit , Tank , etc ) and another group of
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
* independent tables ( Activity , Type , Gear , Fish . . . ) which connect with the dives
* via a related group of tables ( ActivityRelation , TypeRelation . . . ) that contain
* just the dive index number and the related table index number .
* The data stored in the main group of tables are very extensive , going far beyond
* the actual scope of Subsurface in most of cases ; e . g . Dives table keeps
* information which can be directly uploaded to DAN ' s database of dives , or Buddy
* table can include telephones , photo or , even , buddy mother ' s maiden name .
*
* Although these funcs are suposed to work in a standalone tool , will also work
* on main Subsurface import menu , by simply tweaking file . c and main_window . cpp
* to call smartrak_import ( )
*/
2024-03-16 21:09:58 +00:00
/*
* This is a workaround around a mdbtools bug .
* mdbtools includes < glib . h > in an extern " C "
* block . However , the latter includes C + + only
* headers for C + + source files leading to a
* torrent of compile errors . Include < glib . h >
* first so that the include guards prevent it
* from being included by mdbtools .
*/
# include <glib.h>
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# include <mdbtools.h>
# include <stdarg.h>
2017-01-22 12:43:10 +00:00
# include <locale.h>
2024-03-17 15:50:40 +00:00
# include <array>
# include <string_view>
# include <vector>
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2017-05-20 07:36:38 +00:00
# if defined(WIN32) || defined(_WIN32)
# include <windows.h>
# endif
2016-06-15 18:59:34 +00:00
# include "core/dive.h"
core: introduce divelog structure
The parser API was very annoying, as a number of tables
to-be-filled were passed in as pointers. The goal of this
commit is to collect all these tables in a single struct.
This should make it (more or less) clear what is actually
written into the divelog files.
Moreover, it should now be rather easy to search for
instances, where the global logfile is accessed (and it
turns out that there are many!).
The divelog struct does not contain the tables as substructs,
but only collects pointers. The idea is that the "divelog.h"
file can be included without all the other files describing
the numerous tables.
To make it easier to use from C++ parts of the code, the
struct implements a constructor and a destructor. Sadly,
we can't use smart pointers, since the pointers are accessed
from C code. Therfore the constructor and destructor are
quite complex.
The whole commit is large, but was mostly an automatic
conversion.
One oddity of note: the divelog structure also contains
the "autogroup" flag, since that is saved in the divelog.
This actually fixes a bug: Before, when importing dives
from a different log, the autogroup flag was overwritten.
This was probably not intended and does not happen anymore.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-08 20:31:08 +00:00
# include "core/divelog.h"
2018-05-11 15:25:41 +00:00
# include "core/subsurface-string.h"
2016-06-15 18:59:34 +00:00
# include "core/gettext.h"
# include "core/divelist.h"
2020-10-25 08:14:16 +00:00
# include "core/event.h"
2016-06-15 18:59:34 +00:00
# include "core/libdivecomputer.h"
# include "core/divesite.h"
2024-03-16 21:09:58 +00:00
# include "core/errorhelper.h"
2024-03-17 15:50:40 +00:00
# include "core/format.h"
2019-05-30 16:29:36 +00:00
# include "core/tag.h"
2020-11-01 21:32:43 +00:00
# include "core/device.h"
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* SmartTrak version, constant for every single file */
int smtk_version ;
int tanks ;
/*
2023-12-16 09:10:57 +00:00
* There are AFAIK three versions of Smarttrak DB format . The newer one supports trimix and up
* to 10 tanks . The intermediate one just 3 tanks and no trimix but only nitrox . This is a
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
* problem for an automated parser which has to support both formats .
* In this solution I made an enum of fields with the same order they would have in
* a smarttrak db , and a tiny function which returns the number of the column where
2023-12-16 09:10:57 +00:00
* a field is expected to be , taking into account the different db formats .
* The older version ( version 10000 ) , just one tank ( nitrox ) but it ' s critically different from
* the newer version , not only in the Dives table format , but it has different tables . We won ' t
* give support for this oldest DB format .
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
*/
2017-05-20 07:38:27 +00:00
enum field_pos { IDX = 0 , DIVENUM , _DATE , INTIME , INTVAL , DURATION , OUTTIME , DESATBEFORE , DESATAFTER , NOFLYBEFORE ,
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
NOFLYAFTER , NOSTOPDECO , MAXDEPTH , VISIBILITY , WEIGHT , O2FRAC , HEFRAC , PSTART , PEND , AIRTEMP ,
MINWATERTEMP , MAXWATERTEMP , SECFACT , ALARMS , MODE , REMARKS , DCNUMBER , DCMODEL , DIVETIMECOUNT , LOG ,
PROFILE , SITEIDX , ALTIDX , SUITIDX , WEATHERIDX , SURFACEIDX , UNDERWATERIDX , TANKIDX } ;
/*
* Returns calculated column number depending on smartrak version , as there are more
* tanks ( 10 ) in later versions than in older ( 3 ) .
* Older versions also lacks of 3 columns storing he fraction , one for each tank .
*/
2024-03-16 21:09:58 +00:00
static int coln ( enum field_pos pos_in )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2024-03-16 21:09:58 +00:00
int pos = static_cast < int > ( pos_in ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
int amnd = ( smtk_version < 10213 ) ? 3 : 0 ;
if ( pos < = O2FRAC )
return pos ;
if ( pos > = AIRTEMP ) {
pos + = 4 * ( tanks - 1 ) - amnd ;
return pos ;
}
switch ( pos ) {
case HEFRAC :
pos = O2FRAC + tanks ;
return pos ;
case PSTART :
pos = O2FRAC + 2 * tanks - amnd ;
return pos ;
case PEND :
pos = O2FRAC + 2 * tanks + 1 - amnd ;
return pos ;
2024-03-16 21:09:58 +00:00
default :
report_error ( " smartrak: unknown field_pos (shouldn't happen) " ) ;
return pos ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
}
/*
* Fills the date part of a tm structure with the string data obtained
* from smartrak in format " DD/MM/YY HH:MM:SS " where time is irrelevant .
*/
static void smtk_date_to_tm ( char * d_buffer , struct tm * tm_date )
{
2017-05-20 07:41:55 +00:00
int n , d , m , y ;
2018-01-07 10:12:48 +00:00
if ( ( d_buffer ) & & ( ! empty_string ( d_buffer ) ) ) {
2017-05-20 07:41:55 +00:00
n = sscanf ( d_buffer , " %d/%d/%d " , & m , & d , & y ) ;
y = ( y < 70 ) ? y + 100 : y ;
if ( n = = 3 ) {
tm_date - > tm_mday = d ;
tm_date - > tm_mon = m - 1 ;
tm_date - > tm_year = y ;
} else {
tm_date - > tm_mday = tm_date - > tm_mon = tm_date - > tm_year = 0 ;
}
} else {
tm_date - > tm_mday = tm_date - > tm_mon = tm_date - > tm_year = 0 ;
2017-03-16 14:35:38 +00:00
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
* Fills the time part of a tm structure with the string data obtained
* from smartrak in format " DD/MM/YY HH:MM:SS " where date is irrelevant .
*/
2024-03-17 15:50:40 +00:00
static void smtk_time_to_tm ( const char * t_buffer , struct tm * tm_date )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2017-06-11 15:24:08 +00:00
int n , hr , min , sec ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2018-01-07 10:12:48 +00:00
if ( ( t_buffer ) & & ( ! empty_string ( t_buffer ) ) ) {
2017-06-11 15:24:08 +00:00
n = sscanf ( t_buffer , " %*[0-9/] %d:%d:%d " , & hr , & min , & sec ) ;
2017-05-20 07:41:55 +00:00
if ( n = = 3 ) {
tm_date - > tm_hour = hr ;
tm_date - > tm_min = min ;
tm_date - > tm_sec = sec ;
} else {
tm_date - > tm_hour = tm_date - > tm_min = tm_date - > tm_sec = 0 ;
}
} else {
tm_date - > tm_hour = tm_date - > tm_min = tm_date - > tm_sec = 0 ;
}
tm_date - > tm_isdst = - 1 ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
* Converts to seconds a time lapse returned from smartrak in string format
* " DD/MM/YY HH:MM:SS " where date is irrelevant .
* TODO : modify to support times > 24 h where date means difference in days
* from 29 / 12 / 99.
*/
2024-03-17 15:50:40 +00:00
static unsigned int smtk_time_to_secs ( const char * t_buffer )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2017-06-11 15:24:08 +00:00
int n , hr , min , sec ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2018-01-07 10:12:48 +00:00
if ( ! empty_string ( t_buffer ) ) {
2017-06-11 15:24:08 +00:00
n = sscanf ( t_buffer , " %*[0-9/] %d:%d:%d " , & hr , & min , & sec ) ;
2018-02-17 20:21:16 +00:00
return ( n = = 3 ) ? ( ( ( hr * 60 ) + min ) * 60 ) + sec : 0 ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
} else {
return 0 ;
}
}
2017-05-20 07:41:55 +00:00
/*
* Emulate the non portable timegm ( ) function .
* Based on timegm man page , changing setenv and unsetenv with putenv ,
* because of portability issues .
*/
static time_t smtk_timegm ( struct tm * tm )
{
time_t ret ;
char * tz , * str ;
tz = getenv ( " TZ " ) ;
2024-03-16 21:09:58 +00:00
putenv ( strdup ( " TZ= " ) ) ;
2017-05-20 07:41:55 +00:00
tzset ( ) ;
ret = mktime ( tm ) ;
if ( tz ) {
2024-03-16 21:09:58 +00:00
str = ( char * ) calloc ( strlen ( tz ) + 4 , 1 ) ;
2017-05-20 07:41:55 +00:00
sprintf ( str , " TZ=%s " , tz ) ;
putenv ( str ) ;
} else {
2024-03-16 21:09:58 +00:00
putenv ( strdup ( " TZ " ) ) ;
2017-05-20 07:41:55 +00:00
}
tzset ( ) ;
return ret ;
}
2024-03-17 15:50:40 +00:00
class SmtkTable {
struct Entry {
std : : array < char , MDB_BIND_SIZE > value ;
int len ;
} ;
std : : vector < Entry > data ;
public :
MdbTableDef * table ;
SmtkTable ( MdbHandle * mdb , const char * name ) ;
~ SmtkTable ( ) ;
size_t size ( ) const {
return data . size ( ) ;
}
operator bool ( ) const {
return ! ! table ;
}
int fetch_row ( ) {
return table ? mdb_fetch_row ( table ) : 0 ;
}
const char * get_data ( size_t col ) const {
return data [ col ] . value . data ( ) ;
}
std : : string_view get_string_view ( size_t col ) const {
return std : : string_view ( get_data ( col ) ) ;
}
int get_len ( size_t col ) const {
return data [ col ] . len ;
}
} ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
2024-03-17 15:50:40 +00:00
* Returns an opened table given its name and mdb .
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
*/
2024-03-17 15:50:40 +00:00
SmtkTable : : SmtkTable ( MdbHandle * mdb , const char * tablename )
: table ( nullptr )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
MdbCatalogEntry * entry ;
entry = mdb_get_catalogentry_by_name ( mdb , tablename ) ;
if ( ! entry )
2024-03-17 15:50:40 +00:00
return ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
table = mdb_read_table ( entry ) ;
if ( ! table )
2024-03-17 15:50:40 +00:00
return ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
mdb_read_columns ( table ) ;
2024-03-17 15:50:40 +00:00
data . resize ( table - > num_cols ) ;
for ( size_t i = 0 ; i < table - > num_cols ; i + + )
mdb_bind_column ( table , i + 1 , data [ i ] . value . data ( ) , & data [ i ] . len ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
mdb_rewind_table ( table ) ;
2024-03-17 15:50:40 +00:00
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2024-03-17 15:50:40 +00:00
SmtkTable : : ~ SmtkTable ( )
{
if ( table )
mdb_free_tabledef ( table ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
* Utility function which joins three strings , being the second a separator string ,
* usually a " \n " . The third is a format string with an argument list .
2024-03-17 15:50:40 +00:00
* If the original string is empty , then just returns the third .
* The first argument is overwritten with the concatenated string .
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
*/
2024-03-17 15:50:40 +00:00
static void concat ( std : : string & orig , const char * sep , std : : string_view s )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2024-03-17 15:50:40 +00:00
if ( ! orig . empty ( ) )
orig + = sep ;
orig + = s ;
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2024-03-17 15:50:40 +00:00
/*
* Temporary funcion as long as core still has C - strings .
* Equivalent to concat , but takes a C - string as first argument and
* frees it . Returns a newly allocated copy .
*
* Note : taking " const char * const * " is an ugly hack to
* allow passing pointer to " const char * " as well as
* " char * " . Which in turn is necessary , as this function currently
* replaces " const char * " strings .
*/
static void concat ( const char * const * orig_in , const char * sep , std : : string_view s )
{
char * * orig = const_cast < char * * > ( orig_in ) ;
char * to_free = * orig ;
std : : string orig_std ( * orig ? * orig : " " ) ;
concat ( orig_std , sep , s ) ;
* orig = strdup ( orig_std . c_str ( ) ) ;
free ( to_free ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
* A site may be a wreck , which has its own table .
* Parse this table referred by the site idx . If found , put the different info items in
* Subsurface ' s dive_site notes .
* Wreck format :
* | Idx | SiteIdx | Text | Built | Sank | SankTime | Reason | . . . | Notes | TrakId |
*/
static void smtk_wreck_site ( MdbHandle * mdb , char * site_idx , struct dive_site * ds )
{
2024-03-17 15:50:40 +00:00
std : : string notes ;
2024-03-16 21:09:58 +00:00
int i ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
uint32_t d ;
2017-02-20 08:10:07 +00:00
const char * wreck_fields [ ] = { QT_TRANSLATE_NOOP ( " gettextFromC " , " Built " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Sank " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Sank Time " ) ,
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
QT_TRANSLATE_NOOP ( " gettextFromC " , " Reason " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Nationality " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Shipyard " ) ,
QT_TRANSLATE_NOOP ( " gettextFromC " , " ShipType " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Length " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Beam " ) ,
QT_TRANSLATE_NOOP ( " gettextFromC " , " Draught " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Displacement " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Cargo " ) ,
QT_TRANSLATE_NOOP ( " gettextFromC " , " Notes " ) } ;
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , " Wreck " ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Sanity check for table, unlikely but ... */
if ( ! table )
return ;
/* Begin parsing. Write strings to notes only if available.*/
2024-03-17 15:50:40 +00:00
while ( table . fetch_row ( ) ) {
if ( ! strcmp ( table . get_data ( 1 ) , site_idx ) ) {
concat ( notes , " \n " , translate ( " gettextFromC " , " Wreck Data " ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
for ( i = 3 ; i < 16 ; i + + ) {
switch ( i ) {
case 3 :
2024-03-17 15:50:40 +00:00
case 4 : {
std : : string_view tmp = table . get_string_view ( i ) ;
if ( ! tmp . empty ( ) ) {
tmp = tmp . substr ( 0 , tmp . find ( ' ' ) ) ;
concat ( notes , " \n " , format_string_std ( " %s: %s " , wreck_fields [ i - 3 ] , std : : string ( tmp ) . c_str ( ) ) ) ;
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
break ;
2024-03-17 15:50:40 +00:00
}
case 5 : {
std : : string_view tmp = table . get_string_view ( i ) ;
if ( ! tmp . empty ( ) ) {
size_t pos = tmp . rfind ( ' ' ) ;
tmp . remove_prefix ( pos + 1 ) ;
concat ( notes , " \n " , format_string_std ( " %s: %s " , wreck_fields [ i - 3 ] , std : : string ( tmp ) . c_str ( ) ) ) ;
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
break ;
2024-03-17 15:50:40 +00:00
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
case 6 . . . 9 :
case 14 :
2024-03-17 15:50:40 +00:00
case 15 : {
const char * tmp = table . get_data ( i ) ;
if ( ! empty_string ( tmp ) )
concat ( notes , " \n " , format_string_std ( " %s: %s " , wreck_fields [ i - 3 ] , tmp ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
break ;
2024-03-17 15:50:40 +00:00
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
default :
2024-03-17 15:50:40 +00:00
d = lrintl ( strtold ( table . get_data ( 1 ) , NULL ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( d )
2024-03-17 15:50:40 +00:00
concat ( notes , " \n " , format_string_std ( " %s: %d " , wreck_fields [ i - 3 ] , d ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
break ;
}
}
2024-05-04 15:18:08 +00:00
concat ( ds - > notes , " \n " , notes ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
break ;
}
}
}
/*
* Smartrak locations db is quite extensive . This builds a string joining some of
* the data in the style : " Country, State, Locality, Site " if this data are
* available . Uses two tables , Site and Location . Puts Altitude , Depth and Notes
* in Subsurface ' s dive site structure ' s notes if they are available .
* Site format :
* | Idx | Text | LocationIdx | WaterIdx | PlatformIdx | BottomIdx | Latitude | Longitude | Altitude | Depth | Notes | TrakId |
* Location format :
* | Idx | Text | Province | Country | Depth |
*/
core: introduce divelog structure
The parser API was very annoying, as a number of tables
to-be-filled were passed in as pointers. The goal of this
commit is to collect all these tables in a single struct.
This should make it (more or less) clear what is actually
written into the divelog files.
Moreover, it should now be rather easy to search for
instances, where the global logfile is accessed (and it
turns out that there are many!).
The divelog struct does not contain the tables as substructs,
but only collects pointers. The idea is that the "divelog.h"
file can be included without all the other files describing
the numerous tables.
To make it easier to use from C++ parts of the code, the
struct implements a constructor and a destructor. Sadly,
we can't use smart pointers, since the pointers are accessed
from C code. Therfore the constructor and destructor are
quite complex.
The whole commit is large, but was mostly an automatic
conversion.
One oddity of note: the divelog structure also contains
the "autogroup" flag, since that is saved in the divelog.
This actually fixes a bug: Before, when importing dives
from a different log, the autogroup flag was overwritten.
This was probably not intended and does not happen anymore.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-08 20:31:08 +00:00
static void smtk_build_location ( MdbHandle * mdb , char * idx , struct dive_site * * location , struct divelog * log )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2019-08-01 21:50:26 +00:00
int i , rc ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
uint32_t d ;
struct dive_site * ds ;
2018-10-20 18:12:15 +00:00
location_t loc ;
2024-03-17 15:50:40 +00:00
std : : string str , loc_idx , site , notes ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
const char * site_fields [ ] = { QT_TRANSLATE_NOOP ( " gettextFromC " , " Altitude " ) , QT_TRANSLATE_NOOP ( " gettextFromC " , " Depth " ) ,
QT_TRANSLATE_NOOP ( " gettextFromC " , " Notes " ) } ;
/* Read data from Site table. Format notes for the dive site if any.*/
2024-03-17 15:50:40 +00:00
{
SmtkTable table ( mdb , " Site " ) ;
if ( ! table )
return ;
do {
rc = table . fetch_row ( ) ;
} while ( strcasecmp ( table . get_data ( 0 ) , idx ) & & rc ! = 0 ) ;
if ( rc = = 0 )
return ;
loc_idx = table . get_data ( 2 ) ;
site = table . get_data ( 1 ) ;
loc = create_location ( strtod ( table . get_data ( 6 ) , NULL ) , strtod ( table . get_data ( 7 ) , NULL ) ) ;
for ( i = 8 ; i < 11 ; i + + ) {
switch ( i ) {
case 8 :
case 9 :
d = lrintl ( strtold ( table . get_data ( i ) , NULL ) ) ;
if ( d )
concat ( notes , " \n " , format_string_std ( " %s: %d m " , site_fields [ i - 8 ] , d ) ) ;
break ;
case 10 :
if ( ! empty_string ( table . get_data ( i ) ) )
concat ( notes , " \n " , format_string_std ( " %s: %s " , site_fields [ i - 8 ] , table . get_data ( i ) ) ) ;
break ;
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
}
/* Read data from Location table, linked to Site by loc_idx */
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , " Location " ) ;
2019-07-25 19:28:57 +00:00
do {
2024-03-17 15:50:40 +00:00
rc = table . fetch_row ( ) ;
} while ( strcasecmp ( table . get_data ( 0 ) , loc_idx . c_str ( ) ) & & rc ! = 0 ) ;
if ( rc = = 0 )
2019-08-01 21:50:26 +00:00
return ;
2019-07-25 19:28:57 +00:00
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
* Create a string for Subsurface ' s dive site structure with coordinates
* if available , if the site ' s name doesn ' t previously exists .
*/
2024-03-17 15:50:40 +00:00
if ( ! empty_string ( table . get_data ( 3 ) ) )
concat ( str , " , " , table . get_string_view ( 3 ) ) ; // Country
if ( ! empty_string ( table . get_data ( 2 ) ) )
concat ( str , " , " , table . get_string_view ( 2 ) ) ; // State - Province
if ( ! empty_string ( table . get_data ( 1 ) ) )
concat ( str , " , " , table . get_string_view ( 1 ) ) ; // Locality
concat ( str , " , " , site ) ;
2024-05-11 12:22:33 +00:00
ds = log - > sites - > get_by_name ( str ) ;
2018-10-23 10:42:01 +00:00
if ( ! ds ) {
2018-10-20 18:12:15 +00:00
if ( ! has_location ( & loc ) )
2024-05-11 12:22:33 +00:00
ds = log - > sites - > create ( str ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
else
2024-05-12 20:30:15 +00:00
ds = log - > sites - > create ( str , loc ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2018-10-26 15:03:54 +00:00
* location = ds ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Insert site notes */
2024-05-04 15:18:08 +00:00
ds - > notes = notes . c_str ( ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Check if we have a wreck */
smtk_wreck_site ( mdb , idx , ds ) ;
}
2017-03-16 15:55:40 +00:00
static void smtk_build_tank_info ( MdbHandle * mdb , cylinder_t * tank , char * idx )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
int i ;
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , " Tank " ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( ! table )
return ;
for ( i = 1 ; i < = atoi ( idx ) ; i + + )
2024-03-17 15:50:40 +00:00
table . fetch_row ( ) ;
tank - > type . description = copy_string ( table . get_data ( 1 ) ) ;
tank - > type . size . mliter = lrint ( strtod ( table . get_data ( 2 ) , NULL ) * 1000 ) ;
tank - > type . workingpressure . mbar = lrint ( strtod ( table . get_data ( 4 ) , NULL ) * 1000 ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2017-03-16 15:41:50 +00:00
/*
* Under some circustances we can get the same tank from DC and from
* the smartrak DB . Will use this utility to check and clean .
*/
2024-03-16 21:09:58 +00:00
static bool is_same_cylinder ( cylinder_t * cyl_a , cylinder_t * cyl_b )
2017-03-16 15:41:50 +00:00
{
// different gasmixes (non zero)
2017-03-17 22:10:36 +00:00
if ( cyl_a - > gasmix . o2 . permille - cyl_b - > gasmix . o2 . permille ! = 0 & &
2017-03-16 15:41:50 +00:00
cyl_a - > gasmix . o2 . permille ! = 0 & &
cyl_b - > gasmix . o2 . permille ! = 0 )
2017-03-17 22:10:36 +00:00
return false ;
2017-03-16 15:41:50 +00:00
// different start pressures (possible error 0.1 bar)
2017-03-17 22:10:36 +00:00
if ( ! ( abs ( cyl_a - > start . mbar - cyl_b - > start . mbar ) < = 100 ) )
2017-03-16 15:41:50 +00:00
return false ;
// different end pressures (possible error 0.1 bar)
2017-03-17 22:10:36 +00:00
if ( ! ( abs ( cyl_a - > end . mbar - cyl_b - > end . mbar ) < = 100 ) )
2017-03-16 15:41:50 +00:00
return false ;
// different names (none of them null)
if ( ! same_string ( cyl_a - > type . description , " --- " ) & &
! same_string ( cyl_b - > type . description , " --- " ) & &
! same_string ( cyl_a - > type . description , cyl_b - > type . description ) )
return false ;
// Cylinders are most probably the same
return true ;
}
/*
* Next three functions were removed from dive . c just when I was going to use them
* for this import ( see 16276f aa ) . Will tweak them a bit and will use for our needs
* Macros are copied from dive . c
*/
2024-03-23 08:16:59 +00:00
# define MERGE_MAX(res, a, b, n) res->n = std::max(a->n, b->n)
# define MERGE_MIN(res, a, b, n) res->n = (a->n) ? (b->n) ? std::min(a->n, b->n) : (a->n) : (b->n)
2017-03-16 15:41:50 +00:00
static void merge_cylinder_type ( cylinder_type_t * src , cylinder_type_t * dst )
{
if ( ! dst - > size . mliter )
dst - > size . mliter = src - > size . mliter ;
if ( ! dst - > workingpressure . mbar )
dst - > workingpressure . mbar = src - > workingpressure . mbar ;
if ( ! dst - > description | | same_string ( dst - > description , " --- " ) ) {
dst - > description = src - > description ;
src - > description = NULL ;
}
}
2018-08-16 17:10:10 +00:00
static void merge_cylinder_mix ( struct gasmix src , struct gasmix * dst )
2017-03-16 15:41:50 +00:00
{
if ( ! dst - > o2 . permille )
2018-08-16 17:10:10 +00:00
* dst = src ;
2017-03-16 15:41:50 +00:00
}
static void merge_cylinder_info ( cylinder_t * src , cylinder_t * dst )
{
merge_cylinder_type ( & src - > type , & dst - > type ) ;
2018-08-16 17:10:10 +00:00
merge_cylinder_mix ( src - > gasmix , & dst - > gasmix ) ;
2017-03-16 15:41:50 +00:00
MERGE_MAX ( dst , dst , src , start . mbar ) ;
MERGE_MIN ( dst , dst , src , end . mbar ) ;
if ( ! dst - > cylinder_use )
dst - > cylinder_use = src - > cylinder_use ;
}
/*
* Remove unused tanks and merge cylinders if there are signs that
* they might be duplicated . Higher numbers are more prone to be unused ,
* so will make the clean reverse order .
* When a used cylinder is found , check against previous one ; if they are
* both the same , merge and delete the higher number ( as lower numbers are
* most probably returned by libdivecomputer raw data parse .
*/
2024-03-16 21:09:58 +00:00
static void smtk_clean_cylinders ( struct dive * d )
2017-03-16 15:41:50 +00:00
{
int i = tanks - 1 ;
2019-08-04 20:13:49 +00:00
cylinder_t * cyl , * base = get_cylinder ( d , 0 ) ;
2017-03-16 15:41:50 +00:00
cyl = base + tanks - 1 ;
while ( cyl ! = base ) {
if ( same_string ( cyl - > type . description , " --- " ) & & cyl - > start . mbar = = 0 & & cyl - > end . mbar = = 0 )
remove_cylinder ( d , i ) ;
else
if ( is_same_cylinder ( cyl , cyl - 1 ) ) {
merge_cylinder_info ( cyl , cyl - 1 ) ;
remove_cylinder ( d , i ) ;
}
cyl - - ;
i - - ;
}
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
2018-08-23 19:44:10 +00:00
* List related functions
*/
struct types_list {
int idx ;
char * text ;
struct types_list * next ;
} ;
/*
* Build a list from a given table_name ( Type , Gear , etc )
* Managed tables formats : Just consider Idx and Text
* Type :
* | Idx | Text | Default ( bool )
* Activity :
* | Idx | Text | Default ( bool )
* Gear :
* | Idx | Text | Vendor | Type | Typenum | Notes | Default ( bool ) | TrakId
* Fish :
* | Idx | Text | Name | Latin name | Typelength | Maxlength | Picture | Default ( bool ) | TrakId
* TODO : Although all divelogs I ' ve seen use * only * the Text field , a concerned diver could
* be using some other like Vendor ( in Gear ) or Latin name ( in Fish ) . I ' ll take a look at this
* in the future , may be something like Buddy table . . .
*/
2024-03-17 15:50:40 +00:00
static std : : vector < std : : string > smtk_build_list ( MdbHandle * mdb , const char * table_name )
2018-08-23 19:44:10 +00:00
{
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , table_name ) ;
2018-08-23 19:44:10 +00:00
if ( ! table )
2024-03-17 15:50:40 +00:00
return { } ;
2018-08-23 19:44:10 +00:00
2020-08-02 08:39:39 +00:00
/* Read the table items into the array */
2024-03-17 15:50:40 +00:00
std : : vector < std : : string > res ;
while ( table . fetch_row ( ) ) {
std : : string str ( table . get_data ( 1 ) ) ;
if ( str = = " --- " | | str = = " -- " )
str . clear ( ) ;
int pos = atoi ( table . get_data ( 0 ) ) - 1 ;
if ( pos < 0 )
continue ;
if ( pos > = ( int ) res . size ( ) )
res . resize ( pos + 1 ) ;
res [ pos ] = std : : move ( str ) ;
2018-09-05 19:48:52 +00:00
}
2024-03-17 15:50:40 +00:00
return res ;
2018-08-23 19:44:10 +00:00
}
/*
* Parses a relation table and returns a list with the relations for a dive idx .
* Use types_list items with text set to NULL .
* Returns a pointer to the list head .
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
* Table relation format :
* | Diveidx | Idx |
*/
2024-03-17 15:50:40 +00:00
static std : : vector < int > smtk_index_list ( MdbHandle * mdb , const char * table_name , char * dive_idx )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , table_name ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Sanity check */
if ( ! table )
2024-03-17 15:50:40 +00:00
return { } ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Parse the table searching for dive_idx */
2024-03-17 15:50:40 +00:00
std : : vector < int > res ;
while ( table . fetch_row ( ) ) {
if ( ! strcmp ( dive_idx , table . get_data ( 0 ) ) )
res . push_back ( atoi ( table . get_data ( 1 ) ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2024-03-17 15:50:40 +00:00
return res ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
2018-08-23 19:44:10 +00:00
* " Buddy " is a bit special table that needs some extra work , so we can ' t just use smtk_build_list .
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
* " Buddy " table is a buddies relation with lots and lots and lots of data ( even buddy mother ' s
* maiden name ; - ) ) most of them useless for a dive log . Let ' s just consider the nickname as main
* field and the full name if this exists and its construction is different from the nickname .
* Buddy table format :
* | Idx | Text ( nickname ) | Name | Firstname | Middlename | Title | Picture | Phone | . . .
*/
2024-03-17 15:50:40 +00:00
static std : : vector < std : : string > smtk_build_buddies ( MdbHandle * mdb )
2019-02-23 17:31:02 +00:00
{
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , " Buddy " ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( ! table )
2024-03-17 15:50:40 +00:00
return { } ;
std : : vector < std : : string > res ;
while ( table . fetch_row ( ) ) {
std : : string fullname ;
if ( ! empty_string ( table . get_data ( 3 ) ) )
concat ( fullname , " " , table . get_string_view ( 3 ) ) ;
if ( ! empty_string ( table . get_data ( 4 ) ) )
concat ( fullname , " " , table . get_string_view ( 4 ) ) ;
if ( ! empty_string ( table . get_data ( 2 ) ) )
concat ( fullname , " " , table . get_string_view ( 2 ) ) ;
std : : string str = ! fullname . empty ( ) & & fullname ! = table . get_data ( 1 ) ?
format_string_std ( " %s (%s) " , table . get_data ( 1 ) , fullname . c_str ( ) ) :
std : : string ( table . get_string_view ( 1 ) ) ;
int pos = atoi ( table . get_data ( 0 ) ) - 1 ;
if ( pos < 0 )
continue ;
if ( static_cast < size_t > ( pos ) > = res . size ( ) )
res . resize ( pos + 1 ) ;
res [ pos ] = std : : move ( str ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2024-03-17 15:50:40 +00:00
return res ;
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2024-03-17 15:50:40 +00:00
/*
* Helper function that gets an element of a vector or a default constructed value
* if out - of - bounds .
*/
template < typename T >
T get ( const std : : vector < T > & v , int idx )
{
return idx > = 0 & & static_cast < size_t > ( idx ) < v . size ( ) ? v [ idx ] : T ( ) ;
2018-08-23 19:44:10 +00:00
}
/*
* Returns string with buddies names as registered in smartrak ( may be a nickname ) .
*/
2024-03-17 15:50:40 +00:00
static std : : string smtk_locate_buddy ( MdbHandle * mdb , char * dive_idx , const std : : vector < std : : string > & buddies_list )
2018-08-23 19:44:10 +00:00
{
2024-03-17 15:50:40 +00:00
std : : string str ;
2018-08-23 19:44:10 +00:00
2024-03-17 15:50:40 +00:00
std : : vector < int > rel_list = smtk_index_list ( mdb , " BuddyRelation " , dive_idx ) ;
for ( int idx : rel_list )
concat ( str , " , " , std : : string ( get ( buddies_list , idx - 1 ) ) ) ;
2018-08-23 19:44:10 +00:00
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
return str ;
}
/* Parses the dive_type mdb tables and import the data into dive's
* taglist structure or notes . If there are tags that affects dive ' s dive_mode
* ( SCR , CCR or so ) , set the dive mode too .
* The " tag " parameter is used to mark if we want this table to be imported
* into tags or into notes .
*/
2024-03-17 15:50:40 +00:00
static void smtk_parse_relations ( MdbHandle * mdb , struct dive * dive , char * dive_idx , const char * table_name , const char * rel_table_name , const std : : vector < std : : string > & list , bool tag )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2024-03-17 15:50:40 +00:00
std : : string tmp ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2018-08-23 19:44:10 +00:00
/* Get the text associated with the relations */
2024-03-17 15:50:40 +00:00
std : : vector < int > diverel_list = smtk_index_list ( mdb , rel_table_name , dive_idx ) ;
for ( int idx : diverel_list ) {
const std : : string str = get ( list , idx - 1 ) ;
if ( str . empty ( ) )
2020-04-19 05:54:35 +00:00
continue ;
2018-09-05 19:48:52 +00:00
if ( tag )
2024-03-17 15:50:40 +00:00
taglist_add_tag ( & dive - > tag_list , str . c_str ( ) ) ;
2018-09-05 19:48:52 +00:00
else
2024-03-17 15:50:40 +00:00
concat ( tmp , " , " , str ) ;
if ( str . find ( " SCR " ) ! = std : : string : : npos )
2018-09-05 19:48:52 +00:00
dive - > dc . divemode = PSCR ;
2024-03-17 15:50:40 +00:00
else if ( str . find ( " CCR " ) ! = std : : string : : npos )
2018-09-05 19:48:52 +00:00
dive - > dc . divemode = CCR ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2024-03-17 15:50:40 +00:00
if ( ! tmp . empty ( ) )
concat ( & dive - > notes , " \n " , format_string_std ( " Smartrak %s: %s " , table_name , tmp . c_str ( ) ) ) ;
2018-09-05 19:48:52 +00:00
}
/*
* Add data from tables related in Dives table which are not directly supported
* in Subsurface . Write them as tags or dive notes by setting true or false the
* boolean parameter " tag " .
*/
2024-03-17 15:50:40 +00:00
static void smtk_parse_other ( struct dive * dive , const std : : vector < std : : string > & list , const char * data_name , char * idx , bool tag )
2018-09-05 19:48:52 +00:00
{
int i = atoi ( idx ) - 1 ;
2024-03-17 15:50:40 +00:00
if ( i < 0 | | i > = ( int ) list . size ( ) )
return ;
2018-09-05 19:48:52 +00:00
2024-03-17 15:50:40 +00:00
const std : : string & str = list [ i ] ;
if ( ! str . empty ( ) ) {
2018-09-05 19:48:52 +00:00
if ( tag )
2024-03-17 15:50:40 +00:00
taglist_add_tag ( & dive - > tag_list , str . c_str ( ) ) ;
2018-09-05 19:48:52 +00:00
else
2024-03-17 15:50:40 +00:00
concat ( & dive - > notes , " \n " , format_string_std ( " Smartrak %s: %s " , data_name , str . c_str ( ) ) ) ;
2018-09-05 19:48:52 +00:00
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2017-04-02 21:42:36 +00:00
/*
* Returns a pointer to a bookmark event in an event list if it exists for
* a given time . Return NULL otherwise .
*/
2024-05-25 06:16:57 +00:00
static struct event * find_bookmark ( struct divecomputer & dc , int t )
2017-04-02 21:42:36 +00:00
{
2024-05-25 06:16:57 +00:00
auto it = std : : find_if ( dc . events . begin ( ) , dc . events . end ( ) ,
[ t ] ( auto & ev )
{ return ev . time . seconds = = t & & ev . type = = SAMPLE_EVENT_BOOKMARK ; } ) ;
return it ! = dc . events . end ( ) ? & * it : nullptr ;
2017-04-02 21:42:36 +00:00
}
2017-03-16 14:52:56 +00:00
/*
* Marker table is a mix between Type tables and Relations tables . Its format is
* | Dive Idx | Idx | Text | Type | XPos | YPos | XConnect | YConnect
* Type may be one of 1 = Text ; 2 = DC ; 3 = Tissue Data ; 4 = Photo ( 0 most of time ? ? )
* XPos is time in minutes during the dive ( long int )
* YPos irelevant
* XConnect irelevant
* YConnect irelevant
*/
static void smtk_parse_bookmarks ( MdbHandle * mdb , struct dive * d , char * dive_idx )
{
2024-03-16 21:09:58 +00:00
int time ;
2017-04-02 21:42:36 +00:00
struct event * ev ;
2017-03-16 14:52:56 +00:00
2024-03-17 15:50:40 +00:00
SmtkTable table ( mdb , " Marker " ) ;
2017-04-12 19:46:57 +00:00
if ( ! table ) {
2017-03-16 14:52:56 +00:00
report_error ( " [smtk-import] Error - Couldn't open table 'Marker', dive %d " , d - > number ) ;
2017-04-12 19:46:57 +00:00
return ;
}
2024-03-17 15:50:40 +00:00
while ( table . fetch_row ( ) ) {
if ( same_string ( table . get_data ( 0 ) , dive_idx ) ) {
time = lrint ( strtod ( table . get_data ( 4 ) , NULL ) * 60 ) ;
const char * tmp = table . get_data ( 2 ) ;
2024-05-25 06:16:57 +00:00
ev = find_bookmark ( d - > dc , time ) ;
2017-04-12 19:54:47 +00:00
if ( ev )
2024-05-19 11:21:22 +00:00
ev - > name = tmp ;
2017-04-12 19:54:47 +00:00
else
2017-04-02 21:42:36 +00:00
if ( ! add_event ( & d - > dc , time , SAMPLE_EVENT_BOOKMARK , 0 , 0 , tmp ) )
report_error ( " [smtk-import] Error - Couldn't add bookmark, dive %d, Name = %s " ,
d - > number , tmp ) ;
2017-03-16 14:52:56 +00:00
}
}
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
* Returns a dc_descriptor_t structure based on dc model ' s number .
* This ensures the model pased to libdc_buffer_parser ( ) is a supported model and avoids
* problems with shared model num devices by taking the family into account . The family
* is estimated elsewhere based in dive header length .
*/
static dc_descriptor_t * get_data_descriptor ( int data_model , dc_family_t data_fam )
{
dc_descriptor_t * descriptor = NULL , * current = NULL ;
dc_iterator_t * iterator = NULL ;
dc_status_t rc ;
rc = dc_descriptor_iterator ( & iterator ) ;
if ( rc ! = DC_STATUS_SUCCESS ) {
report_error ( " [Error][libdc] \t \t \t Creating the device descriptor iterator. \n " ) ;
return current ;
}
while ( ( dc_iterator_next ( iterator , & descriptor ) ) = = DC_STATUS_SUCCESS ) {
int desc_model = dc_descriptor_get_model ( descriptor ) ;
dc_family_t desc_fam = dc_descriptor_get_type ( descriptor ) ;
if ( data_fam = = DC_FAMILY_UWATEC_ALADIN ) {
if ( data_model = = desc_model & & data_fam = = desc_fam ) {
current = descriptor ;
break ;
}
} else if ( data_model = = desc_model & & ( desc_fam = = DC_FAMILY_UWATEC_SMART | |
desc_fam = = DC_FAMILY_UWATEC_MERIDIAN ) ) {
current = descriptor ;
break ;
}
dc_descriptor_free ( descriptor ) ;
}
dc_iterator_free ( iterator ) ;
return current ;
}
/*
* Fills a device_data_t structure with known dc data .
* Completes a dc_descriptor_t structure with libdc ' s g_descriptors [ ] table so
* we ensure that data passed for parsing to libdc have a supported and known
* DC . dc_family_t is certainly known * only * if it is Aladin / Memomouse family
* otherwise it will be known after get_data_descriptor call .
*/
2024-05-02 07:50:02 +00:00
static dc_status_t prepare_data ( int data_model , const char * serial , dc_family_t dc_fam , device_data_t & dev_data )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
2024-05-02 07:50:02 +00:00
dev_data . device = NULL ;
dev_data . context = NULL ;
2022-10-21 16:12:11 +00:00
if ( ! data_model ) {
2024-05-02 19:26:22 +00:00
dev_data . model = manual_dc_name ;
2024-05-02 07:50:02 +00:00
dev_data . descriptor = NULL ;
2020-11-01 21:32:43 +00:00
return DC_STATUS_NODEVICE ;
}
2024-05-02 07:50:02 +00:00
dev_data . descriptor = get_data_descriptor ( data_model , dc_fam ) ;
if ( dev_data . descriptor ) {
dev_data . vendor = dc_descriptor_get_vendor ( dev_data . descriptor ) ;
dev_data . product = dc_descriptor_get_product ( dev_data . descriptor ) ;
2024-05-02 19:26:22 +00:00
dev_data . model + = dev_data . vendor + " " + dev_data . product ;
2024-05-02 07:50:02 +00:00
dev_data . devinfo . serial = ( uint32_t ) lrint ( strtod ( serial , NULL ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
return DC_STATUS_SUCCESS ;
} else {
2024-05-02 19:26:22 +00:00
dev_data . model = " unsupported dive computer " ;
2024-05-02 07:50:02 +00:00
dev_data . devinfo . serial = ( uint32_t ) lrint ( strtod ( serial , NULL ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
return DC_STATUS_UNSUPPORTED ;
}
}
/*
* Returns a buffer prepared for libdc parsing .
* Aladin and memomouse dives were imported from datatrak , so they lack of a
* header . Creates a fake header for them and inserts the dc model where libdc
* expects it to be .
*/
static dc_status_t libdc_buffer_complete ( device_data_t * dev_data , unsigned char * hdr_buffer , int hdr_length ,
unsigned char * prf_buffer , int prf_length , unsigned char * compl_buf )
{
2017-01-17 17:53:56 +00:00
switch ( dc_descriptor_get_type ( dev_data - > descriptor ) ) {
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
case DC_FAMILY_UWATEC_ALADIN :
case DC_FAMILY_UWATEC_MEMOMOUSE :
2017-01-17 17:53:56 +00:00
compl_buf [ 3 ] = ( unsigned char ) dc_descriptor_get_model ( dev_data - > descriptor ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
memcpy ( compl_buf + hdr_length , prf_buffer , prf_length ) ;
break ;
case DC_FAMILY_UWATEC_SMART :
case DC_FAMILY_UWATEC_MERIDIAN :
memcpy ( compl_buf , hdr_buffer , hdr_length ) ;
memcpy ( compl_buf + hdr_length , prf_buffer , prf_length ) ;
break ;
default :
2024-03-16 21:09:58 +00:00
return DC_STATUS_UNSUPPORTED ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2024-03-16 21:09:58 +00:00
return DC_STATUS_SUCCESS ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
* Main function .
* Two looping levels using a database for the first level ( " Dives " table )
* and a clone of the first DB for the second level ( each dive items ) . Using
* a DB clone is necessary as calling mdb_fetch_row ( ) over different tables in
* a single DB breaks binded row data , and so would break the top loop .
*/
2024-05-04 16:45:55 +00:00
void smartrak_import ( const char * file , struct divelog * log )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
{
MdbHandle * mdb , * mdb_clon ;
MdbColumn * col [ MDB_MAX_COLS ] ;
2024-03-17 15:50:40 +00:00
int i , dc_model ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2017-01-22 12:43:10 +00:00
// Set an european style locale to work date/time conversion
setlocale ( LC_TIME , " POSIX " ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
mdb = mdb_open ( file , MDB_NOFLAGS ) ;
if ( ! mdb ) {
report_error ( " [Error][smartrak_import] \t File %s does not seem to be an Access database. " , file ) ;
return ;
}
if ( ! mdb_read_catalog ( mdb , MDB_TABLE ) ) {
report_error ( " [Error][smartrak_import] \t File %s does not seem to be an Access database. " , file ) ;
return ;
}
mdb_clon = mdb_clone_handle ( mdb ) ;
mdb_read_catalog ( mdb_clon , MDB_TABLE ) ;
2018-09-05 20:43:47 +00:00
/* Load auxiliary tables */
2024-03-17 15:50:40 +00:00
std : : vector < std : : string > type_list = smtk_build_list ( mdb_clon , " Type " ) ;
std : : vector < std : : string > activity_list = smtk_build_list ( mdb_clon , " Activity " ) ;
std : : vector < std : : string > gear_list = smtk_build_list ( mdb_clon , " Gear " ) ;
std : : vector < std : : string > fish_list = smtk_build_list ( mdb_clon , " Fish " ) ;
std : : vector < std : : string > smtk_ver = smtk_build_list ( mdb_clon , " SmartTrak " ) ;
std : : vector < std : : string > suit_list = smtk_build_list ( mdb_clon , " Suit " ) ;
std : : vector < std : : string > weather_list = smtk_build_list ( mdb_clon , " Weather " ) ;
std : : vector < std : : string > underwater_list = smtk_build_list ( mdb_clon , " Underwater " ) ;
std : : vector < std : : string > surface_list = smtk_build_list ( mdb_clon , " Surface " ) ;
std : : vector < std : : string > buddy_list = smtk_build_buddies ( mdb_clon ) ;
2018-09-05 20:43:47 +00:00
2023-12-16 09:10:57 +00:00
/* Check Smarttrak version (different number of supported tanks, mixes and so).
* File format 10000 is quite different from other formats , just drop it and give
* a tip to the user .
*/
2024-03-17 15:50:40 +00:00
smtk_version = atoi ( get ( smtk_ver , 0 ) . c_str ( ) ) ;
2023-12-16 09:10:57 +00:00
if ( smtk_version = = 10000 ) {
report_error ( " [Error] \t File %s is SmartTrak file format %d which is not supported. Please load the file in a newer SmartTrak software version and upgrade it. " , file , smtk_version ) ;
return ;
}
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
tanks = ( smtk_version < 10213 ) ? 3 : 10 ;
2024-03-17 15:50:40 +00:00
SmtkTable mdb_table ( mdb , " Dives " ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( ! mdb_table ) {
report_error ( " [Error][smartrak_import] \t File %s does not seem to be an SmartTrak file. " , file ) ;
return ;
}
2024-03-17 15:50:40 +00:00
while ( mdb_table . fetch_row ( ) ) {
2024-05-02 07:50:02 +00:00
device_data_t devdata ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
dc_family_t dc_fam = DC_FAMILY_NULL ;
2024-03-17 15:50:40 +00:00
unsigned char * prf_buffer , * hdr_buffer ;
2024-05-16 18:11:21 +00:00
auto smtkdive = std : : make_unique < dive > ( ) ;
2024-03-17 15:50:40 +00:00
struct tm tm_date ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
size_t hdr_length , prf_length ;
2024-03-16 21:09:58 +00:00
dc_status_t rc = DC_STATUS_SUCCESS ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2024-03-17 15:50:40 +00:00
for ( size_t j = 0 ; j < mdb_table . table - > num_cols ; j + + )
col [ j ] = static_cast < MdbColumn * > ( g_ptr_array_index ( mdb_table . table - > columns , j ) ) ;
smtkdive - > number = lrint ( strtod ( mdb_table . get_data ( 1 ) , NULL ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
* If there is a DC model ( no zero ) try to create a buffer for the
* dive and parse it with libdivecomputer
*/
2024-03-17 15:50:40 +00:00
dc_model = lrint ( strtod ( mdb_table . get_data ( coln ( DCMODEL ) ) , NULL ) ) & 0xFF ;
if ( mdb_table . get_len ( coln ( LOG ) ) ) {
2024-03-16 21:09:58 +00:00
hdr_buffer = static_cast < unsigned char * > ( mdb_ole_read_full ( mdb , col [ coln ( LOG ) ] , & hdr_length ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( hdr_length > 0 & & hdr_length < 20 ) // We have a profile but it's imported from datatrak
dc_fam = DC_FAMILY_UWATEC_ALADIN ;
}
2024-05-30 12:40:08 +00:00
rc = prepare_data ( dc_model , ( char * ) col [ coln ( DCNUMBER ) ] - > bind_ptr , dc_fam , devdata ) ;
2024-05-18 15:03:19 +00:00
smtkdive - > dc . model = devdata . model ;
2024-03-17 15:50:40 +00:00
if ( rc = = DC_STATUS_SUCCESS & & mdb_table . get_len ( coln ( PROFILE ) ) ) {
2024-03-16 21:09:58 +00:00
prf_buffer = static_cast < unsigned char * > ( mdb_ole_read_full ( mdb , col [ coln ( PROFILE ) ] , & prf_length ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( prf_length > 0 ) {
2024-05-02 07:50:02 +00:00
if ( dc_descriptor_get_type ( devdata . descriptor ) = = DC_FAMILY_UWATEC_ALADIN | | dc_descriptor_get_type ( devdata . descriptor ) = = DC_FAMILY_UWATEC_MEMOMOUSE )
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
hdr_length = 18 ;
2024-03-17 15:50:40 +00:00
std : : vector < unsigned char > compl_buffer ( hdr_length + prf_length ) ;
2024-05-02 07:50:02 +00:00
rc = libdc_buffer_complete ( & devdata , hdr_buffer , hdr_length , prf_buffer , prf_length , compl_buffer . data ( ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( rc ! = DC_STATUS_SUCCESS ) {
report_error ( " [Error][smartrak_import] \t - %s - for dive %d " , errmsg ( rc ) , smtkdive - > number ) ;
} else {
2024-05-16 18:11:21 +00:00
rc = libdc_buffer_parser ( smtkdive . get ( ) , & devdata , compl_buffer . data ( ) , hdr_length + prf_length ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( rc ! = DC_STATUS_SUCCESS )
report_error ( " [Error][libdc] \t \t - %s - for dive %d " , errmsg ( rc ) , smtkdive - > number ) ;
}
} else {
/* Dives without profile samples (usual in older aladin series) */
report_error ( " [Warning][smartrak_import] \t No profile for dive %d " , smtkdive - > number ) ;
2024-03-16 21:09:58 +00:00
smtkdive - > dc . duration . seconds = smtkdive - > duration . seconds = smtk_time_to_secs ( ( char * ) col [ coln ( DURATION ) ] - > bind_ptr ) ;
smtkdive - > dc . maxdepth . mm = smtkdive - > maxdepth . mm = lrint ( strtod ( ( char * ) col [ coln ( MAXDEPTH ) ] - > bind_ptr , NULL ) * 1000 ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2017-02-23 23:09:06 +00:00
free ( hdr_buffer ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
free ( prf_buffer ) ;
} else {
/* Manual dives or unknown DCs */
report_error ( " [Warning][smartrak_import] \t Manual or unknown dive computer for dive %d " , smtkdive - > number ) ;
2024-03-16 21:09:58 +00:00
smtkdive - > dc . duration . seconds = smtkdive - > duration . seconds = smtk_time_to_secs ( ( char * ) col [ coln ( DURATION ) ] - > bind_ptr ) ;
smtkdive - > dc . maxdepth . mm = smtkdive - > maxdepth . mm = lrint ( strtod ( ( char * ) col [ coln ( MAXDEPTH ) ] - > bind_ptr , NULL ) * 1000 ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
/*
* Cylinder and gasmixes completion .
* Revisit data under some circunstances , e . g . a start pressure = 0 may mean
2017-03-16 15:31:15 +00:00
* that dc doesn ' t support gas control , in this situation let ' s look into mdb data
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
*/
int pstartcol = coln ( PSTART ) ;
int o2fraccol = coln ( O2FRAC ) ;
int hefraccol = coln ( HEFRAC ) ;
int tankidxcol = coln ( TANKIDX ) ;
2017-03-16 16:07:56 +00:00
for ( i = 0 ; i < tanks ; i + + ) {
2024-05-16 18:11:21 +00:00
cylinder_t * tmptank = get_or_create_cylinder ( smtkdive . get ( ) , i ) ;
2020-04-19 16:44:24 +00:00
if ( ! tmptank )
2020-04-19 05:38:19 +00:00
break ;
if ( tmptank - > start . mbar = = 0 )
2024-03-16 21:09:58 +00:00
tmptank - > start . mbar = lrint ( strtod ( ( char * ) col [ ( i * 2 ) + pstartcol ] - > bind_ptr , NULL ) * 1000 ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/*
* If there is a start pressure ensure that end pressure is not zero as
* will be registered in DCs which only keep track of differential pressures ,
* and collect the data registered by the user in mdb
*/
2020-04-19 05:38:19 +00:00
if ( tmptank - > end . mbar = = 0 & & tmptank - > start . mbar ! = 0 )
2024-03-16 21:09:58 +00:00
tmptank - > end . mbar = lrint ( strtod ( ( char * ) col [ ( i * 2 ) + 1 + pstartcol ] - > bind_ptr , NULL ) * 1000 ? : 1000 ) ;
2020-04-19 05:38:19 +00:00
if ( tmptank - > gasmix . o2 . permille = = 0 )
2024-03-16 21:09:58 +00:00
tmptank - > gasmix . o2 . permille = lrint ( strtod ( ( char * ) col [ i + o2fraccol ] - > bind_ptr , NULL ) * 10 ) ;
2017-04-12 19:59:56 +00:00
if ( smtk_version = = 10213 ) {
2020-04-19 05:38:19 +00:00
if ( tmptank - > gasmix . he . permille = = 0 )
2024-03-16 21:09:58 +00:00
tmptank - > gasmix . he . permille = lrint ( strtod ( ( char * ) col [ i + hefraccol ] - > bind_ptr , NULL ) * 10 ) ;
2017-04-12 19:59:56 +00:00
} else {
2020-04-19 05:38:19 +00:00
tmptank - > gasmix . he . permille = 0 ;
2017-04-12 19:59:56 +00:00
}
2024-03-16 21:09:58 +00:00
smtk_build_tank_info ( mdb_clon , tmptank , ( char * ) col [ i + tankidxcol ] - > bind_ptr ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
2017-03-16 16:07:56 +00:00
/* Check for duplicated cylinders and clean them */
2024-05-16 18:11:21 +00:00
smtk_clean_cylinders ( smtkdive . get ( ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Date issues with libdc parser - Take date time from mdb */
2024-03-17 15:50:40 +00:00
smtk_date_to_tm ( ( char * ) col [ coln ( _DATE ) ] - > bind_ptr , & tm_date ) ;
smtk_time_to_tm ( ( char * ) col [ coln ( INTIME ) ] - > bind_ptr , & tm_date ) ;
smtkdive - > dc . when = smtkdive - > when = smtk_timegm ( & tm_date ) ;
2024-03-16 21:09:58 +00:00
smtkdive - > dc . surfacetime . seconds = smtk_time_to_secs ( ( char * ) col [ coln ( INTVAL ) ] - > bind_ptr ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* Data that user may have registered manually if not supported by DC, or not parsed */
if ( ! smtkdive - > airtemp . mkelvin )
2024-03-16 21:09:58 +00:00
smtkdive - > airtemp . mkelvin = C_to_mkelvin ( lrint ( strtod ( ( char * ) col [ coln ( AIRTEMP ) ] - > bind_ptr , NULL ) ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( ! smtkdive - > watertemp . mkelvin )
2024-03-16 21:09:58 +00:00
smtkdive - > watertemp . mkelvin = smtkdive - > mintemp . mkelvin = C_to_mkelvin ( lrint ( strtod ( ( char * ) col [ coln ( MINWATERTEMP ) ] - > bind_ptr , NULL ) ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
if ( ! smtkdive - > maxtemp . mkelvin )
2024-03-16 21:09:58 +00:00
smtkdive - > maxtemp . mkelvin = C_to_mkelvin ( lrint ( strtod ( ( char * ) col [ coln ( MAXWATERTEMP ) ] - > bind_ptr , NULL ) ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
/* No DC related data */
2024-03-16 21:09:58 +00:00
smtkdive - > visibility = strtod ( ( char * ) col [ coln ( VISIBILITY ) ] - > bind_ptr , NULL ) > 25 ? 5 : lrint ( strtod ( ( char * ) col [ 13 ] - > bind_ptr , NULL ) / 5 ) ;
weightsystem_t ws = { { ( int ) lrint ( strtod ( ( char * ) col [ coln ( WEIGHT ) ] - > bind_ptr , NULL ) * 1000 ) } , " " , false } ;
2019-06-26 15:21:03 +00:00
add_cloned_weightsystem ( & smtkdive - > weightsystems , ws ) ;
2024-03-17 15:50:40 +00:00
smtkdive - > suit = strdup ( get ( suit_list , atoi ( ( char * ) col [ coln ( SUITIDX ) ] - > bind_ptr ) - 1 ) . c_str ( ) ) ;
2024-03-16 21:09:58 +00:00
smtk_build_location ( mdb_clon , ( char * ) col [ coln ( SITEIDX ) ] - > bind_ptr , & smtkdive - > dive_site , log ) ;
2024-03-17 15:50:40 +00:00
smtkdive - > buddy = strdup ( smtk_locate_buddy ( mdb_clon , ( char * ) col [ 0 ] - > bind_ptr , buddy_list ) . c_str ( ) ) ;
2024-05-16 18:11:21 +00:00
smtk_parse_relations ( mdb_clon , smtkdive . get ( ) , ( char * ) col [ 0 ] - > bind_ptr , " Type " , " TypeRelation " , type_list , true ) ;
smtk_parse_relations ( mdb_clon , smtkdive . get ( ) , ( char * ) col [ 0 ] - > bind_ptr , " Activity " , " ActivityRelation " , activity_list , false ) ;
smtk_parse_relations ( mdb_clon , smtkdive . get ( ) , ( char * ) col [ 0 ] - > bind_ptr , " Gear " , " GearRelation " , gear_list , false ) ;
smtk_parse_relations ( mdb_clon , smtkdive . get ( ) , ( char * ) col [ 0 ] - > bind_ptr , " Fish " , " FishRelation " , fish_list , false ) ;
smtk_parse_other ( smtkdive . get ( ) , weather_list , " Weather " , ( char * ) col [ coln ( WEATHERIDX ) ] - > bind_ptr , false ) ;
smtk_parse_other ( smtkdive . get ( ) , underwater_list , " Underwater " , ( char * ) col [ coln ( UNDERWATERIDX ) ] - > bind_ptr , false ) ;
smtk_parse_other ( smtkdive . get ( ) , surface_list , " Surface " , ( char * ) col [ coln ( SURFACEIDX ) ] - > bind_ptr , false ) ;
smtk_parse_bookmarks ( mdb_clon , smtkdive . get ( ) , ( char * ) col [ 0 ] - > bind_ptr ) ;
2024-03-17 15:50:40 +00:00
concat ( & smtkdive - > notes , " \n " , std : : string ( ( char * ) col [ coln ( REMARKS ) ] - > bind_ptr ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
2024-05-16 18:11:21 +00:00
record_dive_to_table ( smtkdive . release ( ) , log - > dives . get ( ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}
mdb_free_catalog ( mdb_clon ) ;
mdb - > catalog = NULL ;
mdb_close ( mdb_clon ) ;
mdb_close ( mdb ) ;
2024-05-13 17:34:43 +00:00
sort_dive_table ( log - > dives . get ( ) ) ;
SmartTrak import - Support for .slg files import
SmartTrak is a Windows based propietary dive log software by Uwatec, which has
been the reference software for every Scubapro/Uwatec IRda based devices,
ranging from Smart to Galileo. It has just been recently that began to be
substituted by newer softwares like LogTrak and JTrak (these only supports
Galileo or newer devices and don't import SmartTrak's .slg files).i
SmartTrak also supports importing dives from older DataTrak software (oldest
Aladin series, serial based DCs) so most divers using Scubapro/Uwatec products
have probably their dives registered in this log, even those who have just moved
to newest Scubapro/Uwatec DCs.
SmartTrak is based in MS Access database with support for recreational and
technical dives up to 10 tanks, trimix (in later versions, prior versions had
support for just 3 tanks with Nitrox) and SCR/CCR.
In Linux, MsAccess databases are supported via libmdb which in turn depends on
libglib2, so this work has a hard dependency on these two libraries.
Libmdb sees very little (or null) development activity today so it can be
considered a mature library, which, in my opinion, makes it independent of
progresses of libglib2, this way, the tool should build on most Linux
distributions, even oldest ones (well, this will actually be false because of
the other dependencies of Subsurface).
Final note: It hasn't been until very recently that libdivecomputer has included
support for some of the data downloaded from Galileo devices, even today
understanding some of these data is WIP (e.g. alarms, are interpreted as
bookmarks at this moment, and there is a lot of noise coming from the
tanks/gases area in libdc)
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 17:33:41 +00:00
}