2013-06-17 22:58:26 +00:00
|
|
|
#ifndef QTHELPER_H
|
|
|
|
#define QTHELPER_H
|
|
|
|
|
|
|
|
#include <QMultiMap>
|
|
|
|
#include <QString>
|
|
|
|
#include <stdint.h>
|
2013-10-04 18:39:33 +00:00
|
|
|
#include "dive.h"
|
2013-11-26 17:44:18 +00:00
|
|
|
#include "divelist.h"
|
2013-10-09 05:25:02 +00:00
|
|
|
#include <QTranslator>
|
|
|
|
|
|
|
|
// global pointers for our translation
|
|
|
|
extern QTranslator *qtTranslator, *ssrfTranslator;
|
2013-06-17 22:58:26 +00:00
|
|
|
|
|
|
|
class DiveComputerNode {
|
|
|
|
public:
|
|
|
|
DiveComputerNode(QString m, uint32_t d, QString s, QString f, QString n) : model(m), deviceId(d), serialNumber(s), firmware(f), nickName(n) {};
|
|
|
|
bool operator ==(const DiveComputerNode &a) const;
|
|
|
|
bool operator !=(const DiveComputerNode &a) const;
|
|
|
|
bool changesValues(const DiveComputerNode &b) const;
|
|
|
|
QString model;
|
|
|
|
uint32_t deviceId;
|
|
|
|
QString serialNumber;
|
|
|
|
QString firmware;
|
|
|
|
QString nickName;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DiveComputerList {
|
|
|
|
public:
|
|
|
|
DiveComputerList();
|
|
|
|
~DiveComputerList();
|
|
|
|
const DiveComputerNode *getExact(QString m, uint32_t d);
|
|
|
|
const DiveComputerNode *get(QString m);
|
|
|
|
void addDC(QString m, uint32_t d, QString n = "", QString s = "", QString f = "");
|
|
|
|
void rmDC(QString m, uint32_t d);
|
|
|
|
DiveComputerNode matchDC(QString m, uint32_t d);
|
|
|
|
DiveComputerNode matchModel(QString m);
|
2013-10-06 11:43:45 +00:00
|
|
|
QMultiMap<QString, class DiveComputerNode> dcMap;
|
|
|
|
QMultiMap<QString, class DiveComputerNode> dcWorkingMap;
|
2013-06-17 22:58:26 +00:00
|
|
|
};
|
|
|
|
|
2013-10-04 18:39:33 +00:00
|
|
|
QString weight_string(int weight_in_grams);
|
2013-10-05 16:48:26 +00:00
|
|
|
bool gpsHasChanged(struct dive* dive, struct dive *master, const QString &gps_text);
|
2013-10-04 18:39:33 +00:00
|
|
|
|
2013-11-26 17:44:18 +00:00
|
|
|
QList<int> getDivesInTrip(dive_trip_t *trip);
|
2013-06-17 22:58:26 +00:00
|
|
|
#endif // QTHELPER_H
|