2014-01-14 18:43:58 +00:00
|
|
|
#ifndef DIVEPLOTDATAMODEL_H
|
|
|
|
#define DIVEPLOTDATAMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
2014-02-04 19:34:16 +00:00
|
|
|
#include "display.h"
|
|
|
|
|
2014-01-14 18:43:58 +00:00
|
|
|
struct dive;
|
|
|
|
struct plot_data;
|
|
|
|
struct plot_info;
|
|
|
|
|
|
|
|
class DivePlotDataModel : public QAbstractTableModel{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-01-21 16:59:19 +00:00
|
|
|
enum {DEPTH, TIME, PRESSURE, TEMPERATURE, USERENTERED, COLOR, CYLINDERINDEX, SENSOR_PRESSURE, INTERPOLATED_PRESSURE,
|
2014-01-21 17:31:56 +00:00
|
|
|
SAC, CEILING, TISSUE_1,TISSUE_2,TISSUE_3,TISSUE_4,TISSUE_5,TISSUE_6,TISSUE_7,TISSUE_8,TISSUE_9,TISSUE_10,
|
2014-01-23 20:03:28 +00:00
|
|
|
TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16, PN2,PHE,PO2,COLUMNS};
|
2014-01-14 18:43:58 +00:00
|
|
|
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;
|
|
|
|
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
|
|
|
|
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
|
|
|
void clear();
|
2014-02-04 19:34:16 +00:00
|
|
|
void setDive(struct dive *d, const plot_info& pInfo);
|
|
|
|
const plot_info& data() const;
|
2014-01-21 16:05:29 +00:00
|
|
|
int id() const;
|
2014-02-11 17:55:14 +00:00
|
|
|
int dcShown() const;
|
2014-01-27 17:14:42 +00:00
|
|
|
double pheMax();
|
|
|
|
double pn2Max();
|
|
|
|
double po2Max();
|
|
|
|
void emitDataChanged();
|
2014-02-04 19:34:16 +00:00
|
|
|
void calculateDecompression();
|
2014-01-14 18:43:58 +00:00
|
|
|
private:
|
2014-02-04 19:34:16 +00:00
|
|
|
plot_info pInfo;
|
2014-01-21 16:05:29 +00:00
|
|
|
int diveId;
|
2014-02-11 17:55:14 +00:00
|
|
|
int dcNr;
|
2014-01-14 18:43:58 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEPLOTDATAMODEL_H
|