-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
74 lines (60 loc) · 1.75 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtCore>
#include <QMessageBox>
#include <QFile>
#include <QInputDialog>
#include <QFileDialog>
#include <QTextStream>
#include "qextserial/qextserialport.h"
#include "aboutdialog.h"
//延时,TIME_OUT是串口读写的延时
#define TIME_OUT 10
//连续发送定时器计时间隔,200ms
#define OBO_TIMER_INTERVAL 200
//载入文件时,如果文件大小超过TIP_FILE_SIZE字节则提示文件过大是否继续打开
#define TIP_FILE_SIZE 5000
//载入文件最大长度限制在MAX_FILE_SIZE字节内
#define MAX_FILE_SIZE 10000
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
void startInit();
protected:
void changeEvent(QEvent *e);
void setActionsEnabled(bool status);
void setComboBoxEnabled(bool status);
private:
Ui::MainWindow *ui;
AboutDialog aboutdlg;
QextSerialPort *myCom;
QTimer *obotimer;
unsigned int timerdly;
unsigned int obotimerdly;
QString write2fileName; //写读取的串口数据到该文件
private slots:
void on_actionWriteToFile_triggered();
void on_actionCleanPort_triggered();
void on_actionLoadfile_triggered();
void on_delayspinBox_valueChanged(int );
void on_actionAdd_triggered();
void on_actionExit_triggered();
void on_actionSave_triggered();
void on_obocheckBox_clicked();
void on_actionClearBytes_triggered();
void on_actionAbout_triggered();
void on_actionClose_triggered();
void on_actionOpen_triggered();
void on_clearUpBtn_clicked();
void on_sendmsgBtn_clicked();
void readMyCom();
void sendMsg();
//end by
};
#endif // MAINWINDOW_H