2017-04-18 17:14:03 +00:00
|
|
|
#ifndef DOWNLOADFROMDCTHREAD_H
|
|
|
|
#define DOWNLOADFROMDCTHREAD_H
|
|
|
|
|
|
|
|
#include <QThread>
|
2017-04-27 18:24:14 +00:00
|
|
|
#include <QMap>
|
|
|
|
#include <QHash>
|
|
|
|
|
2017-04-18 17:14:03 +00:00
|
|
|
#include "dive.h"
|
|
|
|
#include "libdivecomputer.h"
|
|
|
|
|
|
|
|
class DownloadThread : public QThread {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DownloadThread(QObject *parent, device_data_t *data);
|
|
|
|
void setDiveTable(struct dive_table *table);
|
|
|
|
void run() override;
|
|
|
|
|
|
|
|
QString error;
|
|
|
|
|
|
|
|
private:
|
|
|
|
device_data_t *data;
|
|
|
|
};
|
|
|
|
|
2017-04-27 18:24:14 +00:00
|
|
|
struct product {
|
|
|
|
const char *product;
|
|
|
|
dc_descriptor_t *descriptor;
|
|
|
|
struct product *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vendor {
|
|
|
|
const char *vendor;
|
|
|
|
struct product *productlist;
|
|
|
|
struct vendor *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mydescriptor {
|
|
|
|
const char *vendor;
|
|
|
|
const char *product;
|
|
|
|
dc_family_t type;
|
|
|
|
unsigned int model;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* This fills the vendor list QStringList and related members.
|
|
|
|
* this code needs to be reworked to be less ugly, but it will
|
|
|
|
* stay like this for now.
|
|
|
|
*/
|
|
|
|
void fill_computer_list();
|
|
|
|
extern QStringList vendorList;
|
|
|
|
extern QHash<QString, QStringList> productList;
|
|
|
|
extern QMap<QString, dc_descriptor_t *> descriptorLookup;
|
|
|
|
|
2017-04-18 17:14:03 +00:00
|
|
|
#endif
|