diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-17 15:34:15 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-17 14:04:47 -0800 |
commit | 4ff73cf5370a3233a4caf29ded6e738e3d02b3a0 (patch) | |
tree | 24766d2a532522a7f1a0d94ac7ae471c1b244cc1 /qt-ui/profile/diveplotdatamodel.cpp | |
parent | 779c1b6738c4378be79a46b744da2c556380ca32 (diff) | |
download | subsurface-4ff73cf5370a3233a4caf29ded6e738e3d02b3a0.tar.gz |
Add the gas pressure plot.
Added the Gas Pressure Graph with the related Model Changes
to access the cylinder index, pressure, interpolated pressure
and SAC.
The plot does not correctly plot its color right now but it's not hard to
do.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 09985b1ca..32067d3e0 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -34,6 +34,7 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const case CYLINDERINDEX: return item.cylinderindex; case SENSOR_PRESSURE: return item.pressure[0]; case INTERPOLATED_PRESSURE: return item.pressure[1]; + case SAC: return item.sac; } } if (role == Qt::BackgroundRole) { @@ -65,8 +66,9 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, case COLOR: return tr("Color"); case USERENTERED: return tr("User Entered"); case CYLINDERINDEX: return tr("Cylinder Index"); - case SENSOR_PRESSURE: return tr("Sensor Pressure"); - case INTERPOLATED_PRESSURE: return tr("Interpolated Pressure"); + case SENSOR_PRESSURE: return tr("Pressure S"); + case INTERPOLATED_PRESSURE: return tr("Pressure I"); + case SAC: return tr("SAC"); } return QVariant(); } @@ -88,16 +90,8 @@ void DivePlotDataModel::setDive(dive* d,const plot_info& pInfo) if (d) dc = select_dc(&d->dc); - - /* Create the new plot data */ - if (plotData) - free((void *)plotData); - - plot_info info = pInfo; - plotData = populate_plot_entries(d, dc, &info); // Create the plot data. - analyze_plot_info(&info); // Get the Velocity Color information. - - sampleCount = info.nr; + plotData = pInfo.entry; + sampleCount = pInfo.nr; beginInsertRows(QModelIndex(), 0, sampleCount-1); endInsertRows(); } |