diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-09-15 14:09:00 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-09-19 21:46:30 -0700 |
commit | 3fc9c1e0053a0ca1d4af7c1e5fb8e118afe0badf (patch) | |
tree | 7b9f8d5124e7beb267d099bf85c0495042781700 /qt-ui/profile/diveplotdatamodel.cpp | |
parent | 7cdf55ffcc8d0525657dd0780f7436284e9b72aa (diff) | |
download | subsurface-3fc9c1e0053a0ca1d4af7c1e5fb8e118afe0badf.tar.gz |
Tissue saturation plot a la Sherwater Pretel
This adds a toolbox icon to turn on a tissue plot inspired by the bar
graph of the Sherwater Petrel,
It shows the inert gas partial pressures for individual compartments. If
they are below the ambient pressure (grey line) they are shown in units of
the ambient pressure, if they are above, the excess is shown as a
percentage of the allowed overpressure for plain Buehlmann. So it has the
same units as a gradient factor. Thus also the a gradient factor line (for
the current depth) is shown.
The different tissues get different colors, greener for the faster ones and bluer
for the slower ones.
Positioning and on/off icon action still need some tender loving care.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 993c09045..51aea1b59 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -54,6 +54,10 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const return item.pressures.o2; case HEARTBEAT: return item.heartbeat; + case AMBPRESSURE: + return AMB_PERCENTAGE; + case GFLINE: + return item.gfline; } } @@ -61,6 +65,10 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const return item.ceilings[index.column() - TISSUE_1]; } + if (role == Qt::DisplayRole && index.column() >= PERCENTAGE_1 && index.column() <= PERCENTAGE_16) { + return item.percentages[index.column() - PERCENTAGE_1]; + } + if (role == Qt::BackgroundRole) { switch (index.column()) { case COLOR: @@ -117,10 +125,15 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, return tr("pHe"); case PO2: return tr("pO₂"); + case AMBPRESSURE: + return tr("Ambient pressure"); } if (role == Qt::DisplayRole && section >= TISSUE_1 && section <= TISSUE_16) { return QString("Ceiling: %1").arg(section - TISSUE_1); } + if (role == Qt::DisplayRole && section >= PERCENTAGE_1 && section <= PERCENTAGE_16) { + return QString("Tissue: %1").arg(section - PERCENTAGE_1); + } return QVariant(); } |