init files
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
#ifndef HD_3DCAMERALMI_MODULE_H
|
||||
#define HD_3DCAMERALMI_MODULE_H
|
||||
#include"base.h"
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QThread>
|
||||
#include <QQueue>
|
||||
#include <QMutex>
|
||||
#include <GoSdk.h>
|
||||
#include <QByteArray>
|
||||
#include <windows.h>
|
||||
#include "pbglobalobject.h"
|
||||
#include "QQueue.h"
|
||||
#include "QMap.h"
|
||||
#include "QDir.h"
|
||||
#include "qapplication.h"
|
||||
#include "qjsonobject.h"
|
||||
#include "qjsonarray.h"
|
||||
#include "qjsondocument.h"
|
||||
#include "QLibrary.h"
|
||||
#pragma comment(lib, "winmm.lib")
|
||||
#pragma comment(lib,"GoSdk.lib")
|
||||
#pragma comment(lib,"kApi.lib")
|
||||
|
||||
using namespace cv;
|
||||
|
||||
#pragma region LMI
|
||||
|
||||
enum LmiStatus
|
||||
{
|
||||
UnInit = 0,
|
||||
OK = 1,
|
||||
Grab = 2,
|
||||
};
|
||||
|
||||
#define NM_TO_MM(VALUE) (((k64f)(VALUE))/1000000.0)
|
||||
#define UM_TO_MM(VALUE) (((k64f)(VALUE))/1000.0)
|
||||
|
||||
#define INVALID_RANGE_16BIT ((signed short)0x8000) // gocator transmits range data as 16-bit signed integers. 0x8000 signifies invalid range data.
|
||||
#define DOUBLE_MAX ((k64f)1.7976931348623157e+308) // 64-bit double - largest positive value.
|
||||
#define INVALID_RANGE_DOUBLE ((k64f)-DOUBLE_MAX) // floating point value to represent invalid range data.
|
||||
|
||||
|
||||
struct MyTiff
|
||||
{
|
||||
unsigned short* Tiff;
|
||||
int w;
|
||||
int h;
|
||||
};
|
||||
|
||||
struct MyBmp
|
||||
{
|
||||
unsigned char* Bmp;
|
||||
int w;
|
||||
int h;
|
||||
};
|
||||
|
||||
struct DataContext
|
||||
{
|
||||
k32u count;
|
||||
};
|
||||
|
||||
|
||||
#pragma endregion
|
||||
|
||||
class Hd_CameraModule_3DLMI3 :public PbGlobalObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Hd_CameraModule_3DLMI3(int settype = -1, QObject* parent = nullptr);//对应哪个品牌相机(触发方式)/通信
|
||||
~Hd_CameraModule_3DLMI3();
|
||||
//#######################通用函数#######################
|
||||
//初始化参数;通信/相机的初始化参数
|
||||
bool setParameter(const QMap<QString, QString>&);
|
||||
|
||||
//setParameter之后再调用,返回当前参数
|
||||
//相机:获取默认参数;
|
||||
//通信:获取初始化示例参数
|
||||
QMap<QString, QString> parameters();
|
||||
//初始化(加载模块到内存)
|
||||
bool init();
|
||||
|
||||
//设置数据
|
||||
//相机:第一张图的参数,QStringList:00 曝光值 增益值;
|
||||
//相机:第N张图的参数,QStringList:非00 曝光值 增益值;
|
||||
//完成后发送信号trigged(bool);
|
||||
bool setData(const std::vector<cv::Mat>&, const QStringList&);
|
||||
//获取数据
|
||||
bool data(std::vector<cv::Mat>&, QStringList&);
|
||||
//注册回调 string对应自身的参数协议 (自定义)
|
||||
virtual void registerCallBackFun(PBGLOBAL_CALLBACK_FUN, QObject*, const QString&);
|
||||
|
||||
//从类中读数据到实例对象
|
||||
bool Hd_CameraModule_3DLMI3::readData(std::vector<cv::Mat>& vecPic, QByteArray& data);
|
||||
//实例对象把数据写入到类
|
||||
bool writeData(std::vector<cv::Mat>&,QByteArray& qbyte);
|
||||
bool initParas(QByteArray&);
|
||||
bool run();
|
||||
bool checkStatus();
|
||||
QJsonObject load_camera_Example();
|
||||
private:
|
||||
bool ifFirst = true;
|
||||
//参数设置的数据
|
||||
QMap<QString, QString> ParasValueMap;
|
||||
QString getmoduleName();
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
Q_DECL_EXPORT Hd_CameraModule_3DLMI3* create(int type = -1);
|
||||
Q_DECL_EXPORT void destory(Hd_CameraModule_3DLMI3* ptr);
|
||||
}
|
||||
|
||||
|
||||
#endif // HD_3DCAMERALMI_MODULE_H
|
||||
Reference in New Issue
Block a user