63 lines
1.1 KiB
C++
Executable File
63 lines
1.1 KiB
C++
Executable File
//
|
|
// Created by zong on 5/18/22.
|
|
//
|
|
|
|
#ifndef UNTITLED_MAIN_WINDOW_H
|
|
#define UNTITLED_MAIN_WINDOW_H
|
|
|
|
#include "ui_main.h"
|
|
#include <QSerialPort>
|
|
#include <QThread>
|
|
|
|
class main_window : public QMainWindow {
|
|
Q_OBJECT
|
|
public:
|
|
explicit main_window(QWidget *parent = nullptr);
|
|
|
|
~main_window() override;
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
bool is_open = false;
|
|
QSerialPort port;
|
|
|
|
QWidget *centralwidget;
|
|
QHBoxLayout *horizontalLayout;
|
|
QSplitter *splitter;
|
|
QWidget *layoutWidget;
|
|
QGridLayout *gridLayout;
|
|
QComboBox *stopbitsComboBox;
|
|
QComboBox *dataBitsComboBox;
|
|
QPushButton *portUpdBtn;
|
|
QLabel *label_4;
|
|
QComboBox *portsComboBox;
|
|
QLineEdit *tmpFilenameEdit;
|
|
QLabel *label;
|
|
QLabel *label_2;
|
|
QPushButton *portOpenBtn;
|
|
QLabel *label_3;
|
|
QLineEdit *baudLineEdit;
|
|
QSpacerItem *verticalSpacer;
|
|
QTextEdit *hexTextEdit;
|
|
QTextEdit *asciiTextEdit;
|
|
QMenuBar *menubar;
|
|
QStatusBar *statusbar;
|
|
|
|
private:
|
|
void setUiComponent();
|
|
|
|
public slots:
|
|
|
|
void update_ui_port();
|
|
|
|
void open_port();
|
|
|
|
void read_data();
|
|
|
|
void update_chart();
|
|
|
|
};
|
|
|
|
|
|
#endif //UNTITLED_MAIN_WINDOW_H
|