From 0787347691aec0521f1e3fa749415aae70bd4cd3 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 17 Jan 2014 11:07:52 -0200 Subject: [PATCH] Add Information about the Pressure to the Model. Added missing information about the pressure to the model; this shows that I didn't do something right, as the model has 0 pressure information. Need to fix that on the next commit. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 6 ++++++ qt-ui/profile/diveplotdatamodel.h | 2 +- qt-ui/profile/diveprofileitem.h | 1 + qt-ui/profile/profilewidget2.cpp | 1 - 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index cbe9cfadc..09985b1ca 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -31,6 +31,9 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const case TEMPERATURE: return item.temperature; case COLOR: return item.velocity; case USERENTERED: return false; + case CYLINDERINDEX: return item.cylinderindex; + case SENSOR_PRESSURE: return item.pressure[0]; + case INTERPOLATED_PRESSURE: return item.pressure[1]; } } if (role == Qt::BackgroundRole) { @@ -61,6 +64,9 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, case TEMPERATURE: return tr("Temperature"); 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"); } return QVariant(); } diff --git a/qt-ui/profile/diveplotdatamodel.h b/qt-ui/profile/diveplotdatamodel.h index 23e078148..6d7191953 100644 --- a/qt-ui/profile/diveplotdatamodel.h +++ b/qt-ui/profile/diveplotdatamodel.h @@ -10,7 +10,7 @@ struct plot_info; class DivePlotDataModel : public QAbstractTableModel{ Q_OBJECT public: - enum {DEPTH, TIME, PRESSURE, TEMPERATURE, USERENTERED, COLOR, COLUMNS}; + enum {DEPTH, TIME, PRESSURE, TEMPERATURE, USERENTERED, COLOR, CYLINDERINDEX, SENSOR_PRESSURE, INTERPOLATED_PRESSURE, COLUMNS}; explicit DivePlotDataModel(QObject* parent = 0); virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index 45c90a1bf..9d2893a65 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -58,4 +58,5 @@ public: virtual void modelDataChanged(); virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); }; + #endif \ No newline at end of file diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 7bb6db4cd..d3d4ec9da 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -335,7 +335,6 @@ void ProfileWidget2::plotDives(QList dives) temperatureItem->setHorizontalDataColumn(DivePlotDataModel::TIME); scene()->addItem(temperatureItem); - emit startProfileState(); }