You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cigarette/Cigarette/Thread/threadReceive.h

46 lines
809 B
C++

#pragma once
#include <QThread>
#include <QDebug>
#include <QDateTime>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/types_c.h>
#include <atomic>
#include <mutex>
#include "common.h"
#include "SyncQueue.h"
#include <QUdpSocket>
class threadReceive : public QThread
{
Q_OBJECT
public:
QString ip;
threadReceive(QObject* o = nullptr) :QThread(o)
{
isLoop = true;
}
~threadReceive()
{
stop();
quit();
wait();
}
void stop();
void init(std::string IP, int port);
void start_work();
private slots:
void processPendingDatagram();
void fileprocessPendingDatagram();
signals:
void sendMsgToCigratte(QString data);
public:
std::atomic_bool isLoop = { 0 };
QUdpSocket mSocket;
QUdpSocket filemSocket;
};