2017-04-27 18:24:53 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-05-12 16:53:26 +00:00
|
|
|
#ifndef DIVECOMPUTER_H
|
|
|
|
#define DIVECOMPUTER_H
|
|
|
|
|
|
|
|
#include <QString>
|
2018-06-16 12:06:35 +00:00
|
|
|
#include <QVector>
|
2014-05-12 16:53:26 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
class DiveComputerNode {
|
|
|
|
public:
|
|
|
|
bool operator==(const DiveComputerNode &a) const;
|
|
|
|
bool operator!=(const DiveComputerNode &a) const;
|
2018-06-16 12:06:35 +00:00
|
|
|
bool operator<(const DiveComputerNode &a) const;
|
2014-05-12 16:53:26 +00:00
|
|
|
bool changesValues(const DiveComputerNode &b) const;
|
2015-09-17 21:38:20 +00:00
|
|
|
void showchanges(const QString &n, const QString &s, const QString &f) const;
|
2014-05-12 16:53:26 +00:00
|
|
|
QString model;
|
|
|
|
uint32_t deviceId;
|
|
|
|
QString serialNumber;
|
|
|
|
QString firmware;
|
|
|
|
QString nickName;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DiveComputerList {
|
|
|
|
public:
|
2014-05-22 18:40:22 +00:00
|
|
|
const DiveComputerNode *getExact(const QString &m, uint32_t d);
|
|
|
|
const DiveComputerNode *get(const QString &m);
|
2015-09-17 21:38:20 +00:00
|
|
|
void addDC(QString m, uint32_t d, QString n = QString(), QString s = QString(), QString f = QString());
|
2014-05-22 18:40:22 +00:00
|
|
|
DiveComputerNode matchDC(const QString &m, uint32_t d);
|
|
|
|
DiveComputerNode matchModel(const QString &m);
|
2018-06-16 12:06:35 +00:00
|
|
|
|
|
|
|
// Keep the dive computers in a vector sorted by (model, deviceId)
|
|
|
|
QVector<DiveComputerNode> dcs;
|
2014-05-12 16:53:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern DiveComputerList dcList;
|
|
|
|
|
2015-01-29 22:00:19 +00:00
|
|
|
#endif
|