Commit graph

7573 commits

Author SHA1 Message Date
Dirk Hohndel
dc47003e5b Update the build rules for .deb based builds
With this we also give up on building daily builds on Ubuntu 12.04
The cmake based infrastructure very much assumes Qt5 at this point.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-08 14:15:42 -07:00
Dirk Hohndel
9f532edb67 Update OBS spec file to current version
The old one was
a) outdated and
b) didn't work with cmake so it was rather misleading to have here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-08 13:34:27 -07:00
Dirk Hohndel
069b4b2b5e Remove the outdated and mislreading README
It's been a LONG time since this was correct

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-08 13:32:23 -07:00
Dirk Hohndel
d6dc1d01df cmake: fix typo
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 20:49:21 -07:00
Tomaz Canabrava
c4a352af1f There's no need to search for a qmake anymore
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:39 -07:00
Tomaz Canabrava
fe37ce02d1 Small changes to the build-script
- libgits version bump to 0.22 (0.21.5 didn't worked here)
- call cmake in build.sh instead of qmake.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:39 -07:00
Tomaz Canabrava
c2bdc58fb8 Make it compilant with the build script
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:39 -07:00
Tomaz Canabrava
6f93590705 Add FindLibdivecomputer.cmake
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:39 -07:00
Tomaz Canabrava
8b2ba50a62 Add a FindLIBGIT2 based on our FindMarble.
It currently searches for the .a (preferred) or the .so in the following
directories, in order: ${CMAKE_CURRENT_SOURCE_DIR}/../libgit2, /usr/local,
and /usr.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:34 -07:00
Tomaz Canabrava
46990f4ac8 Simplify libgit handling on main CMakeLists.txt
We will use the OPTIONS variable to decide to find the
.a or the .so, so there's no need to do checks here.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:09:35 -07:00
Tomaz Canabrava
5a9931f438 Add build options
- add an option to toogle between libgit2 from package vs built from source
- add two options that will be used in the future: use static/dynamic lib

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:08:55 -07:00
Tomaz Canabrava
2e05dbb791 No need to specify Marble dir anymore
We are already looking for the default directory.
*if* cmake doesn't find Marble automatically, the user needs
to specify -DMARBLE_INCLUDE_DIR and -DMARBLE_LIBRARIES

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:07:33 -07:00
Tomaz Canabrava
f13e72c306 Search for Marble in the default build folder
Now we search for Marble in the default build folder, too, which is
CMAKE_CURRENT_SOURCE_DIR/..
Also look for both regular Marble and for our Subsurface branch of Marble
(which uses a different library name).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:07:14 -07:00
Tomaz Canabrava
057231701e Move the pkg_config_library macro to its own file
The pkg_config_library macro is a helper macro and was generating noise
on the main CMakeLists.txt file, so I moved it to another file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:07:07 -07:00
Tomaz Canabrava
e56580229b FindMarble moved to cmake/Modules
This is the correct way to deal with CMake Modules (or at least, the
default way). All our custom CMakeFiles will be here.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:06:54 -07:00
Tomaz Canabrava
85fbd1737c Simplify finding Qt
Qt5 Supports Components, which means that we can list the
components we need to find, instead of specifying one for
each line.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:06:44 -07:00
Dirk Hohndel
06a841f512 Remove the subsurface manpage
Useless, completely out of date.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-06 12:26:14 -07:00
Dirk Hohndel
143ecbf7a2 cmake: second attempt to install our ssrfmarble lib
Sorry for the noise.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 21:10:40 -07:00
Dirk Hohndel
f8a01ee309 cmake: on Linux install our special marble library
If we build our own library, make sure it gets installed as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 20:19:02 -07:00
Dirk Hohndel
5722d5f0dc cmake: add libz to end of linker line on Linux
While I don't need this when building on Fedora 20, OBS builds for
openSUSE appear to fail without this. Strange.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 17:41:35 -07:00
Joakim Bygdell
352433723d Read stored planner prefs when starting.
Back in 5bf23381e we started storing planner settings in prefs.
We need to read those settings back when we start the planner.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 07:40:54 -07:00
Joakim Bygdell
f8a808bcaf Shorten the first leg of the planner.
With the addition of gas reserves in recreational mode
we need to make sure that the first leg is short enough
that we have more gas left than the specified reserve
even when using small cylinders like LP72.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 07:40:33 -07:00
Dirk Hohndel
f07ba421d1 cmake: the application name should be capitalized on Mac
We want Subsurface.app but subsurface and subsurface.exe

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 06:53:17 -07:00
Dirk Hohndel
ce3a169cf9 cmake: try to get the dependency on the .qm files right
This is still not something I'm 100% sure I got right. But at least now it
correctly rebuilds the .qm files...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 21:59:51 -07:00
Dirk Hohndel
1ed1e188fd Update Mac convenience shell script
This script likely is useless for anyone but me, but I like having it in the
source tree in case others can benefit from seeing how the packages are built.

This now is based on out-of-tree cmake builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 16:32:15 -07:00
Dirk Hohndel
e8955e5916 cmake: use the correct macdeployqt command name
Oops, that was silly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 16:30:46 -07:00
Dirk Hohndel
115268c8fd cmake: correctly create a Mac bundle
Don't try to install the TARGET into the Subsurface.app or we get a neat
infinite recursion. As a bundle cmake does all these things automagically.
Right now the version is hard coded which is ugly but since it's determined in
a separate cmake file it seemed non-obvious how to do this right...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 16:29:01 -07:00
Dirk Hohndel
072422075e cmake: try to pick a useful default for the location of Qt translations
Not sure if this will work for most installations - it does work for mine.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 16:21:32 -07:00
Dirk Hohndel
b79c01ab7c cmake: don't always create .qm files
The cmake keywords still confuse me at times.
A custom target is always recreated. How silly. But the correct (I think)
implementation is actually easier...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 16:19:45 -07:00
Dirk Hohndel
41c5b95ee1 cmake: Mac install into Subsurface.app
I guess I should add the code to move that app to /Applications but I never use
it this way... not sure how many people really install from source on a Mac,
anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 13:13:46 -07:00
Dirk Hohndel
09032a2761 cmake: make sure we have no emptry Qt translation names
When building on a Mac for some reason I was getting an empty translation file
name (and therefore and entry that was the whole directory and not a
translation file. This is a bit clumsy but it fixes the problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 13:12:20 -07:00
Dirk Hohndel
d8c44f3470 Fix build on older Macs
In commit 39ffb0fced ("Fix Subsurface build with Qt 5.4.1 and later") Thiago
was a bit too aggressive removing some of our ifdefs for building with older
versions of the SDK...

I need at least this patch to still build on the machine that I use to create
the official binaries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 13:10:23 -07:00
Salvador Cuñat
a37abc4d49 OSTCTools-Add two sample dives
Adds two test dives for OSTCTools.
I've kept the original naming.
Num 173 selected because it implies using EAN32.
Num 80, provided in forum by Philippe Tescari, selected because involves
gas changes (although user don't seems to have set different gas mixes).
Sadly, both dives seems to be from 2N/C devices.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 12:25:52 -07:00
Dirk Hohndel
af9fb32fcd cmake: add ostctools.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 11:05:40 -07:00
Salvador Cuñat
13a0ad020a libdivecomputer.c: Remove unused parameter in parse_gasmixes
data pointer is not used, so it can be safely removed.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:35:03 -07:00
Salvador Cuñat
3ca4e14d5c OSTCTools-Add support to import .dive files
OSTCTools is a windows based software by Robert Angeymar which performs
configuration upgrade, memory analysis and download tasks for H&W OSTC
devices.

Downloaded dives are stored in files (one archive each) with the raw
binary data heavily padded at the begining of the file, and some other
data not included in H&W dive header protocol as the device's serial
number.

The import function simply takes the raw data part of the file and lets
libdivecomputer do the parseing.

Then adds some additional info as OSTC reported dive number and serial
device number.

Please note that OSTCTools is *not* a real logging software, it simply
gets the DC raw data, so there isn't any information about dive site,
equipment and so.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:33:49 -07:00
Salvador Cuñat
ed6ae14a9f Move extern declaration to header file
Move extern declaration of function datatrak_import() to file.h, where it
fits better than in file.c

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:33:11 -07:00
Salvador Cuñat
094d0d9699 libdivecomputer.c: Add support for raw data buffer parse using libdc
Add function libdc_buffer_parser() intended to parse raw data buffers
prepared for libdivecomputer. We have to commit elsewhere the necesary
assembly tasks to achieve consistent data.

Actually only OSTCTools import makes use of this feature. Uwatec families
have been included as I expect to make use of this function for sample
parsing in datatrak import (and, may be in a far future, smartrak).

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:31:43 -07:00
Salvador Cuñat
0fe21637ad libdivecomputer.c: Split dive_cb() callback in two
dive_cb() needs a defined device to work as it's built for DC download
tasks.
Move part of the functionality of dive_cb() to a new function
libdc_header_parser() which can be used to parse headers from raw data
buffers with no device set.
Obviously dive_cb() will call the new funtion for header parsing too.

Two changes in logic:

1- In parse_gasmixes() set data pointer to NULL. This pointer is passed to the
function, but it's not used. While this data pointer exists in DC import, via
dive_cb(), it doesn't in file import as data has previously been set in the
parser.

2- While parsing gas mixes do not return on rc = DC_STATUS_UNSUPORTED because
it would end our dive parsing just if the device doesn't support gases, which
seems undesirable in both, DC or file import.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:30:16 -07:00
Salvador Cuñat
e276ec65ba Add errmsg() function for libdivecomputer.c
Taken as is from libdivecomputer exaples/common.c to improve verbosity
on libdc return codes.
Intended to be used on error messages shown to the user on main window
complementarily to those messages managed by dev_info().

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:28:21 -07:00
Salvador Cuñat
a0904fc4d1 Add dc_descriptor_t structure
While downloading from DC the user sets the vendor and model. In
imports, this is not possible. The parser has to figure out somehow at
least the dive computer model used in a dive basis, as it can even change
over time, and a log file can include several different models.

We will use this structure in import tasks to ensure that data
passed to libdc are consistent with what it expects to find.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:27:09 -07:00
Robert C. Helling
004fa9a26b Spelling corrected
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:25:02 -07:00
Robert C. Helling
e03c5ce8e9 Take gas consumption into account for recreational mode
If there is valid gas information (cylinder size and starting pressure),
also ascent before gas runs out (taking a 40bar reserve into account).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 10:21:40 -07:00
Dirk Hohndel
acaedee159 cmake: make Windows binary a GUI app
This way we don't get the annoying terminal window

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-03 12:36:30 -07:00
Dirk Hohndel
3dac769c33 cmake: correctly link against CoreServices
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-03 12:34:23 -07:00
Dirk Hohndel
6a466d0cfb cmake: build working Windows installer including all the DLLs
Figure out the DLLs we need to include in the installer before building
the installer executable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-03 10:05:05 -07:00
Robert C. Helling
61ff7c5f8b Only do safety stop of dive has at least max depth of 10m
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:46:10 -07:00
Robert C. Helling
cc8d601422 Checkbox and preference for safety stop
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:46:10 -07:00
Joakim Bygdell
cd34fea1db Add 3min safety stop
Fixes #839

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:46:08 -07:00
Robert C. Helling
8571dcf967 Introduce recreational planner mode
This adopts the planner to the needs of the recreational diver. Rather than immediately
starting to ascent doing deco stops this mode, this mode stays at the last manually
entered depth for the maximal time before mandantory stops appear (NDL). It does not
change gas but keeps using the last used cylinder.

TODO: * Grey out unused UI elements of the planner in this mode
      * Start ascent before gas runs out (or into reserve)
      * Do a 3min @ 5m safety stop.

Fixes #840

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-02 09:45:50 -07:00