V20260829-2.6.1
完成框架目录和模块重构;新增核心、单例、工具、加密及框架 SDK;统一任务、相机和 RPC 接口,并增加离线检测、相机标定、备份恢复、版本管理、崩溃守护和心跳监控功能。
This commit is contained in:
@@ -5,10 +5,10 @@ message( " model start : " ${CURRENT_FOLDER}:${RUN_TIME})
|
||||
|
||||
set(DLL_NAMES "keyence3D" "opencv")
|
||||
foreach(child ${DLL_NAMES})
|
||||
|
||||
|
||||
LIST(APPEND ENV_INCLUDE ${${child}_include})
|
||||
LIST(APPEND ENV_LIB ${${child}_lib})
|
||||
LIST(APPEND ENV_TARGET ${${child}_target_link})
|
||||
LIST(APPEND ENV_TARGET ${${child}_target_link})
|
||||
endforeach()
|
||||
message(" ENV_INCLUDE : " ${ENV_INCLUDE} )
|
||||
message(" ENV_LIB : " ${ENV_LIB} )
|
||||
@@ -25,7 +25,7 @@ link_directories (
|
||||
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
@@ -49,7 +49,7 @@ add_library(${CURRENT_FOLDER} SHARED
|
||||
|
||||
|
||||
|
||||
set_target_properties(${CURRENT_FOLDER} PROPERTIES LINKER_LANGUAGE C
|
||||
set_target_properties(${CURRENT_FOLDER} PROPERTIES LINKER_LANGUAGE CXX
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Hd_CameraModule_3DKeyence.h"
|
||||
#include "Hd_CameraModule_3DKeyence.h"
|
||||
#include <exception>
|
||||
#include <qthread.h>
|
||||
#include <QTextCodec>
|
||||
@@ -59,18 +59,18 @@ void myCallbackFunc(LJX8IF_PROFILE_HEADER* pProfileHeaderArray, WORD* pHeightPro
|
||||
return;
|
||||
}*/
|
||||
QMutexLocker lock(bufferMutex);
|
||||
if (dwCount == 0)
|
||||
if (dwCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_imageAvailable[dwUser] == 1)
|
||||
if (_imageAvailable[dwUser] == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// _heightBuf 代表的含义:程序里的高度缓存区,pHeightProfileArray 回调函数里的数据
|
||||
|
||||
// _heightBuf 代表的含义:程序里的高度缓存区,pHeightProfileArray 回调函数里的数据
|
||||
// 此处崩溃的可能性:xImageSize 配置文件中设置的值和3D相机调试软件设置的值不一致,会崩溃。
|
||||
if (JumpFlag)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ void myCallbackFunc(LJX8IF_PROFILE_HEADER* pProfileHeaderArray, WORD* pHeightPro
|
||||
_heightBuf[dwUser] = (unsigned short*)malloc(yCounts * MAX_LJXA_XDATANUM * 2);
|
||||
memcpy(&_heightBuf[dwUser][0], pHeightProfileArray, dwProfileDataCount * dwCount * 2);
|
||||
qDebug() << __FUNCTION__ << " line:" << __LINE__ << " Second memcpy _heightBuf success ";
|
||||
|
||||
|
||||
}
|
||||
|
||||
qDebug() << __FUNCTION__ << " line:" << __LINE__ << "_luminanceBuf[dwUser]: " << _luminanceBuf[dwUser];
|
||||
@@ -132,7 +132,7 @@ void myCallbackFunc(LJX8IF_PROFILE_HEADER* pProfileHeaderArray, WORD* pHeightPro
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << "Get luminanceBuf failed!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
_imageAvailable[dwUser] = 1; // 图像获取成功 dwUser 和 deviceId 一致
|
||||
_lastImageSizeHeight[dwUser] = dwCount; // 扫描的行数, dwCount 和 yImageSize 一致
|
||||
@@ -283,7 +283,7 @@ bool Hd_CameraModule_3DKeyence::readData(std::vector<cv::Mat> &mats,QByteArray &
|
||||
QMutexLocker locker(m_mutex);
|
||||
if (luminanceMatS.empty() || heightMatS.empty())
|
||||
{
|
||||
qDebug() << " [Error] " << " srcImage is null";
|
||||
qDebug() << " srcImage is null";
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < imgTarget; i++) {
|
||||
@@ -297,13 +297,13 @@ bool Hd_CameraModule_3DKeyence::readData(std::vector<cv::Mat> &mats,QByteArray &
|
||||
}
|
||||
}
|
||||
imgTakeNum = 0;
|
||||
qCritical() << " [info] " << __FUNCTION__ << " line:" << __LINE__ << " checkImg readData,deviceId" << deviceId << " imgIndex" << imgIndex;
|
||||
qCritical() << __FUNCTION__ << " line:" << __LINE__ << " checkImg readData,deviceId" << deviceId << " imgIndex" << imgIndex;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Hd_CameraModule_3DKeyence::writeData(std::vector<cv::Mat> &mat,QByteArray &data)
|
||||
{
|
||||
if (data == "clearCahce") {
|
||||
if (data == "clearCache") {
|
||||
QMutexLocker locker(m_mutex);
|
||||
heightMatS.clear();
|
||||
luminanceMatS.clear();
|
||||
@@ -337,7 +337,7 @@ bool Hd_CameraModule_3DKeyence::writeData(std::vector<cv::Mat> &mat,QByteArray &
|
||||
// //getImageNum = 0;
|
||||
// return true;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ bool Hd_CameraModule_3DKeyence::initParas(QByteArray& initData)
|
||||
{
|
||||
QByteArrayList valueList = initData.split('#');
|
||||
if (valueList.size() < 6) {
|
||||
qDebug() << "[Error] " << " Hd_CameraModule_HIK initParas fail--params error!参数数量不满足";
|
||||
qDebug() << " Hd_CameraModule_HIK initParas fail--params error!参数数量不满足";
|
||||
lastError = "参数数量不满足";
|
||||
return false;
|
||||
}
|
||||
@@ -474,14 +474,14 @@ bool Hd_CameraModule_3DKeyence::InitHighSpeed()
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Hd_CameraModule_3DKeyence::run()
|
||||
{
|
||||
|
||||
|
||||
ifRunning = true;
|
||||
ifBreak = false;
|
||||
if ( !isopen )
|
||||
@@ -492,7 +492,7 @@ bool Hd_CameraModule_3DKeyence::run()
|
||||
|
||||
try
|
||||
{
|
||||
_imageAvailable[deviceId] = 0;
|
||||
|
||||
while (imgTakeNum != imgTarget)
|
||||
{
|
||||
int sleepMs = 10;
|
||||
@@ -554,7 +554,7 @@ bool Hd_CameraModule_3DKeyence::run()
|
||||
luminanceMat = cv::Mat(_lastImageSizeHeight[deviceId], xImageSize, CV_16UC1, luminanceImage);
|
||||
else
|
||||
luminanceMat = cv::Mat(yImageSize, xImageSize, CV_16UC1, luminanceImage);
|
||||
|
||||
|
||||
cv::normalize(luminanceMat, luminanceMat, 0, 255, cv::NORM_MINMAX,CV_8U);
|
||||
luminanceMatS.enqueue(luminanceMat);
|
||||
|
||||
@@ -571,6 +571,7 @@ bool Hd_CameraModule_3DKeyence::run()
|
||||
_lastImageSizeHeight[deviceId] = 0;
|
||||
imgTakeNum++;
|
||||
}
|
||||
_imageAvailable[deviceId] = 0;
|
||||
qDebug() << camera_name <<"Finish";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef Hd_CameraModule_3DKeyence_H
|
||||
#ifndef Hd_CameraModule_3DKeyence_H
|
||||
#define Hd_CameraModule_3DKeyence_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
基恩士3D相机
|
||||
初始化格式 IP#DEVICE-ID(手动按照初始化的顺序从0开始递增)#图像宽(X)#图像高(Y)#取图次数#超时时间
|
||||
192.168.31.1#0#3200#850#1#1000
|
||||
192.168.31.1#0#3200#850#1#1000
|
||||
|
||||
Reference in New Issue
Block a user