Compare commits
3 Commits
f741fb96f9
...
46c481b862
Author | SHA1 | Date | |
---|---|---|---|
46c481b862 | |||
8945ead5d6 | |||
bc064c38c6 |
@ -70,12 +70,14 @@ SOURCES += \
|
|||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
sender_thread.cpp \
|
sender_thread.cpp \
|
||||||
receiver_thread.cpp \
|
receiver_thread.cpp \
|
||||||
|
worker_thread.cpp \
|
||||||
../common/src/message_handler.cpp
|
../common/src/message_handler.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
sender_thread.h \
|
sender_thread.h \
|
||||||
receiver_thread.h \
|
receiver_thread.h \
|
||||||
|
worker_thread.h \
|
||||||
../common/include/message_handler.h
|
../common/include/message_handler.h
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
|
@ -24,6 +24,8 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
openSerialPort();
|
||||||
|
|
||||||
//ui->updateProgress->setRange(0, 100);
|
//ui->updateProgress->setRange(0, 100);
|
||||||
//ui->updateProgress->reset();
|
//ui->updateProgress->reset();
|
||||||
|
|
||||||
@ -71,23 +73,18 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
//delete m_startTimer;
|
//delete m_startTimer;
|
||||||
//delete m_exitTimer;
|
//delete m_exitTimer;
|
||||||
|
closeSerialPort();
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::openSerialPort() {
|
bool MainWindow::openSerialPort() {
|
||||||
// const SettingsDialog::Settings p = m_settings->settings();
|
// const SettingsDialog::Settings p = m_settings->settings();
|
||||||
//m_serial->setPortName(p.name);
|
|
||||||
//m_serial->setBaudRate(p.baudRate);
|
|
||||||
//m_serial->setDataBits(p.dataBits);
|
|
||||||
//m_serial->setParity(p.parity);
|
|
||||||
//m_serial->setStopBits(p.stopBits);
|
|
||||||
///m_serial->setFlowControl(p.flowControl);
|
|
||||||
m_serial->setPortName("");
|
m_serial->setPortName("");
|
||||||
m_serial->setBaudRate(QSerialPort::Baud115200);
|
m_serial->setBaudRate(QSerialPort::Baud115200);
|
||||||
m_serial->setDataBits(QSerialPort::DataBits::Data8);
|
m_serial->setDataBits(QSerialPort::DataBits::Data8);
|
||||||
m_serial->setParity(QSerialPort::Parity::NoParity);
|
m_serial->setParity(QSerialPort::Parity::NoParity);
|
||||||
m_serial->setStopBits(QSerialPort::StopBits::OneStop);
|
m_serial->setStopBits(QSerialPort::StopBits::OneStop);
|
||||||
m_serial->setFlowControl(QSerialPort::FlowControl::HardwareControl);
|
m_serial->setFlowControl(QSerialPort::FlowControl::NoFlowControl);
|
||||||
if (m_serial->open(QIODevice::ReadWrite)) {
|
if (m_serial->open(QIODevice::ReadWrite)) {
|
||||||
//m_console->setEnabled(true);
|
//m_console->setEnabled(true);
|
||||||
//m_console->setLocalEchoEnabled(p.localEchoEnabled);
|
//m_console->setLocalEchoEnabled(p.localEchoEnabled);
|
||||||
|
13
DownloadDCFirmware/worker_thread.cpp
Normal file
13
DownloadDCFirmware/worker_thread.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include "worker_thread.h"
|
||||||
|
|
||||||
|
WorkerThread::WorkerThread(QObject *parent)
|
||||||
|
: QThread(parent) {
|
||||||
|
}
|
||||||
|
|
||||||
|
WorkerThread::~WorkerThread() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkerThread::run() {
|
||||||
|
|
||||||
|
}
|
20
DownloadDCFirmware/worker_thread.h
Normal file
20
DownloadDCFirmware/worker_thread.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef WORKER_THREAD_H_INCLUDED
|
||||||
|
#define WORKER_THREAD_H_INCLUDED
|
||||||
|
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
|
class WorkerThread : public QThread {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit WorkerThread(QObject *parent = nullptr);
|
||||||
|
~WorkerThread();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
void run() override;
|
||||||
|
|
||||||
|
bool m_quit = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // WORKER_THREAD_H_INCLUDED
|
Loading…
x
Reference in New Issue
Block a user