Compare commits

..

No commits in common. "46c481b862b068a836723e5277f415966daea267" and "f741fb96f99fdfde3753653b32c520a266913402" have entirely different histories.

4 changed files with 7 additions and 39 deletions

View File

@ -70,14 +70,12 @@ 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 += \

View File

@ -24,8 +24,6 @@ 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();
@ -73,18 +71,23 @@ 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::NoFlowControl); m_serial->setFlowControl(QSerialPort::FlowControl::HardwareControl);
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);

View File

@ -1,13 +0,0 @@
#include "worker_thread.h"
WorkerThread::WorkerThread(QObject *parent)
: QThread(parent) {
}
WorkerThread::~WorkerThread() {
}
void WorkerThread::run() {
}

View File

@ -1,20 +0,0 @@
#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