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