优化设备状态显示逻辑,调整UI布局,更新相机和机械臂状态的样式设置,增强日志记录功能。
This commit is contained in:
parent
2afa5b1983
commit
5a59efcabc
@ -302,15 +302,10 @@ int GrabBagPresenter::InitAlgorithmParams()
|
||||
m_algoParam.growParam.minLTypeTreeLen = xmlParams.growParam.minLTypeTreeLen;
|
||||
m_algoParam.growParam.minVTypeTreeLen = xmlParams.growParam.minVTypeTreeLen;
|
||||
|
||||
// 初始化平面校准参数(单位矩阵,表示不进行额外的平面校准)
|
||||
double initCalib[9] = {
|
||||
1.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 1.0
|
||||
};
|
||||
// 设置平面校准参数(使用从XML配置文件读取的数据)
|
||||
for (int i = 0; i < 9; i++) {
|
||||
m_planeCalibParam.planeCalib[i] = initCalib[i];
|
||||
m_planeCalibParam.invRMatrix[i] = initCalib[i];
|
||||
m_planeCalibParam.planeCalib[i] = xmlParams.planeCalibParam.planeCalib[i];
|
||||
m_planeCalibParam.invRMatrix[i] = xmlParams.planeCalibParam.invRMatrix[i];
|
||||
}
|
||||
m_planeCalibParam.planeHeight = xmlParams.planeCalibParam.planeHeight;
|
||||
|
||||
@ -318,6 +313,14 @@ int GrabBagPresenter::InitAlgorithmParams()
|
||||
LOG_INFO(" Bag: L=%.1f, W=%.1f, H=%.1f\n", m_algoParam.bagParam.bagL, m_algoParam.bagParam.bagW, m_algoParam.bagParam.bagH);
|
||||
LOG_INFO(" Filter: continuityTh=%.1f, outlierTh=%d\n", m_algoParam.filterParam.continuityTh, m_algoParam.filterParam.outlierTh);
|
||||
LOG_INFO(" Plane calibration: height=%.1f\n", m_planeCalibParam.planeHeight);
|
||||
LOG_INFO(" Plane calibration matrix:\n");
|
||||
LOG_INFO(" [%.3f, %.3f, %.3f]\n", m_planeCalibParam.planeCalib[0], m_planeCalibParam.planeCalib[1], m_planeCalibParam.planeCalib[2]);
|
||||
LOG_INFO(" [%.3f, %.3f, %.3f]\n", m_planeCalibParam.planeCalib[3], m_planeCalibParam.planeCalib[4], m_planeCalibParam.planeCalib[5]);
|
||||
LOG_INFO(" [%.3f, %.3f, %.3f]\n", m_planeCalibParam.planeCalib[6], m_planeCalibParam.planeCalib[7], m_planeCalibParam.planeCalib[8]);
|
||||
LOG_INFO(" Inverse rotation matrix:\n");
|
||||
LOG_INFO(" [%.3f, %.3f, %.3f]\n", m_planeCalibParam.invRMatrix[0], m_planeCalibParam.invRMatrix[1], m_planeCalibParam.invRMatrix[2]);
|
||||
LOG_INFO(" [%.3f, %.3f, %.3f]\n", m_planeCalibParam.invRMatrix[3], m_planeCalibParam.invRMatrix[4], m_planeCalibParam.invRMatrix[5]);
|
||||
LOG_INFO(" [%.3f, %.3f, %.3f]\n", m_planeCalibParam.invRMatrix[6], m_planeCalibParam.invRMatrix[7], m_planeCalibParam.invRMatrix[8]);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
|
||||
|
||||
#define GRABBAG_VERSION_STRING "1.0.0"
|
||||
#define GRABBAG_BUILD_STRING "4"
|
||||
#define GRABBAG_FULL_VERSION_STRING "V1.0.0_4"
|
||||
#define GRABBAG_BUILD_STRING "6"
|
||||
#define GRABBAG_FULL_VERSION_STRING "V1.0.0_6"
|
||||
|
||||
// 获取版本信息的便捷函数
|
||||
inline const char* GetGrabBagVersion() {
|
||||
|
||||
@ -30,7 +30,6 @@ devstatus::~devstatus()
|
||||
// 设置devstatus的样式
|
||||
void devstatus::setItemStyle()
|
||||
{
|
||||
// 参考ResultItem的样式设置,添加边框作为格子间分隔线
|
||||
this->setStyleSheet(
|
||||
"devstatus { "
|
||||
" border: 2px solid #191A1C; " // 添加边框作为格子间分隔线
|
||||
@ -45,9 +44,8 @@ void devstatus::setCameraStatusImage(QWidget* widget, bool isOnline) {
|
||||
|
||||
QString imagePath = isOnline ? ":/resource/camera_online.png" : ":/resource/camera_offline.png";
|
||||
|
||||
widget->setStyleSheet(QString("image: url(%1);")
|
||||
.arg(imagePath));
|
||||
widget->setFixedSize(32, 32); // 调整大小以适应图片
|
||||
widget->setStyleSheet(QString("image: url(%1);").arg(imagePath));
|
||||
// widget->setFixedSize(32, 32); // 调整大小以适应图片
|
||||
}
|
||||
|
||||
// 设置机械臂状态图片的私有成员函数
|
||||
@ -56,9 +54,8 @@ void devstatus::setRobotStatusImage(QWidget* widget, bool isOnline) {
|
||||
|
||||
QString imagePath = isOnline ? ":/resource/robot_online.png" : ":/resource/robot_offline.png";
|
||||
|
||||
widget->setStyleSheet(QString("image: url(%1); ")
|
||||
.arg(imagePath));
|
||||
widget->setFixedSize(32, 32); // 调整大小以适应图片
|
||||
widget->setStyleSheet(QString("image: url(%1); ").arg(imagePath));
|
||||
// widget->setFixedSize(32, 32); // 调整大小以适应图片
|
||||
}
|
||||
|
||||
// 更新相机1状态
|
||||
@ -105,6 +102,12 @@ void devstatus::setCameraCount(int cameraCount)
|
||||
|
||||
LOG_DEBUG("setCameraCount: %d \n", cameraCount);
|
||||
|
||||
// 隐藏整个相机2的frame,而不是单独隐藏图片和文字
|
||||
if (ui->frame_camera_2) {
|
||||
ui->frame_camera_2->setVisible(showCamera2);
|
||||
} else {
|
||||
// 如果frame_camera_2不存在,则单独隐藏图片和文字控件
|
||||
ui->dev_camer_2_img->setVisible(showCamera2);
|
||||
ui->dev_camera_2_txt->setVisible(showCamera2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>272</width>
|
||||
<height>200</height>
|
||||
<width>556</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -19,24 +19,33 @@
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>20</y>
|
||||
<width>151</width>
|
||||
<height>161</height>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>551</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="dev_camer_1_img" native="true">
|
||||
<widget class="QFrame" name="frame_camera_1">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/camera_offline.png);</string>
|
||||
<string notr="true">background-color: rgb(37, 38, 42);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="dev_camera_1_txt">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>85</x>
|
||||
<y>26</y>
|
||||
<width>80</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
@ -49,20 +58,41 @@
|
||||
<string>相机在线</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="dev_camer_2_img" native="true">
|
||||
<widget class="QWidget" name="dev_camer_1_img" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>16</y>
|
||||
<width>48</width>
|
||||
<height>48</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/camera_offline.png);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_camera_2">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(37, 38, 42);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="dev_camera_2_txt">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>85</x>
|
||||
<y>26</y>
|
||||
<width>80</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
@ -75,20 +105,41 @@
|
||||
<string>相机在线</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QWidget" name="dev_robot_img" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/robot_offline.png);</string>
|
||||
<widget class="QWidget" name="dev_camer_2_img" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>16</y>
|
||||
<width>48</width>
|
||||
<height>48</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/camera_offline.png);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_robot">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(37, 38, 42);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="dev_robot_txt">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>85</x>
|
||||
<y>26</y>
|
||||
<width>80</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
@ -101,8 +152,20 @@
|
||||
<string>机械臂在线</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QWidget" name="dev_robot_img" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>16</y>
|
||||
<width>48</width>
|
||||
<height>48</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/robot_offline.png);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#include <QIcon>
|
||||
#include <QMetaType>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include "Version.h"
|
||||
#include "VrSimpleLog.h"
|
||||
|
||||
@ -59,6 +60,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
// 启动后自动最大化显示
|
||||
this->showMaximized();
|
||||
|
||||
// 初始化时隐藏label_work
|
||||
ui->label_work->setVisible(false);
|
||||
|
||||
// 初始化GraphicsScene
|
||||
QGraphicsScene* scene = new QGraphicsScene(this);
|
||||
ui->detect_image->setScene(scene);
|
||||
@ -130,13 +134,10 @@ void MainWindow::Init()
|
||||
|
||||
m_deviceStatusWidget = new devstatus(); //因为初始化回调的数据要存储,所以要在init前创建好
|
||||
|
||||
// 初始化完成后,在detect_result_list中增加设备状态widget
|
||||
QListWidgetItem* deviceStatusItem = new QListWidgetItem();
|
||||
deviceStatusItem->setBackground(QBrush(Qt::transparent));
|
||||
deviceStatusItem->setSizeHint(QSize(272, 200));
|
||||
|
||||
ui->detect_result_list->addItem(deviceStatusItem);
|
||||
ui->detect_result_list->setItemWidget(deviceStatusItem, m_deviceStatusWidget);
|
||||
// 将设备状态widget添加到frame_dev中
|
||||
QVBoxLayout* frameDevLayout = new QVBoxLayout(ui->frame_dev);
|
||||
frameDevLayout->setContentsMargins(0, 0, 0, 0);
|
||||
frameDevLayout->addWidget(m_deviceStatusWidget);
|
||||
|
||||
// 设置列表视图模式
|
||||
ui->detect_result_list->setViewMode(QListView::IconMode);
|
||||
@ -181,31 +182,25 @@ void MainWindow::displayImage(const QImage& image)
|
||||
// 添加扩展版本的检测结果函数
|
||||
void MainWindow::addDetectionResult(const DetectionResult& result)
|
||||
{
|
||||
// 清空之前的数据(除了第一个设备状态item)
|
||||
while (ui->detect_result_list->count() > 1) {
|
||||
QListWidgetItem* item = ui->detect_result_list->takeItem(1);
|
||||
delete item;
|
||||
}
|
||||
|
||||
// 更新现有设备状态显示(第一个item就是设备状态)
|
||||
if (m_deviceStatusWidget) {
|
||||
// m_deviceStatusWidget会自动从其内部状态获取设备状态信息
|
||||
// 不需要手动更新,因为状态变化时会直接更新到widget中
|
||||
}
|
||||
// 清空之前的所有检测结果数据
|
||||
ui->detect_result_list->clear();
|
||||
|
||||
// 设置为图标模式,实现网格布局(多列显示)
|
||||
ui->detect_result_list->setViewMode(QListView::IconMode);
|
||||
ui->detect_result_list->setResizeMode(QListView::Adjust);
|
||||
|
||||
// 设置滚动条策略:始终显示垂直滚动条,隐藏水平滚动条
|
||||
// 设置滚动条策略:强制隐藏所有滚动条
|
||||
ui->detect_result_list->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
ui->detect_result_list->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
// 计算gridWidth:考虑12px间距,确保两列布局
|
||||
int totalWidth = ui->detect_result_list->width();
|
||||
int itemSpacing = 12;
|
||||
int gridWidth = (totalWidth - itemSpacing - 17) / 2; //20是滚动条的宽度
|
||||
int gridHeight = 200;
|
||||
int totalHeight = ui->detect_result_list->height();
|
||||
int itemSpacing = 0;
|
||||
int gridWidth = (totalWidth - 20) / 2; //20是滚动条的宽度
|
||||
int gridHeight = totalHeight / 3 - 1;
|
||||
|
||||
LOG_DEBUG("totalWidth: %d, totalHeight: %d, gridWidth: %d, gridHeight: %d", totalWidth, totalHeight, gridWidth, gridHeight);
|
||||
|
||||
ui->detect_result_list->setGridSize(QSize(gridWidth, gridHeight)); // 设置每个格子的大小
|
||||
ui->detect_result_list->setSpacing(itemSpacing); // 设置item间距为12px
|
||||
@ -491,14 +486,12 @@ void MainWindow::on_btn_hide_clicked()
|
||||
this->showMinimized();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_btn_close_clicked()
|
||||
{
|
||||
// 关闭应用程序
|
||||
this->close();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_btn_test_clicked()
|
||||
{
|
||||
// 打开文件选择对话框
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1344</x>
|
||||
<y>726</y>
|
||||
<y>868</y>
|
||||
<width>556</width>
|
||||
<height>304</height>
|
||||
<height>162</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
@ -81,13 +81,13 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1344</x>
|
||||
<y>140</y>
|
||||
<y>232</y>
|
||||
<width>556</width>
|
||||
<height>571</height>
|
||||
<height>624</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(37, 38, 42);</string>
|
||||
<string notr="true">background-color:rgb(37, 38, 42)</string>
|
||||
</property>
|
||||
<property name="modelColumn">
|
||||
<number>0</number>
|
||||
@ -195,9 +195,9 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<widget class="QLabel" name="label_work">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1630</x>
|
||||
<x>1450</x>
|
||||
<y>20</y>
|
||||
<width>171</width>
|
||||
<width>311</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -219,14 +219,15 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<widget class="QPushButton" name="btn_close">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1870</x>
|
||||
<y>40</y>
|
||||
<width>41</width>
|
||||
<height>41</height>
|
||||
<x>1841</x>
|
||||
<y>32</y>
|
||||
<width>56</width>
|
||||
<height>56</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/close.png);</string>
|
||||
<string notr="true">background-image: url(:/resource/close.png);
|
||||
background-color: rgba(255, 255, 255, 0);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -235,14 +236,15 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<widget class="QPushButton" name="btn_hide">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1800</x>
|
||||
<y>40</y>
|
||||
<width>41</width>
|
||||
<height>41</height>
|
||||
<x>1762</x>
|
||||
<y>32</y>
|
||||
<width>56</width>
|
||||
<height>56</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">image: url(:/resource/hide.png);</string>
|
||||
<string notr="true">background-image: url(:/resource/hide.png);
|
||||
background-color: rgba(255, 255, 255, 0);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -251,8 +253,8 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<widget class="QPushButton" name="btn_start">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1460</x>
|
||||
<y>20</y>
|
||||
<x>1525</x>
|
||||
<y>21</y>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
@ -263,7 +265,8 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-image: url(:/resource/start.png);</string>
|
||||
<string notr="true">background-image: url(:/resource/start.png);
|
||||
background-color: rgba(255, 255, 255, 0);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -272,8 +275,8 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<widget class="QPushButton" name="btn_stop">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1562</x>
|
||||
<y>20</y>
|
||||
<x>1645</x>
|
||||
<y>21</y>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
@ -284,13 +287,33 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-image: url(:/resource/stop.png);</string>
|
||||
<string notr="true">background-image: url(:/resource/stop.png);
|
||||
background-color: rgba(255, 255, 255, 0);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame_dev">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1344</x>
|
||||
<y>140</y>
|
||||
<width>556</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(37, 38, 42, 0);</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>groupBox</zorder>
|
||||
<zorder>detect_image</zorder>
|
||||
<zorder>detect_log</zorder>
|
||||
@ -300,6 +323,7 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<zorder>btn_algo_config</zorder>
|
||||
<zorder>btn_camera_levelling</zorder>
|
||||
<zorder>btn_camera</zorder>
|
||||
<zorder>frame_dev</zorder>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
|
||||
@ -40,10 +40,10 @@ void ResultItem::setResultData(int targetIndex, const GrabBagPosition& position)
|
||||
|
||||
void ResultItem::setItemStyle()
|
||||
{
|
||||
// 只设置黄色边框作为格子间分隔线,不修改背景和QLineEdit样式
|
||||
// 只设置右侧和下侧边框作为格子间分隔线,不修改背景和QLineEdit样式
|
||||
this->setStyleSheet(
|
||||
"ResultItem { "
|
||||
" border: 2px solid #191A1C; " // 只添加黄色边框作为格子间分隔线
|
||||
" border: 6px solid #191A1C; " // 右侧边框
|
||||
" border-radius: 0px; " // 去掉圆角,让分隔线更清晰
|
||||
"} "
|
||||
);
|
||||
|
||||
@ -135,6 +135,9 @@ border: 1px solid #3B3D47;
|
||||
padding: 5px;
|
||||
font-size: 12px;</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -151,6 +154,9 @@ border: 1px solid #3B3D47;
|
||||
padding: 5px;
|
||||
font-size: 12px;</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -167,6 +173,9 @@ border: 1px solid #3B3D47;
|
||||
padding: 5px;
|
||||
font-size: 12px;</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -183,6 +192,9 @@ border: 1px solid #3B3D47;
|
||||
padding: 5px;
|
||||
font-size: 12px;</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -193,7 +205,7 @@ font-size: 12px;</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>52</x>
|
||||
<y>10</y>
|
||||
<y>8</y>
|
||||
<width>191</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
|
||||
@ -90,9 +90,9 @@ struct VrTreeGrowParam
|
||||
*/
|
||||
struct VrPlaneCalibParam
|
||||
{
|
||||
double planeCalib[9]; // 旋转矩阵,将数据调平
|
||||
double planeCalib[9] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}; // 旋转矩阵,将数据调平(默认单位矩阵)
|
||||
double planeHeight = -1.0; // 参考平面的高度,用于去除地面数据
|
||||
double invRMatrix[9]; // 逆旋转矩阵,回到原坐标系
|
||||
double invRMatrix[9] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}; // 逆旋转矩阵,回到原坐标系(默认单位矩阵)
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -176,6 +176,46 @@ ConfigResult CVrConfig::LoadConfig(const std::string& filePath)
|
||||
{
|
||||
if (planeCalibParamElement->Attribute("planeHeight"))
|
||||
result.algorithmParams.planeCalibParam.planeHeight = planeCalibParamElement->DoubleAttribute("planeHeight");
|
||||
|
||||
// 读取旋转矩阵planeCalib[9] (3x3矩阵)
|
||||
if (planeCalibParamElement->Attribute("planeCalib_00"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[0] = planeCalibParamElement->DoubleAttribute("planeCalib_00");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_01"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[1] = planeCalibParamElement->DoubleAttribute("planeCalib_01");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_02"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[2] = planeCalibParamElement->DoubleAttribute("planeCalib_02");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_10"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[3] = planeCalibParamElement->DoubleAttribute("planeCalib_10");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_11"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[4] = planeCalibParamElement->DoubleAttribute("planeCalib_11");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_12"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[5] = planeCalibParamElement->DoubleAttribute("planeCalib_12");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_20"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[6] = planeCalibParamElement->DoubleAttribute("planeCalib_20");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_21"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[7] = planeCalibParamElement->DoubleAttribute("planeCalib_21");
|
||||
if (planeCalibParamElement->Attribute("planeCalib_22"))
|
||||
result.algorithmParams.planeCalibParam.planeCalib[8] = planeCalibParamElement->DoubleAttribute("planeCalib_22");
|
||||
|
||||
// 读取逆旋转矩阵invRMatrix[9] (3x3矩阵)
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_00"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[0] = planeCalibParamElement->DoubleAttribute("invRMatrix_00");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_01"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[1] = planeCalibParamElement->DoubleAttribute("invRMatrix_01");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_02"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[2] = planeCalibParamElement->DoubleAttribute("invRMatrix_02");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_10"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[3] = planeCalibParamElement->DoubleAttribute("invRMatrix_10");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_11"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[4] = planeCalibParamElement->DoubleAttribute("invRMatrix_11");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_12"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[5] = planeCalibParamElement->DoubleAttribute("invRMatrix_12");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_20"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[6] = planeCalibParamElement->DoubleAttribute("invRMatrix_20");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_21"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[7] = planeCalibParamElement->DoubleAttribute("invRMatrix_21");
|
||||
if (planeCalibParamElement->Attribute("invRMatrix_22"))
|
||||
result.algorithmParams.planeCalibParam.invRMatrix[8] = planeCalibParamElement->DoubleAttribute("invRMatrix_22");
|
||||
}
|
||||
|
||||
}
|
||||
@ -296,6 +336,29 @@ bool CVrConfig::SaveConfig(const std::string& filePath, ConfigResult& configResu
|
||||
// 添加平面校准参数
|
||||
XMLElement* planeCalibParamElement = doc.NewElement("PlaneCalibParam");
|
||||
planeCalibParamElement->SetAttribute("planeHeight", configResult.algorithmParams.planeCalibParam.planeHeight);
|
||||
|
||||
// 保存旋转矩阵planeCalib[9] (3x3矩阵)
|
||||
planeCalibParamElement->SetAttribute("planeCalib_00", configResult.algorithmParams.planeCalibParam.planeCalib[0]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_01", configResult.algorithmParams.planeCalibParam.planeCalib[1]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_02", configResult.algorithmParams.planeCalibParam.planeCalib[2]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_10", configResult.algorithmParams.planeCalibParam.planeCalib[3]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_11", configResult.algorithmParams.planeCalibParam.planeCalib[4]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_12", configResult.algorithmParams.planeCalibParam.planeCalib[5]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_20", configResult.algorithmParams.planeCalibParam.planeCalib[6]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_21", configResult.algorithmParams.planeCalibParam.planeCalib[7]);
|
||||
planeCalibParamElement->SetAttribute("planeCalib_22", configResult.algorithmParams.planeCalibParam.planeCalib[8]);
|
||||
|
||||
// 保存逆旋转矩阵invRMatrix[9] (3x3矩阵)
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_00", configResult.algorithmParams.planeCalibParam.invRMatrix[0]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_01", configResult.algorithmParams.planeCalibParam.invRMatrix[1]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_02", configResult.algorithmParams.planeCalibParam.invRMatrix[2]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_10", configResult.algorithmParams.planeCalibParam.invRMatrix[3]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_11", configResult.algorithmParams.planeCalibParam.invRMatrix[4]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_12", configResult.algorithmParams.planeCalibParam.invRMatrix[5]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_20", configResult.algorithmParams.planeCalibParam.invRMatrix[6]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_21", configResult.algorithmParams.planeCalibParam.invRMatrix[7]);
|
||||
planeCalibParamElement->SetAttribute("invRMatrix_22", configResult.algorithmParams.planeCalibParam.invRMatrix[8]);
|
||||
|
||||
algoParamsElement->InsertEndChild(planeCalibParamElement);
|
||||
|
||||
// 添加调试参数(在AlgorithmParams外面)
|
||||
|
||||
@ -33,7 +33,13 @@
|
||||
zDeviation_max="80.0" minLTypeTreeLen="50.0" minVTypeTreeLen="50.0" />
|
||||
|
||||
<!-- 平面校准参数 -->
|
||||
<PlaneCalibParam planeHeight="-1.0" />
|
||||
<PlaneCalibParam planeHeight="-1.0"
|
||||
planeCalib_00="1.0" planeCalib_01="0.0" planeCalib_02="0.0"
|
||||
planeCalib_10="0.0" planeCalib_11="1.0" planeCalib_12="0.0"
|
||||
planeCalib_20="0.0" planeCalib_21="0.0" planeCalib_22="1.0"
|
||||
invRMatrix_00="1.0" invRMatrix_01="0.0" invRMatrix_02="0.0"
|
||||
invRMatrix_10="0.0" invRMatrix_11="1.0" invRMatrix_12="0.0"
|
||||
invRMatrix_20="0.0" invRMatrix_21="0.0" invRMatrix_22="1.0" />
|
||||
|
||||
<!-- 调试参数 -->
|
||||
</AlgorithmParams>
|
||||
|
||||
@ -86,6 +86,10 @@ int CVrEyeDevice::OpenDevice(const char* sIP, VzNL_OnNotifyStatusCBEx fNotify, v
|
||||
VzNL_GetSwingMotorInfo(m_pHandle, &swingMotorDevInfo);
|
||||
// VzNL_SetSwingStopAngle(m_pHandle, swingMotorDevInfo.fMotorMaxAngle / 2.f);
|
||||
|
||||
SVzNLVersionInfo sVersionInfo;
|
||||
VzNL_GetVersion(m_pHandle, &sVersionInfo);
|
||||
LOG_DEBUG("version : %s\n", sVersionInfo.szSDKVersion);
|
||||
|
||||
// 版本信息打印
|
||||
unsigned int versionCode = VzNL_GetSwingVersionCode(m_pHandle);
|
||||
LOG_DEBUG("swing versiong : %u\n", versionCode);
|
||||
@ -93,6 +97,12 @@ int CVrEyeDevice::OpenDevice(const char* sIP, VzNL_OnNotifyStatusCBEx fNotify, v
|
||||
int nnnRet = VzNL_SetEthSendDataLength(m_pHandle, 1024);
|
||||
LOG_DEBUG("SenddataLen ret : %d\n", nnnRet);
|
||||
|
||||
|
||||
#if 0
|
||||
//启用RGBD
|
||||
VzNL_EnableRGB(m_pHandle, VzTrue);
|
||||
float exposeThres = VzNL_GetRGBAutoExposeThres(m_pHandle, &nnnRet);
|
||||
|
||||
//白平衡
|
||||
VzBool bEnable = VzNL_IsEnableRGBAWB(m_pHandle, &nnnRet);
|
||||
LOG_DEBUG("EnableRGBAWB : %d [%d]\n", bEnable, nnnRet);
|
||||
@ -104,11 +114,6 @@ int CVrEyeDevice::OpenDevice(const char* sIP, VzNL_OnNotifyStatusCBEx fNotify, v
|
||||
nnnRet = VzNL_EnableRGBAutoExpose(m_pHandle, VzTrue);
|
||||
LOG_DEBUG("EnableRGBAutoExpose [%d]\n", nnnRet);
|
||||
}
|
||||
|
||||
#if 0
|
||||
//启用RGBD
|
||||
VzNL_EnableRGB(m_pHandle, VzTrue);
|
||||
float exposeThres = VzNL_GetRGBAutoExposeThres(m_pHandle, &nnnRet);
|
||||
LOG_DEBUG("RGBAutoExposeThres : %f [%d]\n", exposeThres, nnnRet);
|
||||
#endif
|
||||
//设置回调
|
||||
|
||||
@ -27,13 +27,13 @@
|
||||
#pragma comment(lib, "advapi32.lib")
|
||||
#endif
|
||||
|
||||
#define LOG_VERBOSE(...) VrLogUtils::EchoLog(KELOGLEVEL_Verbose, logfilename(__FILE__), __LINE__, "VrAPPV", ##__VA_ARGS__)
|
||||
#define LOG_DEBUG(...) VrLogUtils::EchoLog(KELOGLEVEL_Debug, logfilename(__FILE__), __LINE__, "VrAPPD", ##__VA_ARGS__)
|
||||
#define LOG_INFO(...) VrLogUtils::EchoLog(KELOGLEVEL_Info, logfilename(__FILE__), __LINE__, "VrAPPI", ##__VA_ARGS__)
|
||||
#define LOG_WARNING(...) VrLogUtils::EchoLog(KELOGLEVEL_Warning, logfilename(__FILE__), __LINE__, "VrAPPW", ##__VA_ARGS__)
|
||||
#define LOG_ERROR(...) VrLogUtils::EchoLog(KELOGLEVEL_Error, logfilename(__FILE__), __LINE__, "VrAPPE", ##__VA_ARGS__)
|
||||
#define LOG_ERRO(...) VrLogUtils::EchoLog(KELOGLEVEL_Error, logfilename(__FILE__), __LINE__, "VrAPPE", ##__VA_ARGS__)
|
||||
#define LOG_ERR(...) VrLogUtils::EchoLog(KELOGLEVEL_Error, logfilename(__FILE__), __LINE__, "VrAPPE", ##__VA_ARGS__)
|
||||
#define LOG_VERBOSE(...) VrLogUtils::EchoLog(KELOGLEVEL_Verbose, logfilename(__FILE__), __LINE__, "APPV", ##__VA_ARGS__)
|
||||
#define LOG_DEBUG(...) VrLogUtils::EchoLog(KELOGLEVEL_Debug, logfilename(__FILE__), __LINE__, "APPD", ##__VA_ARGS__)
|
||||
#define LOG_INFO(...) VrLogUtils::EchoLog(KELOGLEVEL_Info, logfilename(__FILE__), __LINE__, "APPI", ##__VA_ARGS__)
|
||||
#define LOG_WARNING(...) VrLogUtils::EchoLog(KELOGLEVEL_Warning, logfilename(__FILE__), __LINE__, "APPW", ##__VA_ARGS__)
|
||||
#define LOG_ERROR(...) VrLogUtils::EchoLog(KELOGLEVEL_Error, logfilename(__FILE__), __LINE__, "APPE", ##__VA_ARGS__)
|
||||
#define LOG_ERRO(...) VrLogUtils::EchoLog(KELOGLEVEL_Error, logfilename(__FILE__), __LINE__, "APPE", ##__VA_ARGS__)
|
||||
#define LOG_ERR(...) VrLogUtils::EchoLog(KELOGLEVEL_Error, logfilename(__FILE__), __LINE__, "APPE", ##__VA_ARGS__)
|
||||
|
||||
/// @brief
|
||||
/// 日志等级
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user