2014-06-10 12:03:26 +00:00
|
|
|
#ifndef CONFIGUREDIVECOMPUTERTHREADS_H
|
|
|
|
#define CONFIGUREDIVECOMPUTERTHREADS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QThread>
|
|
|
|
#include <QVariant>
|
|
|
|
#include "libdivecomputer.h"
|
|
|
|
#include <QDateTime>
|
|
|
|
#include "devicedetails.h"
|
|
|
|
|
2014-12-29 04:56:58 +00:00
|
|
|
class ReadSettingsThread : public QThread {
|
2014-06-10 12:03:26 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-06-10 15:25:25 +00:00
|
|
|
ReadSettingsThread(QObject *parent, device_data_t *data);
|
2014-06-10 12:03:26 +00:00
|
|
|
virtual void run();
|
|
|
|
QString result;
|
|
|
|
QString lastError;
|
|
|
|
signals:
|
|
|
|
void error(QString err);
|
2014-06-10 15:25:25 +00:00
|
|
|
void devicedetails(DeviceDetails *newDeviceDetails);
|
2014-12-29 04:56:58 +00:00
|
|
|
|
2014-06-10 12:03:26 +00:00
|
|
|
private:
|
|
|
|
device_data_t *m_data;
|
|
|
|
};
|
|
|
|
|
2014-12-29 04:56:58 +00:00
|
|
|
class WriteSettingsThread : public QThread {
|
2014-06-10 12:03:26 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-06-10 15:25:25 +00:00
|
|
|
WriteSettingsThread(QObject *parent, device_data_t *data);
|
|
|
|
void setDeviceDetails(DeviceDetails *details);
|
2014-06-10 12:03:26 +00:00
|
|
|
virtual void run();
|
|
|
|
QString result;
|
|
|
|
QString lastError;
|
|
|
|
signals:
|
|
|
|
void error(QString err);
|
2014-12-29 04:56:58 +00:00
|
|
|
|
2014-06-10 12:03:26 +00:00
|
|
|
private:
|
2014-06-10 15:25:25 +00:00
|
|
|
device_data_t *m_data;
|
2014-06-10 12:03:26 +00:00
|
|
|
DeviceDetails *m_deviceDetails;
|
|
|
|
};
|
|
|
|
|
2014-12-29 04:56:58 +00:00
|
|
|
class FirmwareUpdateThread : public QThread {
|
2014-06-23 15:16:27 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
FirmwareUpdateThread(QObject *parent, device_data_t *data, QString fileName);
|
|
|
|
virtual void run();
|
|
|
|
QString lastError;
|
|
|
|
signals:
|
|
|
|
void progress(int percent);
|
|
|
|
void message(QString msg);
|
|
|
|
void error(QString err);
|
2014-12-29 04:56:58 +00:00
|
|
|
|
2014-06-23 15:16:27 +00:00
|
|
|
private:
|
|
|
|
device_data_t *m_data;
|
|
|
|
QString m_fileName;
|
|
|
|
};
|
|
|
|
|
2014-12-29 04:56:58 +00:00
|
|
|
class ResetSettingsThread : public QThread {
|
2014-10-17 22:33:47 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ResetSettingsThread(QObject *parent, device_data_t *data);
|
|
|
|
virtual void run();
|
|
|
|
QString lastError;
|
|
|
|
signals:
|
|
|
|
void progress(int percent);
|
|
|
|
void message(QString msg);
|
|
|
|
void error(QString err);
|
2014-12-29 04:56:58 +00:00
|
|
|
|
2014-10-17 22:33:47 +00:00
|
|
|
private:
|
|
|
|
device_data_t *m_data;
|
|
|
|
};
|
|
|
|
|
2014-06-10 12:03:26 +00:00
|
|
|
#endif // CONFIGUREDIVECOMPUTERTHREADS_H
|