87 lines
1.8 KiB
C++
87 lines
1.8 KiB
C++
#ifndef Hd_25DCameraVJ_module_H
|
|
#define Hd_25DCameraVJ_module_H
|
|
#include <QtCore/qglobal.h>
|
|
#include <Windows.h>
|
|
#include <time.h>
|
|
#include <QThread>
|
|
#include <QQueue>
|
|
#include <QMutex>
|
|
#include "base.h"
|
|
|
|
|
|
#include "KglDevice.h"
|
|
#include "KglStream.h"
|
|
#include "KglSystem.h"
|
|
#include "KglBuffer.h"
|
|
#include "KglDefine.h"
|
|
#include "KglResult.h"
|
|
#include "KglDeviceEventSink.h"
|
|
|
|
|
|
using namespace Keyence;
|
|
|
|
using namespace cv;
|
|
using namespace std;
|
|
//#pragma execution_character_set("utf-8")
|
|
|
|
class MyThread : public QThread
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit MyThread(QObject* parent = nullptr) :m_obj(parent) {}
|
|
void run();
|
|
void setFlag(bool flag) { m_flag = flag; }
|
|
private:
|
|
bool m_flag = true;
|
|
QObject* m_obj;
|
|
signals:
|
|
|
|
};
|
|
|
|
|
|
class Hd_25DCameraVJ_module :public Base
|
|
{
|
|
public:
|
|
Hd_25DCameraVJ_module();
|
|
virtual ~Hd_25DCameraVJ_module();
|
|
bool readData(std::vector<cv::Mat>&,QByteArray&);
|
|
bool writeData(std::vector<cv::Mat>&,QByteArray&);
|
|
bool initParas(QByteArray&);
|
|
bool run();
|
|
private:
|
|
std::string xmlPath = "";
|
|
MyThread* workThread = nullptr;
|
|
|
|
|
|
};
|
|
|
|
//事件要在VJ软件端开启功能
|
|
|
|
class LocalKglDeviceEventSink : public Keyence::KglDeviceEventSink
|
|
{
|
|
public:
|
|
|
|
LocalKglDeviceEventSink();
|
|
~LocalKglDeviceEventSink();
|
|
|
|
virtual void onLinkDisconnected(const KglDevice* pDevice);
|
|
virtual void onEventGenICam(const KglDevice* pDevice,
|
|
const uint16_t eventID,
|
|
const uint16_t channel,
|
|
const uint64_t blockID,
|
|
const uint64_t timestamp,
|
|
const uint32_t nodenum,
|
|
const KglGenParameter** pNode
|
|
);
|
|
|
|
};
|
|
|
|
extern "C"
|
|
{
|
|
Q_DECL_EXPORT Hd_25DCameraVJ_module * create();
|
|
Q_DECL_EXPORT void destory(Hd_25DCameraVJ_module * ptr);
|
|
}
|
|
|
|
#endif // Hd_25DCameraVJ_module_H
|
|
//Hd_25DCameraVJ_module
|