mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add button to toggle deco info in info box
The info box can get longish. Offer the user to turn off display of deco information (surface GF and individual ceilings). Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
2eebbfa3a4
commit
c9d8b4f605
11 changed files with 49 additions and 13 deletions
BIN
Documentation/images/icons/tissue.jpg
Normal file
BIN
Documentation/images/icons/tissue.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 934 B |
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -34,6 +34,7 @@ struct preferences default_prefs = {
|
|||
.calcceiling = false,
|
||||
.calcceiling3m = false,
|
||||
.calcndltts = false,
|
||||
.decoinfo = true,
|
||||
.gflow = 30,
|
||||
.gfhigh = 75,
|
||||
.animation_speed = 500,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
BIN
icons/tissue.png
Normal file
BIN
icons/tissue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 684 B |
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue