92 lines
2.1 KiB
C++
92 lines
2.1 KiB
C++
#ifndef HD_3DCAMERALMI_MODULE_H
|
|
#define HD_3DCAMERALMI_MODULE_H
|
|
#include <subModuleBase.h>
|
|
#include <QtCore/qglobal.h>
|
|
#include <QThread>
|
|
#include <QQueue>
|
|
#include <QMutex>
|
|
#include <GoSdk.h>
|
|
#include <QByteArray>
|
|
#pragma comment(lib, "winmm.lib")
|
|
#pragma comment(lib,"GoSdk.lib")
|
|
#pragma comment(lib,"kApi.lib")
|
|
|
|
using namespace std;
|
|
using namespace cv;
|
|
|
|
#pragma region LMI
|
|
|
|
static QByteArray mv_Status = "connected";//0106 新增相机断联报警
|
|
static long long picIndex = 0;
|
|
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;
|
|
};
|
|
|
|
|
|
static std::vector<GoDataMsg>DataSetCollection;
|
|
static std::mutex DataSetMutex;
|
|
|
|
|
|
static k32u id = 117599; //3D 序列号
|
|
static kAssembly api = kNULL;
|
|
static GoSystem system1 = kNULL;
|
|
static GoSensor sensor = kNULL;
|
|
static GoDataSet dataset = kNULL;
|
|
static DataContext* contextPointer = new DataContext();
|
|
static LmiStatus m_status = UnInit;
|
|
static bool m_lmiheightFlag = false;
|
|
static bool m_lmiluminanceFlag = false;
|
|
|
|
#pragma endregion
|
|
|
|
|
|
class Hd_3DCameraLMI_module:public dsModuleBase
|
|
{
|
|
public:
|
|
Hd_3DCameraLMI_module();
|
|
virtual ~Hd_3DCameraLMI_module();
|
|
bool readData(std::vector<cv::Mat>&, QByteArray&);
|
|
bool writeData(std::vector<cv::Mat>&, QByteArray&);
|
|
bool initParas(QByteArray&);
|
|
bool run();
|
|
};
|
|
|
|
extern "C"
|
|
{
|
|
Q_DECL_EXPORT Hd_3DCameraLMI_module * create();
|
|
Q_DECL_EXPORT void destory(Hd_3DCameraLMI_module * ptr);
|
|
}
|
|
|
|
|
|
#endif // HD_3DCAMERALMI_MODULE_H
|