阶段备份
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
#ifndef Hd_CameraModule_Basler_LineSweep_H
|
||||
#define Hd_CameraModule_Basler_LineSweep_H
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <Windows.h>
|
||||
#include <QDebug>
|
||||
#include <QQueue>
|
||||
#include <QMutex>
|
||||
#include <pylon/PylonIncludes.h>
|
||||
//#include <pylon/InstantCamera.h>
|
||||
//#include <pylon/InstantInterface.h>
|
||||
//#include <pylon/gige/BaslerGigECamera.h>
|
||||
#include <pylon/BaslerUniversalInstantCamera.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
|
||||
#include <subModuleBase.h>
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
using namespace Pylon;
|
||||
using namespace Basler_UniversalCameraParams;
|
||||
|
||||
#pragma execution_character_set("utf-8")
|
||||
|
||||
static QByteArray mv_Status = "connected";//0106 新增相机断联报警
|
||||
//static void* handle;
|
||||
static string Username="";
|
||||
static bool m_flag = false;
|
||||
static cv::Mat srcImage;
|
||||
static bool moduleStatus = true;
|
||||
static int index=-1;
|
||||
class Hd_CameraModule_Basler_soft :public subModuleBase
|
||||
, public Pylon::CImageEventHandler // Allows you to get notified about images received and grab errors.
|
||||
, public Pylon::CConfigurationEventHandler // Allows you to get notified about device removal.
|
||||
, public Pylon::CCameraEventHandler
|
||||
//, public CInstantInterface
|
||||
{
|
||||
public:
|
||||
Hd_CameraModule_Basler_soft();
|
||||
virtual ~Hd_CameraModule_Basler_soft();
|
||||
//从类中读数据到实例对象
|
||||
bool readData(std::vector<cv::Mat>& mat, QByteArray& data, nlohmann::json& json);
|
||||
//实例对象把数据写入到类
|
||||
bool writeData(std::vector<cv::Mat>& mat, QByteArray& data, nlohmann::json& json);
|
||||
bool initParas(QByteArray&, nlohmann::json& json = nlohmann::json());
|
||||
bool run();
|
||||
bool checkStatus();
|
||||
|
||||
int SearchDevice();
|
||||
|
||||
//关闭设备
|
||||
void CloseDevice();
|
||||
//连接设备
|
||||
bool ConnctDevice();
|
||||
//重连设备
|
||||
bool reConnctDevice();
|
||||
//回调函数?
|
||||
virtual void OnImageGrabbed(Pylon::CInstantCamera& camera, const Pylon::CGrabResultPtr& grabResult);
|
||||
//断线回调
|
||||
void OnCameraDeviceRemoved(Pylon::CInstantCamera& camera);
|
||||
//错误
|
||||
void OnGrabError(Pylon::CInstantCamera& camera, const char* errorMessage);
|
||||
private:
|
||||
//MyThread *m_thread = nullptr;
|
||||
QMutex* m_mutex;
|
||||
|
||||
Pylon::CBaslerUniversalInstantCamera *m_camera;
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
Q_DECL_EXPORT Hd_CameraModule_Basler_soft* create();
|
||||
Q_DECL_EXPORT void destory(Hd_CameraModule_Basler_soft* ptr);
|
||||
}
|
||||
|
||||
#endif // Hd_CameraModule_Basler_LineSweep_H
|
||||
//Hd_CameraModule_Basler_soft
|
||||
Reference in New Issue
Block a user