log4cpp arm下毫秒修复

This commit is contained in:
yiyi 2026-04-05 12:55:15 +08:00
parent 5e978eaea4
commit c98aa7b5d6
5 changed files with 24 additions and 9 deletions

View File

@ -63,7 +63,11 @@ public:
// Workpiece点云和角点检测结果转图像 - 将角点画成圆点
static QImage GeneratePointCloudRetPointImage(const std::vector<std::vector<SVzNL3DPosition>>& scanLines,
const std::vector<std::vector<SVzNL3DPoint>>& cornerPoints,
double margin = 0.0);
double margin = 0.0,
double* outXMin = nullptr,
double* outXMax = nullptr,
double* outYMin = nullptr,
double* outYMax = nullptr);
// ParticleSize点云和颗粒检测结果转图像 - 生成带颗粒标记的点云图像 (直接返回QImage)
static QImage GeneratePointCloudImageWithParticles(

View File

@ -629,7 +629,11 @@ void PointCloudImageUtils::DrawLapWeldResults(QPainter& painter,
// Workpiece点云和角点检测结果转图像 - 将角点画成圆点
QImage PointCloudImageUtils::GeneratePointCloudRetPointImage(const std::vector<std::vector<SVzNL3DPosition>>& scanLines,
const std::vector<std::vector<SVzNL3DPoint>>& cornerPoints,
double margin)
double margin,
double* outXMin,
double* outXMax,
double* outYMin,
double* outYMax)
{
if (scanLines.empty()) {
return QImage();
@ -650,6 +654,12 @@ QImage PointCloudImageUtils::GeneratePointCloudRetPointImage(const std::vector<s
return QImage();
}
// 输出原始点云范围(扩展边界之前)
if (outXMin) *outXMin = xMin;
if (outXMax) *outXMax = xMax;
if (outYMin) *outYMin = yMin;
if (outYMax) *outYMax = yMax;
// 在3D范围上扩展边界如果指定
if (margin > 0.0) {
xMin -= margin;

View File

@ -1,4 +1,7 @@
ADD_DEFINITIONS(-D__OPENVMS__) #log4cpp
if(NOT WIN32)
ADD_DEFINITIONS(-DLOG4CPP_HAVE_GETTIMEOFDAY) #ARM/Linux gettimeofday
endif()
ADD_DEFINITIONS(-DVR_UTILS_EXPORTS) #VrUtils
# ADD_COMPILE_OPTIONS(-Wno-deprecated-declarations) #auto_ptr

View File

@ -290,11 +290,7 @@ void VrLogUtils::UninitLog()
/// 开启/关闭时间戳
void VrLogUtils::EnableTime(bool bEnable)
{
if (nullptr != m_pLayout)
{
m_pLayout->setConversionPattern(bEnable ? "%d{%Y-%m-%d %H:%M:%S.%l} [%p] %m" : "%p %m");
}
g_isTimeEnabled = false;
g_isTimeEnabled = bEnable;
}
/// 输出log

View File

@ -37,8 +37,10 @@
#else
# if defined(__MINGW32__)
# include <log4cpp/config-MinGW32.h>
//# else
//# include <log4cpp/config.h>
# else
// Linux/ARM 等 POSIX 平台:启用 gettimeofday 以支持毫秒精度
# define LOG4CPP_HAVE_GETTIMEOFDAY 1
# define LOG4CPP_HAVE_SSTREAM 1
# endif
#endif
#endif