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;
|
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
class DivePlotDataModel : public QAbstractTableModel {
|
|
|
|
Q_OBJECT
|
2014-01-14 18:43:58 +00:00
|
|
|
public:
|
2014-02-28 04:09:57 +00:00
|
|
|
enum {
|
|
|
|
DEPTH,
|
|
|
|
TIME,
|
|
|
|
PRESSURE,
|
|
|
|
TEMPERATURE,
|
|
|
|
USERENTERED,
|
|
|
|
COLOR,
|
|
|
|
CYLINDERINDEX,
|
|
|
|
SENSOR_PRESSURE,
|
|
|
|
INTERPOLATED_PRESSURE,
|
|
|
|
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,
|
2014-09-15 12:09:00 +00:00
|
|
|
PERCENTAGE_1,
|
|
|
|
PERCENTAGE_2,
|
|
|
|
PERCENTAGE_3,
|
|
|
|
PERCENTAGE_4,
|
|
|
|
PERCENTAGE_5,
|
|
|
|
PERCENTAGE_6,
|
|
|
|
PERCENTAGE_7,
|
|
|
|
PERCENTAGE_8,
|
|
|
|
PERCENTAGE_9,
|
|
|
|
PERCENTAGE_10,
|
|
|
|
PERCENTAGE_11,
|
|
|
|
PERCENTAGE_12,
|
|
|
|
PERCENTAGE_13,
|
|
|
|
PERCENTAGE_14,
|
|
|
|
PERCENTAGE_15,
|
|
|
|
PERCENTAGE_16,
|
2014-02-28 04:09:57 +00:00
|
|
|
PN2,
|
|
|
|
PHE,
|
|
|
|
PO2,
|
2015-01-05 07:20:26 +00:00
|
|
|
O2SETPOINT,
|
2015-01-20 18:13:53 +00:00
|
|
|
CCRSENSOR1,
|
|
|
|
CCRSENSOR2,
|
|
|
|
CCRSENSOR3,
|
2014-02-28 04:09:57 +00:00
|
|
|
HEARTBEAT,
|
2014-09-15 12:09:00 +00:00
|
|
|
AMBPRESSURE,
|
|
|
|
GFLINE,
|
2014-12-30 22:27:39 +00:00
|
|
|
INSTANT_MEANDEPTH,
|
2014-02-28 04:09:57 +00:00
|
|
|
COLUMNS
|
|
|
|
};
|
|
|
|
explicit DivePlotDataModel(QObject *parent = 0);
|
|
|
|
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
2014-01-14 18:43:58 +00:00
|
|
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
2014-02-28 04:09:57 +00:00
|
|
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
|
|
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
2014-01-14 18:43:58 +00:00
|
|
|
void clear();
|
2014-02-28 04:09:57 +00:00
|
|
|
void setDive(struct dive *d, const plot_info &pInfo);
|
|
|
|
const plot_info &data() const;
|
2014-03-18 18:26:29 +00:00
|
|
|
unsigned int dcShown() const;
|
2014-01-27 17:14:42 +00:00
|
|
|
double pheMax();
|
|
|
|
double pn2Max();
|
|
|
|
double po2Max();
|
2015-01-20 18:13:53 +00:00
|
|
|
double CCRMax();
|
2014-01-27 17:14:42 +00:00
|
|
|
void emitDataChanged();
|
2014-02-04 19:34:16 +00:00
|
|
|
void calculateDecompression();
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2014-01-14 18:43:58 +00:00
|
|
|
private:
|
2014-07-17 06:36:36 +00:00
|
|
|
struct plot_info pInfo;
|
2014-01-21 16:05:29 +00:00
|
|
|
int diveId;
|
2014-03-18 18:26:29 +00:00
|
|
|
unsigned int dcNr;
|
2014-01-14 18:43:58 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEPLOTDATAMODEL_H
|