diff options
-rw-r--r-- | Documentation/images/icons/tissue.jpg | bin | 0 -> 934 bytes | |||
-rw-r--r-- | Documentation/user-manual.txt | 5 | ||||
-rw-r--r-- | core/pref.h | 1 | ||||
-rw-r--r-- | core/profile.c | 24 | ||||
-rw-r--r-- | core/settings/qPrefTechnicalDetails.cpp | 2 | ||||
-rw-r--r-- | core/settings/qPrefTechnicalDetails.h | 5 | ||||
-rw-r--r-- | core/subsurfacestartup.c | 1 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 5 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.ui | 18 | ||||
-rw-r--r-- | icons/tissue.png | bin | 0 -> 684 bytes | |||
-rw-r--r-- | subsurface.qrc | 1 |
11 files changed, 49 insertions, 13 deletions
diff --git a/Documentation/images/icons/tissue.jpg b/Documentation/images/icons/tissue.jpg Binary files differnew file mode 100644 index 000000000..336882d4d --- /dev/null +++ b/Documentation/images/icons/tissue.jpg diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 010c67202..e05fcaba1 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -2117,6 +2117,11 @@ time. Even if the profile contains several gas switches, TTS at a specific moment during the dive is calculated using the current gas. TTS longer than 2 hours is not accurately calculated and Subsurface only indicates _TTS > 2h_. +[icon="images/icons/tissue.png"] +[NOTE] +Show *Deco information*. When enabled, the information box shows the surface GF and the momentary +ceilings for the individual tissue compartments. + [icon="images/icons/SAC.jpg"] [NOTE] Show the *Surface Air Consumption (SAC)*, an indication of the surface-normalized respiration diff --git a/core/pref.h b/core/pref.h index ee297780f..6acbc8f6a 100644 --- a/core/pref.h +++ b/core/pref.h @@ -176,6 +176,7 @@ struct preferences { bool calcceiling; bool calcceiling3m; bool calcndltts; + bool decoinfo; // Show deco info in infobox bool dcceiling; enum deco_mode display_deco_mode; bool display_unused_tanks; diff --git a/core/profile.c b/core/profile.c index e9a8b6fe9..b8c81e195 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1504,17 +1504,19 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me } if (entry->rbt) put_format_loc(b, translate("gettextFromC", "RBT: %umin\n"), DIV_UP(entry->rbt, 60)); - if (entry->surface_gf > 0) - put_format(b, translate("gettextFromC", "Surface GF %.0f%%\n"), entry->surface_gf); - if (entry->ceiling) { - depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit); - put_format_loc(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit); - if (prefs.calcalltissues) { - int k; - for (k = 0; k < 16; k++) { - if (entry->ceilings[k]) { - depthvalue = get_depth_units(entry->ceilings[k], NULL, &depth_unit); - put_format_loc(b, translate("gettextFromC", "Tissue %.0fmin: %.1f%s\n"), buehlmann_N2_t_halflife[k], depthvalue, depth_unit); + if (prefs.decoinfo) { + if (entry->surface_gf > 0) + put_format(b, translate("gettextFromC", "Surface GF %.0f%%\n"), entry->surface_gf); + if (entry->ceiling) { + depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit); + put_format_loc(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit); + if (prefs.calcalltissues) { + int k; + for (k = 0; k < 16; k++) { + if (entry->ceilings[k]) { + depthvalue = get_depth_units(entry->ceilings[k], NULL, &depth_unit); + put_format_loc(b, translate("gettextFromC", "Tissue %.0fmin: %.1f%s\n"), buehlmann_N2_t_halflife[k], depthvalue, depth_unit); + } } } } diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp index fcc77863a..78e2c13d0 100644 --- a/core/settings/qPrefTechnicalDetails.cpp +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -56,6 +56,8 @@ HANDLE_PREFERENCE_BOOL(TechnicalDetails, "calcceiling3m", calcceiling3m); HANDLE_PREFERENCE_BOOL(TechnicalDetails, "calcndltts", calcndltts); +HANDLE_PREFERENCE_BOOL(TechnicalDetails, "decoinfo", decoinfo); + HANDLE_PREFERENCE_BOOL(TechnicalDetails, "dcceiling", dcceiling); HANDLE_PREFERENCE_ENUM(TechnicalDetails, deco_mode, "display_deco_mode", display_deco_mode); diff --git a/core/settings/qPrefTechnicalDetails.h b/core/settings/qPrefTechnicalDetails.h index bf82f2099..de439815a 100644 --- a/core/settings/qPrefTechnicalDetails.h +++ b/core/settings/qPrefTechnicalDetails.h @@ -12,6 +12,7 @@ class qPrefTechnicalDetails : public QObject { Q_PROPERTY(bool calcceiling READ calcceiling WRITE set_calcceiling NOTIFY calcceilingChanged); Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE set_calcceiling3m NOTIFY calcceiling3mChanged); Q_PROPERTY(bool calcndltts READ calcndltts WRITE set_calcndltts NOTIFY calcndlttsChanged); + Q_PROPERTY(bool decoinfo READ decoinfo WRITE set_decoinfo NOTIFY decoinfoChanged); Q_PROPERTY(bool dcceiling READ dcceiling WRITE set_dcceiling NOTIFY dcceilingChanged); Q_PROPERTY(deco_mode display_deco_mode READ display_deco_mode WRITE set_display_deco_mode NOTIFY display_deco_modeChanged); Q_PROPERTY(bool display_unused_tanks READ display_unused_tanks WRITE set_display_unused_tanks NOTIFY display_unused_tanksChanged); @@ -50,6 +51,7 @@ public: static bool calcceiling() { return prefs.calcceiling; } static bool calcceiling3m() { return prefs.calcceiling3m; } static bool calcndltts() { return prefs.calcndltts; } + static bool decoinfo() { return prefs.decoinfo; } static bool dcceiling() { return prefs.dcceiling; } static deco_mode display_deco_mode() { return prefs.display_deco_mode; } static bool display_unused_tanks() { return prefs.display_unused_tanks; } @@ -79,6 +81,7 @@ public slots: static void set_calcceiling(bool value); static void set_calcceiling3m(bool value); static void set_calcndltts(bool value); + static void set_decoinfo(bool value); static void set_dcceiling(bool value); static void set_display_deco_mode(deco_mode value); static void set_display_unused_tanks(bool value); @@ -108,6 +111,7 @@ signals: void calcceilingChanged(bool value); void calcceiling3mChanged(bool value); void calcndlttsChanged(bool value); + void decoinfoChanged(bool value); void dcceilingChanged(bool value); void display_deco_modeChanged(deco_mode value); void display_unused_tanksChanged(bool value); @@ -137,6 +141,7 @@ private: static void disk_calcceiling(bool doSync); static void disk_calcceiling3m(bool doSync); static void disk_calcndltts(bool doSync); + static void disk_decoinfo(bool doSync); static void disk_dcceiling(bool doSync); static void disk_display_deco_mode(bool doSync); static void disk_display_unused_tanks(bool doSync); diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c index 3669cc8ec..4acf86a17 100644 --- a/core/subsurfacestartup.c +++ b/core/subsurfacestartup.c @@ -34,6 +34,7 @@ struct preferences default_prefs = { .calcceiling = false, .calcceiling3m = false, .calcndltts = false, + .decoinfo = true, .gflow = 30, .gfhigh = 75, .animation_speed = 500, diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 2d1f61d2b..9a70d9ec7 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -147,7 +147,7 @@ MainWindow::MainWindow() : QMainWindow(), ui.profPhe, ui.profPn2, ui.profPO2, // partial pressure graphs ui.profRuler, ui.profScaled, // measuring and scaling ui.profTogglePicture, ui.profTankbar, - ui.profMod, ui.profNdl_tts, // various values that a user is either interested in or not + ui.profMod, ui.profDeco, ui.profNdl_tts, // various values that a user is either interested in or not ui.profEad, ui.profSAC, ui.profHR, // very few dive computers support this ui.profTissues}; // maybe less frequently used @@ -293,6 +293,7 @@ MainWindow::MainWindow() : QMainWindow(), connect(ui.profIncrement3m, &QAction::triggered, tec, &qPrefTechnicalDetails::set_calcceiling3m); connect(ui.profMod, &QAction::triggered, tec, &qPrefTechnicalDetails::set_mod); connect(ui.profNdl_tts, &QAction::triggered, tec, &qPrefTechnicalDetails::set_calcndltts); + connect(ui.profDeco, &QAction::triggered, tec, &qPrefTechnicalDetails::set_decoinfo); connect(ui.profHR, &QAction::triggered, tec, &qPrefTechnicalDetails::set_hrgraph); connect(ui.profRuler, &QAction::triggered, tec, &qPrefTechnicalDetails::set_rulergraph); connect(ui.profSAC, &QAction::triggered, tec, &qPrefTechnicalDetails::set_show_sac); @@ -345,6 +346,7 @@ MainWindow::MainWindow() : QMainWindow(), ui.profIncrement3m->setChecked(qPrefTechnicalDetails::calcceiling3m()); ui.profMod->setChecked(qPrefTechnicalDetails::mod()); ui.profNdl_tts->setChecked(qPrefTechnicalDetails::calcndltts()); + ui.profDeco->setChecked(qPrefTechnicalDetails::decoinfo()); ui.profPhe->setChecked(pp_gas->phe()); ui.profPn2->setChecked(pp_gas->pn2()); ui.profPO2->setChecked(pp_gas->po2()); @@ -447,6 +449,7 @@ void MainWindow::configureToolbar() { ui.profTankbar->setDisabled(freeDiveMode); ui.profMod->setDisabled(freeDiveMode); ui.profNdl_tts->setDisabled(freeDiveMode); + ui.profDeco->setDisabled(freeDiveMode); ui.profEad->setDisabled(freeDiveMode); ui.profSAC->setDisabled(freeDiveMode); ui.profTissues->setDisabled(freeDiveMode); diff --git a/desktop-widgets/mainwindow.ui b/desktop-widgets/mainwindow.ui index afd4168eb..b92a02e5f 100644 --- a/desktop-widgets/mainwindow.ui +++ b/desktop-widgets/mainwindow.ui @@ -59,7 +59,7 @@ <x>0</x> <y>0</y> <width>861</width> - <height>29</height> + <height>22</height> </rect> </property> <widget class="QMenu" name="menuFile"> @@ -701,6 +701,21 @@ <string>Cloud stora&ge online</string> </property> </action> + <action name="profDeco"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="icon"> + <iconset resource="../subsurface.qrc"> + <normaloff>:/tissue-icon</normaloff>:/tissue-icon</iconset> + </property> + <property name="text"> + <string>Toggle deco information</string> + </property> + <property name="toolTip"> + <string>Toggle deco information</string> + </property> + </action> </widget> <customwidgets> <customwidget> @@ -712,6 +727,7 @@ </customwidgets> <resources> <include location="../subsurface.qrc"/> + <include location="../subsurface.qrc"/> </resources> <connections/> </ui> diff --git a/icons/tissue.png b/icons/tissue.png Binary files differnew file mode 100644 index 000000000..15ce7a246 --- /dev/null +++ b/icons/tissue.png diff --git a/subsurface.qrc b/subsurface.qrc index 67c7b6612..20dd9236b 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -94,5 +94,6 @@ <file alias="video-icon">icons/video.svg</file> <file alias="video-overlay">icons/video_overlay.svg</file> <file alias="unknown-icon">icons/unknown.svg</file> + <file alias="tissue-icon">icons/tissue.png</file> </qresource> </RCC> |