mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add the tissues to the profile graph
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8065374793
commit
ce7c3f8314
4 changed files with 21 additions and 1 deletions
|
@ -38,6 +38,11 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const
|
|||
case SAC: return item.sac;
|
||||
}
|
||||
}
|
||||
|
||||
if (role == Qt::DisplayRole && index.column() >= TISSUE_1 && index.column() <= TISSUE_16){
|
||||
return item.ceilings[ index.column() - TISSUE_1];
|
||||
}
|
||||
|
||||
if (role == Qt::BackgroundRole) {
|
||||
switch (index.column()) {
|
||||
case COLOR: return getColor((color_indice_t)(VELOCITY_COLORS_START_IDX + item.velocity));
|
||||
|
@ -77,6 +82,9 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation,
|
|||
case CEILING: return tr("Ceiling");
|
||||
case SAC: return tr("SAC");
|
||||
}
|
||||
if (role == Qt::DisplayRole && section >= TISSUE_1 && section <= TISSUE_16){
|
||||
return QString("Ceiling: %1").arg(section - TISSUE_1);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ class DivePlotDataModel : public QAbstractTableModel{
|
|||
Q_OBJECT
|
||||
public:
|
||||
enum {DEPTH, TIME, PRESSURE, TEMPERATURE, USERENTERED, COLOR, CYLINDERINDEX, SENSOR_PRESSURE, INTERPOLATED_PRESSURE,
|
||||
SAC, CEILING, COLUMNS};
|
||||
SAC, CEILING, TISSUE_1,TISSUE_2,TISSUE_3,TISSUE_4,TISSUE_5,TISSUE_6,TISSUE_7,TISSUE_8,TISSUE_9,TISSUE_10,
|
||||
TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16,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;
|
||||
|
|
|
@ -374,6 +374,16 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
|||
diveComputerText->setText(currentdc->model);
|
||||
diveComputerText->animateMoveTo(1 , sceneRect().height());
|
||||
|
||||
qDeleteAll(allTissues);
|
||||
for(int i = 0; i < 16; i++){
|
||||
DiveCalculatedCeiling *tissueItem = new DiveCalculatedCeiling();
|
||||
tissueItem->setHorizontalAxis(timeAxis);
|
||||
tissueItem->setVerticalAxis(profileYAxis);
|
||||
tissueItem->setModel(dataModel);
|
||||
tissueItem->setVerticalDataColumn(DivePlotDataModel::TISSUE_1 + i);
|
||||
tissueItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
|
||||
scene()->addItem(tissueItem);
|
||||
}
|
||||
emit startProfileState();
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ private:
|
|||
QList<DiveEventItem*> eventItems;
|
||||
DiveTextItem *diveComputerText;
|
||||
DiveCalculatedCeiling *diveCeiling;
|
||||
QList<DiveCalculatedCeiling*> allTissues;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue