removed canconnectioncontainer

This commit is contained in:
canpadawan
2016-06-15 18:29:04 +02:00
parent 45752d137a
commit ec57d30fd1
2 changed files with 0 additions and 54 deletions
-32
View File
@@ -1,32 +0,0 @@
#include "canconnection.h"
#include "canconnectioncontainer.h"
#include "mainwindow.h"
CANConnectionContainer::CANConnectionContainer(CANConnection *conn)
{
thread = new QThread();
connection = conn;
connection->moveToThread(thread);
connect(thread, &QThread::started, conn, &CANConnection::run); //setup timers within the proper thread
connect(conn, &CANConnection::frameUpdateRapid, MainWindow::getReference(), &MainWindow::gotFrames, Qt::QueuedConnection);
connect(MainWindow::getReference(), &MainWindow::sendCANFrame, conn, &CANConnection::sendFrame, Qt::QueuedConnection);
thread->start();
thread->setPriority(QThread::HighPriority);
}
CANConnectionContainer::~CANConnectionContainer()
{
//have to stop the actual execution first before deleting
thread->quit();
if(!thread->wait()) {
qDebug() << "can't stop thread";
}
delete thread;
delete connection;
}
CANConnection* CANConnectionContainer::getRef()
{
return connection;
}
-22
View File
@@ -1,22 +0,0 @@
#ifndef CANCONNECTIONCONTAINER_H
#define CANCONNECTIONCONTAINER_H
#include <Qt>
#include <QThread>
#include "canconnection.h"
class CANConnectionContainer : public QObject
{
Q_OBJECT
public:
CANConnectionContainer(CANConnection *conn);
~CANConnectionContainer();
CANConnection* getRef();
private:
CANConnection *connection;
QThread *thread;
};
#endif // CANCONNECTIONCONTAINER_H