代码拉取完成,页面将自动刷新
#ifndef THREAD_H
#define THREAD_H
#include <QThread>
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/opencv.hpp"
#include <QMutex>
#include <Python.h>
#include <arrayobject.h>
#include <QVector>
#include <modbus-tcp.h>
#include <modbus.h>
extern PyObject* pFun;
typedef struct
{
int pointA_x;
int pointA_y;
int pointB_x;
int pointB_y;
}bad_candy_box;
class PyThreadStateLock
{
public:
PyThreadStateLock(void)
{
state = PyGILState_Ensure( );
}
~PyThreadStateLock(void)
{
PyGILState_Release( state );
}
private:
PyGILState_STATE state;
};
class QThreadDeal: public QThread
{ Q_OBJECT
private:
QMutex stop_mutex;
bool m_stop;
protected:
void run();
public:
explicit QThreadDeal(QObject *parent = NULL);
void exitThread();
PyObject* call_python_file(npy_intp* diminfo,unsigned char* buff);
void deal_ret_from_python(PyObject* ret);
signals:
void send_image(cv::Mat);
void send_res(QVector<bad_candy_box>);
};
class QThreadModbus: public QThread
{ Q_OBJECT
private:
QMutex stop_mutex;
bool m_stop;
protected:
void run();
public:
explicit QThreadModbus(QObject *parent = NULL);
void exitThread();
signals:
void stop_all_thread();
};
class QThreadDebug: public QThread
{ Q_OBJECT
private:
QMutex stop_mutex;
bool m_stop;
bool correct_flag;
QMutex correct_mutex;
protected:
void run();
public:
explicit QThreadDebug(QObject *parent = NULL);
void exitThread();
public slots:
void get_correct_siganl();
signals:
void send_image_debug(cv::Mat);
};
class QThreadValveTest: public QThread
{ Q_OBJECT
private:
protected:
void run();
public:
explicit QThreadValveTest(QObject *parent = NULL);
void exitThread();
};
#endif // THREAD_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。