subsurface/subsurface.pro

403 lines
10 KiB
Prolog
Raw Normal View History

CODECFORTR = UTF-8
CODECFORSRC = UTF-8
include(subsurface-configure.pri)
QT_CONFIG -= no-pkg-config
QT = core gui network svg
lessThan(QT_MAJOR_VERSION, 5) {
QT += webkit
} else {
QT += printsupport concurrent
!android: QT += webkitwidgets webkit
android: QT += androidextras
}
INCLUDEPATH += qt-ui $$PWD
DEPENDPATH += qt-ui
mac: TARGET = Subsurface
else: TARGET = subsurface
QMAKE_CLEAN += $$TARGET
VERSION = 4.4.1
VERSION_FILE = $$OUT_PWD/ssrf-version.h
# create a blank VERSION_FILE if missing
system(cat $$VERSION_FILE > /dev/null 2>&1 || touch $$VERSION_FILE)
HEADERS = \
$$VERSION_FILE \
version.h \
cochran.h \
color.h \
deco.h \
device.h \
display.h \
dive.h \
divelist.h \
divesite.h \
file.h \
gettextfromc.h \
gettext.h \
helpers.h \
libdivecomputer.h \
planner.h \
save-html.h \
worldmap-save.h \
worldmap-options.h \
pref.h \
profile.h \
gaspressures.h \
qt-gui.h \
qthelper.h \
units.h \
divecomputer.h \
qt-ui/about.h \
qt-ui/completionmodels.h \
qt-ui/divecomputermanagementdialog.h \
qt-ui/divelistview.h \
qt-ui/divepicturewidget.h \
qt-ui/diveplanner.h \
qt-ui/downloadfromdivecomputer.h \
qt-ui/globe.h \
qt-ui/graphicsview-common.h \
qt-ui/kmessagewidget.h \
qt-ui/maintab.h \
qt-ui/mainwindow.h \
qt-ui/modeldelegates.h \
qt-ui/models.h \
qt-ui/metrics.h \
qt-ui/preferences.h \
qt-ui/printdialog.h \
qt-ui/printlayout.h \
qt-ui/printoptions.h \
qt-ui/simplewidgets.h \
qt-ui/starwidget.h \
qt-ui/subsurfacewebservices.h \
qt-ui/tableview.h \
exif.h \
sha1.h \
statistics.h \
subsurfacestartup.h \
uemis.h \
webservice.h \
qt-ui/divelogimportdialog.h \
qt-ui/tagwidget.h \
qt-ui/groupedlineedit.h \
qt-ui/usermanual.h \
qt-ui/profile/profilewidget2.h \
qt-ui/profile/diverectitem.h \
qt-ui/profile/divepixmapitem.h \
qt-ui/profile/divelineitem.h \
qt-ui/profile/divetextitem.h \
qt-ui/profile/animationfunctions.h \
qt-ui/profile/divecartesianaxis.h \
qt-ui/profile/diveplotdatamodel.h \
qt-ui/profile/diveprofileitem.h \
qt-ui/profile/diveeventitem.h \
qt-ui/profile/divetooltipitem.h \
qt-ui/profile/ruleritem.h \
qt-ui/profile/tankitem.h \
qt-ui/updatemanager.h \
qt-ui/divelogexportdialog.h \
qt-ui/usersurvey.h \
subsurfacesysinfo.h \
qt-ui/configuredivecomputerdialog.h \
configuredivecomputer.h \
configuredivecomputerthreads.h \
devicedetails.h \
Import Datatrak/WLog files Sequentially parses a file, expected to be a Datatrak/WLog divelog, and converts the dive info into Subsurface's dive structure. As my first DC, back in 90s, was an Aladin Air X, the obvious choice of log software was DTrak (Win version). After using it for some time we moved to WLog (shareware software more user friendly than Dtrak, printing capable, and still better, it runs under wine, which, as linux user, was definitive for me). Then, some years later, my last Aladin died and I moved to an OSTC, forcing me to look for a software that support this DC. I found JDivelog which was capable of import Dtrak logs and used it for some time until discovered Subsurface existence and devoted to it. The fact was that importing Dtrak dives in JDivelog and then re-importing them in Subsurface caused a significant data loss (mainly in the profile events and alarms) and weird location of some other info in the dive notes (mostly tag items in the original Dtrak software). This situation can't actually be solved with tools like divelogs.de which causes similar if no greater data loss. Although this won't be a core feature for Subsurface, I expect it can be useful for some other divers as has been for me. Comments and issues: Datatrak/Wlog files include a lot of diving data which are not directly supported in Subsurface, in these cases we choose mostly to use "tags". The lack of some important info in Datatrak archives (e.g. tank's initial pressure) forces us to do some arbitrary assumptions (e.g. initial pressure = 200 bar). There might be archives coming directly from old DOS days, as first versions of Datatrak run on that OS; they were coded CP437 or CP850, while dive logs coming from Win versions seems to be coded CP1252. Finally, Wlog seems to use a mixed confusing style. Program directly converts some of the old encoded chars to iso8859 but is expected there be some issues with non alphabetic chars, e.g. "ª". There are two text fields: "Other activities" and "Dive notes", both limited to 256 char size. We have merged them in Subsurface's "Dive Notes" although the first one could be "tagged", but we're unsure that the user had filled it in a tag friendly way. WLog adds some information to the dive and lets the user to write more than 256 chars notes. This is achieved, while keeping compatibility with DTrak divelogs, by adding a complementary file named equally as the .log file and with .add extension where all this info is stored. We have, still, not worked with this complementary files. This work is based on the paper referenced in butracker #194 which has some errors (e.g. beginning of log and beginning of dive are changed) and a lot of bytes of unknown meaning. Example.log shows, at least, one more byte than those referred in the paper for the O2 Aladin computer, this could be a byte referred to the use of SCR but the lack of an OC dive with O2 computer makes impossible for us to compare. The only way we have figured out to distinguish a priori between SCR and non SCR dives with O2 computers is that the dives are tagged with a "rebreather" tag. Obviously this is not a very trusty way of doing things. In SCR dives, the O2% in mix means, probably, the maximum O2% in the circuit, not the O2% of the EAN mix in the tanks, which would be unknown in this case. The list of DCs related in bug #194 paper seems incomplete, we have added one or two from WLog and discarded those which are known to exist but whose model is unknown, grouping them under the imaginative name of "unknown". The list can easily be increased in the future if we ever know the models identifiers. BTW, in Example.log, 0x00 identifier is used for some DC dives and from my own divelogs is inferred that 0x00 is used for manually entered dives, this could easily be an error in Example.log coming from a preproduction DC model. Example.log which is shipped in datatrak package is included in dives directory for testing pourposes. [Dirk Hohndel: some small cleanups, merged with latest master, support divesites, remove the pointless memset() before free() calls add to cmake build] Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-05 18:38:27 +00:00
datatrak.h \
qt-ui/statistics/monthstatistics.h \
qt-ui/statistics/statisticswidget.h \
qt-ui/statistics/statisticsbar.h \
qt-ui/statistics/yearstatistics.h \
qt-ui/diveshareexportdialog.h \
qt-ui/filtermodels.h \
qt-ui/undocommands.h \
qt-ui/notificationwidget.h
android: HEADERS -= \
qt-ui/usermanual.h \
qt-ui/printdialog.h \
qt-ui/printlayout.h \
qt-ui/printoptions.h
SOURCES = \
version.c \
cochran.c \
Import Datatrak/WLog files Sequentially parses a file, expected to be a Datatrak/WLog divelog, and converts the dive info into Subsurface's dive structure. As my first DC, back in 90s, was an Aladin Air X, the obvious choice of log software was DTrak (Win version). After using it for some time we moved to WLog (shareware software more user friendly than Dtrak, printing capable, and still better, it runs under wine, which, as linux user, was definitive for me). Then, some years later, my last Aladin died and I moved to an OSTC, forcing me to look for a software that support this DC. I found JDivelog which was capable of import Dtrak logs and used it for some time until discovered Subsurface existence and devoted to it. The fact was that importing Dtrak dives in JDivelog and then re-importing them in Subsurface caused a significant data loss (mainly in the profile events and alarms) and weird location of some other info in the dive notes (mostly tag items in the original Dtrak software). This situation can't actually be solved with tools like divelogs.de which causes similar if no greater data loss. Although this won't be a core feature for Subsurface, I expect it can be useful for some other divers as has been for me. Comments and issues: Datatrak/Wlog files include a lot of diving data which are not directly supported in Subsurface, in these cases we choose mostly to use "tags". The lack of some important info in Datatrak archives (e.g. tank's initial pressure) forces us to do some arbitrary assumptions (e.g. initial pressure = 200 bar). There might be archives coming directly from old DOS days, as first versions of Datatrak run on that OS; they were coded CP437 or CP850, while dive logs coming from Win versions seems to be coded CP1252. Finally, Wlog seems to use a mixed confusing style. Program directly converts some of the old encoded chars to iso8859 but is expected there be some issues with non alphabetic chars, e.g. "ª". There are two text fields: "Other activities" and "Dive notes", both limited to 256 char size. We have merged them in Subsurface's "Dive Notes" although the first one could be "tagged", but we're unsure that the user had filled it in a tag friendly way. WLog adds some information to the dive and lets the user to write more than 256 chars notes. This is achieved, while keeping compatibility with DTrak divelogs, by adding a complementary file named equally as the .log file and with .add extension where all this info is stored. We have, still, not worked with this complementary files. This work is based on the paper referenced in butracker #194 which has some errors (e.g. beginning of log and beginning of dive are changed) and a lot of bytes of unknown meaning. Example.log shows, at least, one more byte than those referred in the paper for the O2 Aladin computer, this could be a byte referred to the use of SCR but the lack of an OC dive with O2 computer makes impossible for us to compare. The only way we have figured out to distinguish a priori between SCR and non SCR dives with O2 computers is that the dives are tagged with a "rebreather" tag. Obviously this is not a very trusty way of doing things. In SCR dives, the O2% in mix means, probably, the maximum O2% in the circuit, not the O2% of the EAN mix in the tanks, which would be unknown in this case. The list of DCs related in bug #194 paper seems incomplete, we have added one or two from WLog and discarded those which are known to exist but whose model is unknown, grouping them under the imaginative name of "unknown". The list can easily be increased in the future if we ever know the models identifiers. BTW, in Example.log, 0x00 identifier is used for some DC dives and from my own divelogs is inferred that 0x00 is used for manually entered dives, this could easily be an error in Example.log coming from a preproduction DC model. Example.log which is shipped in datatrak package is included in dives directory for testing pourposes. [Dirk Hohndel: some small cleanups, merged with latest master, support divesites, remove the pointless memset() before free() calls add to cmake build] Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-05 18:38:27 +00:00
datatrak.c \
deco.c \
device.c \
dive.c \
divelist.c \
divesite.c \
equipment.c \
file.c \
gettextfromc.cpp \
git-access.c \
libdivecomputer.c \
liquivision.c \
load-git.c \
main.cpp \
membuffer.c \
parse-xml.c \
planner.c \
profile.c \
gaspressures.c \
divecomputer.cpp \
worldmap-save.c \
save-html.c \
qt-gui.cpp \
qthelper.cpp \
qt-ui/about.cpp \
qt-ui/completionmodels.cpp \
qt-ui/divecomputermanagementdialog.cpp \
qt-ui/divelistview.cpp \
qt-ui/divepicturewidget.cpp \
qt-ui/diveplanner.cpp \
qt-ui/downloadfromdivecomputer.cpp \
qt-ui/globe.cpp \
qt-ui/graphicsview-common.cpp \
qt-ui/kmessagewidget.cpp \
qt-ui/maintab.cpp \
qt-ui/mainwindow.cpp \
qt-ui/modeldelegates.cpp \
qt-ui/models.cpp \
qt-ui/metrics.cpp \
qt-ui/preferences.cpp \
qt-ui/printdialog.cpp \
qt-ui/printlayout.cpp \
qt-ui/printoptions.cpp \
qt-ui/simplewidgets.cpp \
qt-ui/starwidget.cpp \
qt-ui/subsurfacewebservices.cpp \
qt-ui/tableview.cpp \
exif.cpp \
Initial implementation of git save format This saves the dive data into a git object repository instead of a single XML file. We create a git object tree with each dive as a separate file, hierarchically by trip and date. NOTE 1: This largely duplicates the XML saving code, because trying to share it seemed just too painful: the logic is very similar, but the details of the actual strings end up differing sufficiently that there are tons of trivial differences. The git save format is line-based with minimal quoting, while XML quotes everything with either "<..\>" or using single quotes around attributes. NOTE 2: You currently need a dummy "file" to save to, which points to the real save location: the git repository and branch to be used. We should make this a config thing, but for testing, do something like this: echo git /home/torvalds/scuba:linus > git-test to create that git information file, and when you use "Save To" and specify "git-test" as the file to save to, subsurface will use the new git save logic to save to the branch "linus" in the repository found at "/home/torvalds/scuba". NOTE 3: The git save format uses just the git object directory, it does *not* check out the result in any git working tree or index. So after you do a save, you can do git log -p linus to see what actually happened in that branch, but it will not affect any actual checked-out state in the repository. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06 21:28:39 +00:00
save-git.c \
save-xml.c \
sha1.c \
statistics.c \
strtod.c \
subsurfacestartup.c \
time.c \
uemis.c \
uemis-downloader.c \
qt-ui/divelogimportdialog.cpp \
qt-ui/tagwidget.cpp \
qt-ui/groupedlineedit.cpp \
qt-ui/usermanual.cpp \
qt-ui/profile/profilewidget2.cpp \
qt-ui/profile/diverectitem.cpp \
qt-ui/profile/divepixmapitem.cpp \
qt-ui/profile/divelineitem.cpp \
qt-ui/profile/divetextitem.cpp \
qt-ui/profile/animationfunctions.cpp \
qt-ui/profile/divecartesianaxis.cpp \
qt-ui/profile/diveplotdatamodel.cpp \
qt-ui/profile/diveprofileitem.cpp \
qt-ui/profile/diveeventitem.cpp \
qt-ui/profile/divetooltipitem.cpp \
qt-ui/profile/ruleritem.cpp \
qt-ui/profile/tankitem.cpp \
qt-ui/updatemanager.cpp \
qt-ui/divelogexportdialog.cpp \
qt-ui/usersurvey.cpp \
subsurfacesysinfo.cpp \
qt-ui/configuredivecomputerdialog.cpp \
configuredivecomputer.cpp \
configuredivecomputerthreads.cpp \
devicedetails.cpp \
qt-ui/statistics/statisticswidget.cpp \
qt-ui/statistics/yearstatistics.cpp \
qt-ui/statistics/statisticsbar.cpp \
qt-ui/statistics/monthstatistics.cpp \
qt-ui/diveshareexportdialog.cpp \
qt-ui/filtermodels.cpp \
qt-ui/undocommands.cpp \
qt-ui/notificationwidget.cpp \
ostctools.c
android: SOURCES += android.cpp
else: win32: SOURCES += windows.c
else: mac: SOURCES += macos.c
else: SOURCES += linux.c # All other Unix, really
android: SOURCES -= \
qt-ui/usermanual.cpp \
qt-ui/printdialog.cpp \
qt-ui/printlayout.cpp \
qt-ui/printoptions.cpp
FORMS = \
qt-ui/about.ui \
qt-ui/divecomputermanagementdialog.ui \
qt-ui/diveplanner.ui \
qt-ui/downloadfromdivecomputer.ui \
qt-ui/maintab.ui \
qt-ui/mainwindow.ui \
qt-ui/preferences.ui \
qt-ui/printoptions.ui \
qt-ui/renumber.ui \
qt-ui/setpoint.ui \
qt-ui/shifttimes.ui \
qt-ui/shiftimagetimes.ui \
qt-ui/webservices.ui \
qt-ui/tableview.ui \
qt-ui/divelogimportdialog.ui \
qt-ui/searchbar.ui \
qt-ui/divelogexportdialog.ui \
qt-ui/plannerSettings.ui \
qt-ui/usersurvey.ui \
qt-ui/divecomponentselection.ui \
qt-ui/configuredivecomputerdialog.ui \
qt-ui/listfilter.ui \
qt-ui/diveshareexportdialog.ui \
qt-ui/filterwidget.ui \
qt-ui/plannerDetails.ui \
qt-ui/locationInformation.ui
# Nether usermanual or printing is supported on android right now
android: FORMS -= qt-ui/printoptions.ui
greaterThan(QT_MAJOR_VERSION, 4) {
FORMS += qt-ui/socialnetworksdialog.ui
SOURCES += qt-ui/socialnetworks.cpp
HEADERS += qt-ui/socialnetworks.h
DEFINES += FBSUPPORT
}
RESOURCES = subsurface.qrc
TRANSLATIONS = \
translations/subsurface_source.ts \
translations/subsurface_bg_BG.ts \
translations/subsurface_cs.ts \
translations/subsurface_da_DK.ts \
translations/subsurface_de_CH.ts \
translations/subsurface_de_DE.ts \
translations/subsurface_en_GB.ts \
translations/subsurface_es_ES.ts \
translations/subsurface_et_EE.ts \
translations/subsurface_fi_FI.ts \
translations/subsurface_fr_FR.ts \
translations/subsurface_it_IT.ts \
translations/subsurface_lv_LV.ts \
translations/subsurface_nb_NO.ts \
translations/subsurface_nl_NL.ts \
translations/subsurface_pl_PL.ts \
translations/subsurface_pt_BR.ts \
translations/subsurface_pt_PT.ts \
translations/subsurface_ru_RU.ts \
translations/subsurface_sk_SK.ts \
translations/subsurface_sv_SE.ts \
translations/subsurface_tr.ts \
translations/subsurface_zh_TW.ts
# disabled translations as they are below 50%:
# translations/subsurface_el_GR.ts \
# translations/subsurface_he.ts \
# translations/subsurface_hu.ts \
# translations/subsurface_ro_RO.ts \
QTTRANSLATIONS = \
qt_da.qm \
qt_de.qm \
qt_es.qm \
qt_fr.qm \
qt_he.qm \
qt_hu.qm \
qt_pl.qm \
qt_pt.qm \
qt_ru.qm \
qt_sk.qm \
qt_sv.qm \
qt_zh_TW.qm
greaterThan(QT_MAJOR_VERSION, 4) {
QTRANSLATIONS += \
qtbase_de.qm \
qt_fi.qm \
qtbase_fi.qm \
qtbase_hu.qm \
qtbase_ru.qm \
qtbase_sk.qm
}
USERMANUALS = \
user-manual.html \
user-manual_es.html \
user-manual_fr.html \
user-manual_ru.html
doc.commands += $(CHK_DIR_EXISTS) $$OUT_PWD/Documentation || $(MKDIR) $$OUT_PWD/Documentation $$escape_expand(\\n\\t)$(MAKE) -C $$PWD/Documentation OUT=$$OUT_PWD/Documentation/ doc
all.depends += usermanual
usermanual.depends += doc
usermanual.target = $$OUT_PWD/Documentation/user-manual.html
QMAKE_EXTRA_TARGETS += doc usermanual all
# add the generated user manual HTML files to the list of files to remove
# when running make clean
for(MANUAL,USERMANUALS) QMAKE_CLEAN += $$OUT_PWD/Documentation/$$MANUAL
marbledata.commands += $(CHK_DIR_EXISTS) $$OUT_PWD/marbledata || $(COPY_DIR) $$PWD/marbledata $$OUT_PWD
all.depends += marbledata
QMAKE_EXTRA_TARGETS += marbledata
theme.commands += $(CHK_DIR_EXISTS) $$OUT_PWD/theme || $(COPY_DIR) $$PWD/theme $$OUT_PWD
all.depends += theme
QMAKE_EXTRA_TARGETS += theme
android {
android.commands += $(CHK_DIR_EXISTS) $$OUT_PWD/android || $(COPY_DIR) $$PWD/android $$OUT_PWD
all.depends += android
QMAKE_EXTRA_TARGETS += android
}
DESKTOP_FILE = subsurface.desktop
mac: ICON = packaging/macosx/Subsurface.icns
else: ICON = subsurface-icon.svg
MANPAGE = subsurface.1
XSLT_FILES = xslt
ICONS_FILES = icons
DOC_FILES = Documentation/images README ReleaseNotes/ReleaseNotes.txt SupportedDivecomputers.txt
for(MANUAL,USERMANUALS) DOC_FILES += $$OUT_PWD/Documentation/$$MANUAL
THEME_FILES = theme
MARBLEDIR = marbledata/maps marbledata/bitmaps
#DEPLOYMENT_PLUGIN += bearer/qnativewifibearer
DEPLOYMENT_PLUGIN += codecs/qcncodecs codecs/qjpcodecs codecs/qkrcodecs codecs/qtwcodecs
DEPLOYMENT_PLUGIN += imageformats/qgif imageformats/qjpeg imageformats/qsvg
DEPLOYMENT_PLUGIN += iconengines/qsvgicon
#DEPLOYMENT_PLUGIN += sqldrivers/qsqlite
# This information will go into the Windows .rc file and linked into the .exe
QMAKE_TARGET_COMPANY = Subsurface Team
QMAKE_TARGET_DESCRIPTION = Subsurface Dive Log
QMAKE_TARGET_COPYRIGHT = Linus Torvalds, Dirk Hohndel, Tomaz Canabrava and others
# And this is the Mac Info.plist file
# qmake automatically generates sed rules to replace:
# token qmake expansion
# @ICON@ $$ICON
# @TYPEINFO@ first 4 chars of $$QMAKE_PKGINFO_TYPEINFO
# @EXECUTABLE@ $$QMAKE_ORIG_TARGET
# @LIBRARY@ $$QMAKE_ORIG_TARGET
# @SHORT_VERSION@ $$VER_MAJ.$$VER_MIN
QMAKE_INFO_PLIST = packaging/macosx/Info.plist.in
OTHER_FILES += $$DESKTOPFILE $$ICON $$MANPAGE $$XSLT_FILES $$DOC_FILES $$MARBLEDIR \
$$QMAKE_INFO_PLIST
include(subsurface-gen-version.pri)
include(subsurface-install.pri)
# to debug planner issues
#QMAKE_CFLAGS += -DDEBUG_PLAN=31
#QMAKE_CXXFLAGS += -DDEBUG_PLAN=31
# to build debuggable binaries on Windows, you need something like this
#QMAKE_CFLAGS_RELEASE=$$QMAKE_CFLAGS_DEBUG -O0 -g
#QMAKE_CXXFLAGS_RELEASE=$$QMAKE_CXXFLAGS_DEBUG -O0 -g
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_CFLAGS += $$(CFLAGS)
QMAKE_LFLAGS += $$(LDFLAGS)
QMAKE_CPPFLAGS += $$(CPPFLAGS)