-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdatewindow.h
96 lines (66 loc) · 1.8 KB
/
updatewindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef UPDATEWINDOW_H
#define UPDATEWINDOW_H
#define UNCONNECT_MODE 0
#define HOSTLINK_MODE 1
//#define EDB_TEXT 2
#define EDB_BIN 3
#define UPDATE_SYSTEM 1
#define UPDATE_OSLOADER 2
#define MAX_PAGE 65536
#define HOSTLINK_VID 0x066F
#define HOSTLINK_PID 0x3770
#define REBOOT_INTERVAL 2000
#define REBOOT_EDB_INTERVAL 3000
#define REBOOT_RETRY_TIME 4
#define DEFAULT_OSLOADER_PAGE 1408
#define DEFAULT_SYSTEM_PAGE 1984
#define UPDATE_NONE 0
#define UPDATE_PROCESSING 1
#define UPDATE_NONE 0
#define UPDATE_PROCESSING 1
#define UPDATE_FLASHING_SYSTEM 2
#define UPDATE_FLASHING_OSLOADER 3
//EDB includes//
#include <stdint.h>
#include "edb/CComHelper.h"
#include "edb/WinReg.h"
#include <time.h>
#include "edb/EDBInterface.h"
////////////////
#include <libusb/libusb.h>
#include <sb_loader_DLL.h>
#include <QDialog>
#include <functional>
#include <time.h>
typedef std::function<void()> callBack;
extern unsigned long long speed, uploadedSize, pageNow, blockNow, fsize; //edb status
namespace Ui {
class updateWindow;
}
class updateWindow : public QDialog
{
Q_OBJECT
public:
explicit updateWindow(QWidget *parent = nullptr);
~updateWindow();
void addLine(const QString &text);
void clear();
void refresh();
void setProgressBarVisible(bool isVisible);
void setProgressBarValue(int n);
bool startUpdate(const QList<int>& work, const QString& OSLoader_path, const QString& System_path, const int& page_OSLoader, const int& page_System);
int searchDevices();
int searchForDevices();
void refreshStatus();
bool reboot();
signals:
void sendUpdateStatus(int status);
private:
Ui::updateWindow *ui;
//edb things//
vector<flashImg> imglist;
EDBInterface edb;
//////////////
int link_mode = UNCONNECT_MODE;
};
#endif // UPDATEWINDOW_H