Show ceilings for individual tissues

I think that displaying tissue loadings either as pressure or as
percentages is not very intuitive but that it makes much more sense when
translated to ceiling depths.

This change enables just that for the 16 tissues in our calculated ceiling
and visualizes this in the profile graph.

There is a checkbox in the preferences to turn this on. If enabled, all
tissues having non-trivial ceilings are also shown in the info box.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert Helling 2013-05-30 20:56:00 +02:00 committed by Dirk Hohndel
parent 77880b7a07
commit 344a429e48
9 changed files with 97 additions and 24 deletions

View file

@ -403,6 +403,7 @@ void MainWindow::readSettings()
GET_BOOL(v, "dcceiling", prefs.profile_dc_ceiling);
GET_BOOL(v, "calcceiling", prefs.profile_calc_ceiling);
GET_BOOL(v, "calcceiling3m", prefs.calc_ceiling_3m_incr);
GET_BOOL(v, "calcalltissues", prefs.calc_all_tissues);
v = settings.value(QString("gflow"));
if (v.isValid())
prefs.gflow = v.toInt();
@ -479,6 +480,7 @@ void MainWindow::writeSettings()
SAVE_VALUE("redceiling", profile_red_ceiling);
SAVE_VALUE("calcceiling", profile_calc_ceiling);
SAVE_VALUE("calcceiling3m", calc_ceiling_3m_incr);
SAVE_VALUE("calcalltissues", calc_all_tissues);
SAVE_VALUE("dcceiling", profile_dc_ceiling);
SAVE_VALUE("gflow", gflow);
SAVE_VALUE("gfhigh", gfhigh);

View file

@ -41,6 +41,8 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags f) : QDial
ui->calculated_ceiling->setChecked(B(calcceiling, profile_calc_ceiling));
ui->increment_3m->setEnabled(ui->calculated_ceiling->isChecked());
ui->increment_3m->setChecked(B(calcceiling3m, calc_ceiling_3m_incr));
ui->all_tissues->setEnabled(ui->all_tissues->isChecked());
ui->all_tissues->setChecked(B(calcalltissues, calc_all_tissues));
ui->gflow->setValue((int)(I(gflow, gflow)));
ui->gfhigh->setValue((int)(I(gfhigh, gfhigh)));
@ -112,6 +114,7 @@ void PreferencesDialog::syncSettings()
SB("redceiling", ui->red_ceiling);
SB("calcceiling", ui->calculated_ceiling);
SB("calcceiling3m", ui->increment_3m);
SB("calcalltissues", ui->all_tissues);
s.setValue("gflow", ui->gflow->value());
s.setValue("gfhigh", ui->gfhigh->value());
s.endGroup();

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>444</width>
<height>386</height>
<width>604</width>
<height>490</height>
</rect>
</property>
<property name="windowTitle">
@ -116,7 +116,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -624,8 +624,8 @@
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
@ -648,6 +648,16 @@
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="all_tissues">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>show all tissues</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="increment_3m">
<property name="enabled">
@ -890,26 +900,10 @@
</hint>
</hints>
</connection>
<connection>
<sender>dc_ceiling</sender>
<signal>clicked(bool)</signal>
<receiver>red_ceiling</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>288</x>
<y>364</y>
</hint>
<hint type="destinationlabel">
<x>555</x>
<y>371</y>
</hint>
</hints>
</connection>
<connection>
<sender>calculated_ceiling</sender>
<signal>clicked(bool)</signal>
<receiver>increment_3m</receiver>
<receiver>all_tissues</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
@ -922,12 +916,28 @@
</hint>
</hints>
</connection>
<connection>
<sender>calculated_ceiling</sender>
<signal>clicked(bool)</signal>
<receiver>increment_3m</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>198</x>
<y>286</y>
</hint>
<hint type="destinationlabel">
<x>503</x>
<y>286</y>
</hint>
</hints>
</connection>
</connections>
<buttongroups>
<buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup_3"/>
<buttongroup name="buttonGroup_4"/>
<buttongroup name="buttonGroup_5"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>

View file

@ -1072,6 +1072,32 @@ void ProfileGraphicsView::plot_depth_profile()
neatFill->setBrush(pat);
scene()->addItem(neatFill);
}
/* plot the calculated ceiling for all tissues */
if (prefs.calc_all_tissues){
int k;
for (k=0; k<16; k++){
if (prefs.profile_calc_ceiling) {
pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first());
pat.setColorAt(1, QColor(100, 100, 100, 50));
entry = gc.pi.entry;
p.clear();
p.append(QPointF(SCALEGC(0, 0)));
for (i = 0; i < gc.pi.nr; i++, entry++) {
if ((entry->ceilings)[k])
p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k])));
else
p.append(QPointF(SCALEGC(entry->sec, 0)));
}
p.append(QPointF(SCALEGC((entry-1)->sec, 0)));
neatFill = new QGraphicsPolygonItem();
neatFill->setPolygon(p);
neatFill->setBrush(pat);
scene()->addItem(neatFill);
}
}
}
/* next show where we have been bad and crossed the dc's ceiling */
if (prefs.profile_dc_ceiling) {
pat.setColorAt(0, profile_color[CEILING_SHALLOW].first());