2017-04-27 18:25:32 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-01-14 18:43:58 +00:00
|
|
|
#ifndef DIVEPLOTDATAMODEL_H
|
|
|
|
#define DIVEPLOTDATAMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/display.h"
|
2019-08-05 18:43:06 +00:00
|
|
|
#include "core/deco.h"
|
|
|
|
#include "core/planner.h"
|
2014-02-04 19:34:16 +00:00
|
|
|
|
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,
|
|
|
|
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,
|
2018-03-14 15:13:37 +00:00
|
|
|
SCR_OC_PO2,
|
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);
|
2019-07-15 18:41:42 +00:00
|
|
|
~DivePlotDataModel();
|
2018-09-29 20:13:44 +00:00
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
2014-01-14 18:43:58 +00:00
|
|
|
void clear();
|
2021-01-11 15:17:34 +00:00
|
|
|
void setDive(const plot_info &pInfo);
|
2014-02-28 04:09:57 +00:00
|
|
|
const plot_info &data() const;
|
2014-03-18 18:26:29 +00:00
|
|
|
unsigned int dcShown() const;
|
2020-12-29 21:39:12 +00:00
|
|
|
double pheMax() const;
|
|
|
|
double pn2Max() const;
|
|
|
|
double po2Max() const;
|
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-03-18 18:26:29 +00:00
|
|
|
unsigned int dcNr;
|
2017-11-22 19:42:33 +00:00
|
|
|
struct deco_state plot_deco_state;
|
2014-01-14 18:43:58 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEPLOTDATAMODEL_H
|