-
Notifications
You must be signed in to change notification settings - Fork 8
/
ftdimanager.h
96 lines (56 loc) · 1.82 KB
/
ftdimanager.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 FTDIMANAGER_H
#define FTDIMANAGER_H
#include <QObject>
#include <QAndroidJniObject>
#include <QtCore>
#include <QDateTime>
#include <QAndroidJniEnvironment>
#include <QTimer>
#include "qmlitemmodel.h"
#include "customproxy4qmlmodel.h"
class FtdiManager : public QObject
{
Q_OBJECT
public:
explicit FtdiManager(QObject *parent = 0);
QmlItemModel *deviceModel;
QmlItemModel *historyModel;
CustomProxy4QmlModel *proxy_historyModel;
signals:
void addLineToLog(QString);
void startReadTmr();
void stopReadTmr();
void onFtdiStateChanged(bool);
void onConnectPageSettt(int, int,int ,int,int);
void onTerminalPageSettt(int,bool);
void onSettPage(qreal);
void setCurrntPortIndx(int);
void sendLineHexIsValid(bool);
public slots:
void startJar();
void onBtnPrssd();
void createDeviceInfoList(bool onlyUpdate = false);
void deviceStatus();
void connectToOnePort();
void connectToOnePort(int indx , int baudIndx, int dataIndx, int stopIndx, int parityIndx, int flowIndx);
void disconnectFromPort();
void sendDataToPort(QString line, bool hexOut, int endLineIndx);
void setThisHistoryFilter(const QString &str);
void delThisHistoryIndx(const int &indx);
void saveQmlSett(const int &intVal, const int &key);
void saveQmlSett(const bool &boolVal, const int &key);
void saveQmlSettRealVal(const qreal &realVal, const int &key);
void sendLineHexValidator(QString line);
private slots:
void onReadTmr();
private:
bool readData();
QList<QVariant> loadSettings(int key);
void saveSettings(QList<QVariant> list, int key);
int bufLen;
QAndroidJniObject qtFtDev2xxManager;
QAndroidJniObject adnrActivity;
QAndroidJniObject ftD2xx;
QStringList listHistoryCommand;
};
#endif // FTDIMANAGER_H