-
Notifications
You must be signed in to change notification settings - Fork 0
/
serialseq.h
53 lines (44 loc) · 1.32 KB
/
serialseq.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
#ifndef SERIALSEQ_H
#define SERIALSEQ_H
#include <QList>
#include <QString>
#include <QThread>
#include <QTextBrowser>
#include "sequencesender.h"
#include <QPushButton>
#include <QLabel>
#define MAX_SERIAL_SEQ_COUNT 10
#define MAX_SENDABLE_DATA_LEN 255
enum serialDataType
{
SERIAL_SEQ_TYPE_ASCII = 0,
SERIAL_SEQ_TYPE_HEX = 1,
SERIAL_SEQ_TYPE_BIN,
};
struct serialSequenceElem
{
int seqId; // sequence id
char data[MAX_SENDABLE_DATA_LEN];
int dataLen;
QString textData; // String version of data to print
QString seqName;
int period = 0;
int status;
int type; // Hex, Ascii, Binary
int sendCount;
sequenceSender *sender;
QPushButton *button;
QLabel *labelData, *labelName, *labelPeriod;
};
class serialSeq
{
public:
serialSeq();
void editSeq(struct serialSequenceElem *elem, int period, int sendCount, const QString &seqName, const char *seqData, int dataLen, const QString &textDat);
void addSeqToList(int id, int period, int sendCount, const QString &seqName, const char *seqData, int dataLen, const QString &textDat, QPushButton *button, int type, QLabel *lName, QLabel *lData, QLabel *lPeriod);
struct serialSequenceElem* findSerialSeq(int seqId);
void stopAllSequences();
private:
QList<struct serialSequenceElem> serialSeqList;
};
#endif // SERIALSEQ_H