ugly ui but full functions
This commit is contained in:
parent
50b8c37a9c
commit
f56b876119
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,7 +3,7 @@ build
|
|||||||
release
|
release
|
||||||
debug
|
debug
|
||||||
.qtc_clangd
|
.qtc_clangd
|
||||||
Makefile*
|
Makefile.*
|
||||||
*.pro.user*
|
*.pro.user*
|
||||||
*.pro.user
|
*.pro.user
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
46
camera.cpp
46
camera.cpp
@ -159,17 +159,22 @@ MIL_INT ProcessingFunction0(MIL_INT HookType, MIL_ID HookId, void *HookDataPtr)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SaveImg_Flag)
|
if (SaveImg_Flag)
|
||||||
{
|
{
|
||||||
//拷贝存图图像
|
// 拷贝存图图像
|
||||||
MbufCopy(ModifiedBufferId0,MilImage0);
|
MbufCopy(ModifiedBufferId0, MilImage0);
|
||||||
//Mil保存路径
|
cv::Mat img = ImageUtils::mil2Mat(MilImage0);
|
||||||
QString MilImgPath = QString("C:/Users/Administrator/Desktop/1/%1.bmp").arg(FuncCount0);
|
|
||||||
MIL_STRING MilImagePath = MilImgPath.toStdWString();
|
// 将图像数据推入存储队列
|
||||||
MbufExport(MilImagePath,M_BMP,MilImage0);
|
ImageData data;
|
||||||
qDebug()<<"回调1成功存储照片:"<<FuncCount0<<"张";
|
data.camera_id = 0;
|
||||||
|
data.image = img.clone(); // 确保图像数据被复制
|
||||||
|
g_storageQueue.enqueue(data);
|
||||||
|
qDebug() << "Callback0: Enqueued image for camera 0";
|
||||||
|
|
||||||
FuncCount0++;
|
FuncCount0++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if(GlobalDebug)
|
#if(GlobalDebug)
|
||||||
qDebug()<<"回调1";
|
qDebug()<<"回调1";
|
||||||
#endif
|
#endif
|
||||||
@ -223,19 +228,22 @@ MIL_INT ProcessingFunction1(MIL_INT HookType, MIL_ID HookId, void *HookDataPtr)
|
|||||||
gDispCurrentPicId1 = ModifiedBufferId1;
|
gDispCurrentPicId1 = ModifiedBufferId1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SaveImg_Flag)
|
if (SaveImg_Flag)
|
||||||
{
|
{
|
||||||
//拷贝存图数据
|
// 拷贝存图图像
|
||||||
MbufCopy(ModifiedBufferId1,MilImage1);
|
MbufCopy(ModifiedBufferId1, MilImage1);
|
||||||
//Mil保存路径
|
cv::Mat img = ImageUtils::mil2Mat(MilImage1);
|
||||||
QString MilImgPath = QString("C:/Users/Administrator/Desktop/2/%1.bmp").arg(FuncCount1);
|
|
||||||
MIL_STRING MilImagePath = MilImgPath.toStdWString();
|
// 将图像数据推入存储队列
|
||||||
MbufExport(MilImagePath,M_BMP,MilImage1);
|
ImageData data;
|
||||||
qDebug()<<"回调2成功存储照片:"<<FuncCount1<<"张";
|
data.camera_id = 1;
|
||||||
|
data.image = img.clone(); // 确保图像数据被复制
|
||||||
|
g_storageQueue.enqueue(data);
|
||||||
|
qDebug() << "Callback1: Enqueued image for camera 1";
|
||||||
|
|
||||||
FuncCount1++;
|
FuncCount1++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if (GlobalDebug)
|
#if (GlobalDebug)
|
||||||
qDebug()<<"回调2";
|
qDebug()<<"回调2";
|
||||||
#endif
|
#endif
|
||||||
@ -250,7 +258,6 @@ MIL_INT ProcessingFunction1(MIL_INT HookType, MIL_ID HookId, void *HookDataPtr)
|
|||||||
MimResize(MilImage_Color1, MimResizedestination, 0.5, 1 , M_DEFAULT);
|
MimResize(MilImage_Color1, MimResizedestination, 0.5, 1 , M_DEFAULT);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if(GlobalDebug && DebugDetectionTime)
|
#if(GlobalDebug && DebugDetectionTime)
|
||||||
Timer timer2;
|
Timer timer2;
|
||||||
#endif
|
#endif
|
||||||
@ -305,7 +312,6 @@ MIL_INT ProcessingFunction1(MIL_INT HookType, MIL_ID HookId, void *HookDataPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if(GlobalDebug && DebugDetectionTime)
|
#if(GlobalDebug && DebugDetectionTime)
|
||||||
timer_detection_time.printElapsedTime("Time of Processing From Get into Ca"
|
timer_detection_time.printElapsedTime("Time of Processing From Get into Ca"
|
||||||
"..0llBack to Sent to Lower Mac");
|
"..0llBack to Sent to Lower Mac");
|
||||||
@ -336,8 +342,6 @@ bool DestoryCamera()
|
|||||||
MbufFree(MilImage_Color1);
|
MbufFree(MilImage_Color1);
|
||||||
MbufFree(MilImage_Onnx0);
|
MbufFree(MilImage_Onnx0);
|
||||||
MbufFree(MilImage_Onnx1);
|
MbufFree(MilImage_Onnx1);
|
||||||
// MbufFree(detection_result0);
|
|
||||||
// MbufFree(detection_result1);
|
|
||||||
MdigFree(MilDigitizer0);
|
MdigFree(MilDigitizer0);
|
||||||
MdigFree(MilDigitizer1);
|
MdigFree(MilDigitizer1);
|
||||||
MsysFree(MilSystem);
|
MsysFree(MilSystem);
|
||||||
|
|||||||
1
camera.h
1
camera.h
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "img_utils.h"
|
#include "img_utils.h"
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@ SOURCES += \
|
|||||||
img_utils.cpp \
|
img_utils.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
onnxrunner.cpp \
|
onnxrunner.cpp \
|
||||||
|
storageworker.cpp \
|
||||||
widget.cpp
|
widget.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
@ -21,6 +22,7 @@ HEADERS += \
|
|||||||
globals.h \
|
globals.h \
|
||||||
img_utils.h \
|
img_utils.h \
|
||||||
onnxrunner.h \
|
onnxrunner.h \
|
||||||
|
storageworker.h \
|
||||||
widget.h
|
widget.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
|||||||
@ -39,3 +39,5 @@ QString getConfigDirectory() {
|
|||||||
|
|
||||||
return saveDir;
|
return saveDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThreadSafeQueue<ImageData> g_storageQueue;
|
||||||
|
|||||||
51
globals.h
51
globals.h
@ -28,4 +28,55 @@ extern QSemaphore detection_ready;
|
|||||||
QString getSaveDirectory();
|
QString getSaveDirectory();
|
||||||
QString getConfigDirectory();
|
QString getConfigDirectory();
|
||||||
|
|
||||||
|
// 定义一个结构体来存储图像数据及其来源相机ID
|
||||||
|
struct ImageData
|
||||||
|
{
|
||||||
|
int camera_id;
|
||||||
|
cv::Mat image;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class ThreadSafeQueue{
|
||||||
|
public:
|
||||||
|
// 添加元素到队列
|
||||||
|
void enqueue(const T& item)
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
|
queue_.push(item);
|
||||||
|
cond_var_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从队列中移除并获取元素
|
||||||
|
bool dequeue(T& item)
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
|
while (queue_.empty() && !stop_)
|
||||||
|
{
|
||||||
|
cond_var_.wait(lock);
|
||||||
|
}
|
||||||
|
if (queue_.empty())
|
||||||
|
return false;
|
||||||
|
item = std::move(queue_.front());
|
||||||
|
queue_.pop();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 停止队列,唤醒所有等待的线程
|
||||||
|
void stop()
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
|
stop_ = true;
|
||||||
|
cond_var_.notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::queue<T> queue_;
|
||||||
|
std::mutex mutex_;
|
||||||
|
std::condition_variable cond_var_;
|
||||||
|
bool stop_ = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 定义全局存储队列
|
||||||
|
extern ThreadSafeQueue<ImageData> g_storageQueue;
|
||||||
#endif // GLOBALS_H
|
#endif // GLOBALS_H
|
||||||
|
|||||||
183
ui_widget.h
183
ui_widget.h
@ -11,11 +11,15 @@
|
|||||||
|
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
|
#include <QtWidgets/QGridLayout>
|
||||||
#include <QtWidgets/QGroupBox>
|
#include <QtWidgets/QGroupBox>
|
||||||
|
#include <QtWidgets/QHBoxLayout>
|
||||||
#include <QtWidgets/QLabel>
|
#include <QtWidgets/QLabel>
|
||||||
#include <QtWidgets/QPushButton>
|
#include <QtWidgets/QPushButton>
|
||||||
|
#include <QtWidgets/QSpacerItem>
|
||||||
#include <QtWidgets/QSpinBox>
|
#include <QtWidgets/QSpinBox>
|
||||||
#include <QtWidgets/QTabWidget>
|
#include <QtWidgets/QTabWidget>
|
||||||
|
#include <QtWidgets/QVBoxLayout>
|
||||||
#include <QtWidgets/QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -23,24 +27,35 @@ QT_BEGIN_NAMESPACE
|
|||||||
class Ui_Widget
|
class Ui_Widget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
QHBoxLayout *horizontalLayout;
|
||||||
QTabWidget *tabWidget;
|
QTabWidget *tabWidget;
|
||||||
QWidget *tab;
|
QWidget *tab;
|
||||||
QPushButton *pushButtonStart;
|
QVBoxLayout *verticalLayout;
|
||||||
|
QGroupBox *groupBox_5;
|
||||||
|
QGridLayout *gridLayout;
|
||||||
QPushButton *pushButton_2;
|
QPushButton *pushButton_2;
|
||||||
QPushButton *btn_goto_sort;
|
QPushButton *btn_goto_sort;
|
||||||
QPushButton *btn_0to3;
|
QPushButton *btn_0to3;
|
||||||
|
QPushButton *pushButtonStart;
|
||||||
QGroupBox *groupBox;
|
QGroupBox *groupBox;
|
||||||
|
QHBoxLayout *horizontalLayout_2;
|
||||||
QLabel *label;
|
QLabel *label;
|
||||||
QLabel *lab_lowermachine_isconnect;
|
QLabel *lab_lowermachine_isconnect;
|
||||||
QPushButton *btn_reconnect;
|
QPushButton *btn_reconnect;
|
||||||
QWidget *tab_2;
|
QWidget *tab_2;
|
||||||
|
QHBoxLayout *horizontalLayout_3;
|
||||||
|
QGroupBox *groupBox_7;
|
||||||
|
QVBoxLayout *verticalLayout_3;
|
||||||
QLabel *lab_info;
|
QLabel *lab_info;
|
||||||
QPushButton *btn_start;
|
QPushButton *btn_start;
|
||||||
QPushButton *btn_stop;
|
QPushButton *btn_stop;
|
||||||
QLabel *camera_1_img;
|
QSpacerItem *verticalSpacer;
|
||||||
QLabel *label_2;
|
QGroupBox *groupBox_6;
|
||||||
|
QVBoxLayout *verticalLayout_2;
|
||||||
QLabel *label_3;
|
QLabel *label_3;
|
||||||
QLabel *camera_0_img;
|
QLabel *camera_0_img;
|
||||||
|
QLabel *label_2;
|
||||||
|
QLabel *camera_1_img;
|
||||||
QWidget *tab_3;
|
QWidget *tab_3;
|
||||||
QLabel *label_title_3;
|
QLabel *label_title_3;
|
||||||
QGroupBox *groupBox_4;
|
QGroupBox *groupBox_4;
|
||||||
@ -68,32 +83,53 @@ public:
|
|||||||
if (Widget->objectName().isEmpty())
|
if (Widget->objectName().isEmpty())
|
||||||
Widget->setObjectName("Widget");
|
Widget->setObjectName("Widget");
|
||||||
Widget->resize(800, 600);
|
Widget->resize(800, 600);
|
||||||
|
horizontalLayout = new QHBoxLayout(Widget);
|
||||||
|
horizontalLayout->setObjectName("horizontalLayout");
|
||||||
tabWidget = new QTabWidget(Widget);
|
tabWidget = new QTabWidget(Widget);
|
||||||
tabWidget->setObjectName("tabWidget");
|
tabWidget->setObjectName("tabWidget");
|
||||||
tabWidget->setGeometry(QRect(0, 0, 801, 601));
|
|
||||||
tab = new QWidget();
|
tab = new QWidget();
|
||||||
tab->setObjectName("tab");
|
tab->setObjectName("tab");
|
||||||
pushButtonStart = new QPushButton(tab);
|
verticalLayout = new QVBoxLayout(tab);
|
||||||
pushButtonStart->setObjectName("pushButtonStart");
|
verticalLayout->setObjectName("verticalLayout");
|
||||||
pushButtonStart->setGeometry(QRect(100, 130, 201, 61));
|
groupBox_5 = new QGroupBox(tab);
|
||||||
pushButton_2 = new QPushButton(tab);
|
groupBox_5->setObjectName("groupBox_5");
|
||||||
|
gridLayout = new QGridLayout(groupBox_5);
|
||||||
|
gridLayout->setObjectName("gridLayout");
|
||||||
|
pushButton_2 = new QPushButton(groupBox_5);
|
||||||
pushButton_2->setObjectName("pushButton_2");
|
pushButton_2->setObjectName("pushButton_2");
|
||||||
pushButton_2->setGeometry(QRect(400, 120, 181, 71));
|
|
||||||
btn_goto_sort = new QPushButton(tab);
|
gridLayout->addWidget(pushButton_2, 1, 1, 1, 1);
|
||||||
|
|
||||||
|
btn_goto_sort = new QPushButton(groupBox_5);
|
||||||
btn_goto_sort->setObjectName("btn_goto_sort");
|
btn_goto_sort->setObjectName("btn_goto_sort");
|
||||||
btn_goto_sort->setGeometry(QRect(120, 290, 121, 61));
|
|
||||||
btn_0to3 = new QPushButton(tab);
|
gridLayout->addWidget(btn_goto_sort, 2, 0, 1, 1);
|
||||||
|
|
||||||
|
btn_0to3 = new QPushButton(groupBox_5);
|
||||||
btn_0to3->setObjectName("btn_0to3");
|
btn_0to3->setObjectName("btn_0to3");
|
||||||
btn_0to3->setGeometry(QRect(410, 290, 141, 61));
|
|
||||||
|
gridLayout->addWidget(btn_0to3, 2, 1, 1, 1);
|
||||||
|
|
||||||
|
pushButtonStart = new QPushButton(groupBox_5);
|
||||||
|
pushButtonStart->setObjectName("pushButtonStart");
|
||||||
|
|
||||||
|
gridLayout->addWidget(pushButtonStart, 1, 0, 1, 1);
|
||||||
|
|
||||||
|
|
||||||
|
verticalLayout->addWidget(groupBox_5);
|
||||||
|
|
||||||
groupBox = new QGroupBox(tab);
|
groupBox = new QGroupBox(tab);
|
||||||
groupBox->setObjectName("groupBox");
|
groupBox->setObjectName("groupBox");
|
||||||
groupBox->setGeometry(QRect(160, 390, 401, 131));
|
horizontalLayout_2 = new QHBoxLayout(groupBox);
|
||||||
|
horizontalLayout_2->setObjectName("horizontalLayout_2");
|
||||||
|
horizontalLayout_2->setSizeConstraint(QLayout::SizeConstraint::SetDefaultConstraint);
|
||||||
label = new QLabel(groupBox);
|
label = new QLabel(groupBox);
|
||||||
label->setObjectName("label");
|
label->setObjectName("label");
|
||||||
label->setGeometry(QRect(40, 70, 41, 16));
|
|
||||||
|
horizontalLayout_2->addWidget(label);
|
||||||
|
|
||||||
lab_lowermachine_isconnect = new QLabel(groupBox);
|
lab_lowermachine_isconnect = new QLabel(groupBox);
|
||||||
lab_lowermachine_isconnect->setObjectName("lab_lowermachine_isconnect");
|
lab_lowermachine_isconnect->setObjectName("lab_lowermachine_isconnect");
|
||||||
lab_lowermachine_isconnect->setGeometry(QRect(90, 60, 31, 31));
|
|
||||||
QPalette palette;
|
QPalette palette;
|
||||||
QBrush brush(QColor(237, 212, 0, 255));
|
QBrush brush(QColor(237, 212, 0, 255));
|
||||||
brush.setStyle(Qt::SolidPattern);
|
brush.setStyle(Qt::SolidPattern);
|
||||||
@ -112,42 +148,101 @@ public:
|
|||||||
palette.setBrush(QPalette::Disabled, QPalette::Window, brush);
|
palette.setBrush(QPalette::Disabled, QPalette::Window, brush);
|
||||||
palette.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush1);
|
palette.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush1);
|
||||||
lab_lowermachine_isconnect->setPalette(palette);
|
lab_lowermachine_isconnect->setPalette(palette);
|
||||||
btn_reconnect = new QPushButton(tab);
|
|
||||||
|
horizontalLayout_2->addWidget(lab_lowermachine_isconnect);
|
||||||
|
|
||||||
|
btn_reconnect = new QPushButton(groupBox);
|
||||||
btn_reconnect->setObjectName("btn_reconnect");
|
btn_reconnect->setObjectName("btn_reconnect");
|
||||||
btn_reconnect->setGeometry(QRect(590, 440, 101, 41));
|
|
||||||
|
horizontalLayout_2->addWidget(btn_reconnect);
|
||||||
|
|
||||||
|
|
||||||
|
verticalLayout->addWidget(groupBox);
|
||||||
|
|
||||||
|
verticalLayout->setStretch(0, 5);
|
||||||
|
verticalLayout->setStretch(1, 1);
|
||||||
tabWidget->addTab(tab, QString());
|
tabWidget->addTab(tab, QString());
|
||||||
tab_2 = new QWidget();
|
tab_2 = new QWidget();
|
||||||
tab_2->setObjectName("tab_2");
|
tab_2->setObjectName("tab_2");
|
||||||
lab_info = new QLabel(tab_2);
|
horizontalLayout_3 = new QHBoxLayout(tab_2);
|
||||||
|
horizontalLayout_3->setObjectName("horizontalLayout_3");
|
||||||
|
groupBox_7 = new QGroupBox(tab_2);
|
||||||
|
groupBox_7->setObjectName("groupBox_7");
|
||||||
|
verticalLayout_3 = new QVBoxLayout(groupBox_7);
|
||||||
|
verticalLayout_3->setSpacing(20);
|
||||||
|
verticalLayout_3->setObjectName("verticalLayout_3");
|
||||||
|
verticalLayout_3->setContentsMargins(9, 9, 9, -1);
|
||||||
|
lab_info = new QLabel(groupBox_7);
|
||||||
lab_info->setObjectName("lab_info");
|
lab_info->setObjectName("lab_info");
|
||||||
lab_info->setGeometry(QRect(20, 50, 151, 81));
|
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setPointSize(28);
|
font.setPointSize(28);
|
||||||
lab_info->setFont(font);
|
lab_info->setFont(font);
|
||||||
btn_start = new QPushButton(tab_2);
|
|
||||||
|
verticalLayout_3->addWidget(lab_info);
|
||||||
|
|
||||||
|
btn_start = new QPushButton(groupBox_7);
|
||||||
btn_start->setObjectName("btn_start");
|
btn_start->setObjectName("btn_start");
|
||||||
btn_start->setGeometry(QRect(20, 130, 101, 41));
|
btn_start->setMinimumSize(QSize(70, 70));
|
||||||
btn_stop = new QPushButton(tab_2);
|
|
||||||
|
verticalLayout_3->addWidget(btn_start);
|
||||||
|
|
||||||
|
btn_stop = new QPushButton(groupBox_7);
|
||||||
btn_stop->setObjectName("btn_stop");
|
btn_stop->setObjectName("btn_stop");
|
||||||
btn_stop->setGeometry(QRect(20, 190, 101, 41));
|
btn_stop->setMinimumSize(QSize(70, 70));
|
||||||
camera_1_img = new QLabel(tab_2);
|
|
||||||
camera_1_img->setObjectName("camera_1_img");
|
verticalLayout_3->addWidget(btn_stop);
|
||||||
camera_1_img->setGeometry(QRect(160, 290, 591, 191));
|
|
||||||
camera_1_img->setStyleSheet(QString::fromUtf8("background-color: rgb(129, 129, 129);\n"
|
verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Expanding);
|
||||||
"border: 4px solid black;"));
|
|
||||||
camera_1_img->setLineWidth(1);
|
verticalLayout_3->addItem(verticalSpacer);
|
||||||
label_2 = new QLabel(tab_2);
|
|
||||||
label_2->setObjectName("label_2");
|
|
||||||
label_2->setGeometry(QRect(160, 270, 141, 16));
|
horizontalLayout_3->addWidget(groupBox_7);
|
||||||
label_3 = new QLabel(tab_2);
|
|
||||||
|
groupBox_6 = new QGroupBox(tab_2);
|
||||||
|
groupBox_6->setObjectName("groupBox_6");
|
||||||
|
verticalLayout_2 = new QVBoxLayout(groupBox_6);
|
||||||
|
verticalLayout_2->setObjectName("verticalLayout_2");
|
||||||
|
label_3 = new QLabel(groupBox_6);
|
||||||
label_3->setObjectName("label_3");
|
label_3->setObjectName("label_3");
|
||||||
label_3->setGeometry(QRect(160, 20, 141, 16));
|
|
||||||
camera_0_img = new QLabel(tab_2);
|
verticalLayout_2->addWidget(label_3);
|
||||||
|
|
||||||
|
camera_0_img = new QLabel(groupBox_6);
|
||||||
camera_0_img->setObjectName("camera_0_img");
|
camera_0_img->setObjectName("camera_0_img");
|
||||||
camera_0_img->setGeometry(QRect(160, 50, 591, 191));
|
QSizePolicy sizePolicy(QSizePolicy::Policy::Ignored, QSizePolicy::Policy::Ignored);
|
||||||
|
sizePolicy.setHorizontalStretch(0);
|
||||||
|
sizePolicy.setVerticalStretch(0);
|
||||||
|
sizePolicy.setHeightForWidth(camera_0_img->sizePolicy().hasHeightForWidth());
|
||||||
|
camera_0_img->setSizePolicy(sizePolicy);
|
||||||
camera_0_img->setStyleSheet(QString::fromUtf8("background-color: rgb(129, 129, 129);\n"
|
camera_0_img->setStyleSheet(QString::fromUtf8("background-color: rgb(129, 129, 129);\n"
|
||||||
"border: 4px solid black;"));
|
"border: 4px solid black;"));
|
||||||
camera_0_img->setLineWidth(1);
|
camera_0_img->setLineWidth(1);
|
||||||
|
|
||||||
|
verticalLayout_2->addWidget(camera_0_img);
|
||||||
|
|
||||||
|
label_2 = new QLabel(groupBox_6);
|
||||||
|
label_2->setObjectName("label_2");
|
||||||
|
|
||||||
|
verticalLayout_2->addWidget(label_2);
|
||||||
|
|
||||||
|
camera_1_img = new QLabel(groupBox_6);
|
||||||
|
camera_1_img->setObjectName("camera_1_img");
|
||||||
|
sizePolicy.setHeightForWidth(camera_1_img->sizePolicy().hasHeightForWidth());
|
||||||
|
camera_1_img->setSizePolicy(sizePolicy);
|
||||||
|
camera_1_img->setStyleSheet(QString::fromUtf8("background-color: rgb(129, 129, 129);\n"
|
||||||
|
"border: 4px solid black;"));
|
||||||
|
camera_1_img->setLineWidth(1);
|
||||||
|
|
||||||
|
verticalLayout_2->addWidget(camera_1_img);
|
||||||
|
|
||||||
|
verticalLayout_2->setStretch(1, 5);
|
||||||
|
verticalLayout_2->setStretch(3, 5);
|
||||||
|
|
||||||
|
horizontalLayout_3->addWidget(groupBox_6);
|
||||||
|
|
||||||
|
horizontalLayout_3->setStretch(0, 3);
|
||||||
|
horizontalLayout_3->setStretch(1, 10);
|
||||||
tabWidget->addTab(tab_2, QString());
|
tabWidget->addTab(tab_2, QString());
|
||||||
tab_3 = new QWidget();
|
tab_3 = new QWidget();
|
||||||
tab_3->setObjectName("tab_3");
|
tab_3->setObjectName("tab_3");
|
||||||
@ -216,6 +311,9 @@ public:
|
|||||||
btn_stop_test->setGeometry(QRect(210, 40, 75, 23));
|
btn_stop_test->setGeometry(QRect(210, 40, 75, 23));
|
||||||
tabWidget->addTab(tab_4, QString());
|
tabWidget->addTab(tab_4, QString());
|
||||||
|
|
||||||
|
horizontalLayout->addWidget(tabWidget);
|
||||||
|
|
||||||
|
|
||||||
retranslateUi(Widget);
|
retranslateUi(Widget);
|
||||||
|
|
||||||
tabWidget->setCurrentIndex(1);
|
tabWidget->setCurrentIndex(1);
|
||||||
@ -227,22 +325,25 @@ public:
|
|||||||
void retranslateUi(QWidget *Widget)
|
void retranslateUi(QWidget *Widget)
|
||||||
{
|
{
|
||||||
Widget->setWindowTitle(QCoreApplication::translate("Widget", "Widget", nullptr));
|
Widget->setWindowTitle(QCoreApplication::translate("Widget", "Widget", nullptr));
|
||||||
pushButtonStart->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213", nullptr));
|
groupBox_5->setTitle(QCoreApplication::translate("Widget", "GroupBox", nullptr));
|
||||||
pushButton_2->setText(QCoreApplication::translate("Widget", "\344\277\235\345\255\230\345\233\276\347\211\207", nullptr));
|
pushButton_2->setText(QCoreApplication::translate("Widget", "\344\277\235\345\255\230\345\233\276\347\211\207", nullptr));
|
||||||
btn_goto_sort->setText(QCoreApplication::translate("Widget", "\345\201\234\346\255\242", nullptr));
|
btn_goto_sort->setText(QCoreApplication::translate("Widget", "\345\201\234\346\255\242", nullptr));
|
||||||
btn_0to3->setText(QCoreApplication::translate("Widget", "\345\226\267\351\230\200\346\265\213\350\257\225", nullptr));
|
btn_0to3->setText(QCoreApplication::translate("Widget", "\345\226\267\351\230\200\346\265\213\350\257\225", nullptr));
|
||||||
|
pushButtonStart->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213", nullptr));
|
||||||
groupBox->setTitle(QCoreApplication::translate("Widget", "\350\277\236\346\216\245\347\212\266\346\200\201\357\274\232", nullptr));
|
groupBox->setTitle(QCoreApplication::translate("Widget", "\350\277\236\346\216\245\347\212\266\346\200\201\357\274\232", nullptr));
|
||||||
label->setText(QCoreApplication::translate("Widget", "\344\270\213\344\275\215\346\234\272", nullptr));
|
label->setText(QCoreApplication::translate("Widget", "\344\270\213\344\275\215\346\234\272", nullptr));
|
||||||
lab_lowermachine_isconnect->setText(QString());
|
lab_lowermachine_isconnect->setText(QString());
|
||||||
btn_reconnect->setText(QCoreApplication::translate("Widget", "\351\207\215\346\226\260\350\277\236\346\216\245", nullptr));
|
btn_reconnect->setText(QCoreApplication::translate("Widget", "\351\207\215\346\226\260\350\277\236\346\216\245", nullptr));
|
||||||
tabWidget->setTabText(tabWidget->indexOf(tab), QCoreApplication::translate("Widget", "Tab 1", nullptr));
|
tabWidget->setTabText(tabWidget->indexOf(tab), QCoreApplication::translate("Widget", "Tab 1", nullptr));
|
||||||
lab_info->setText(QCoreApplication::translate("Widget", "\345\207\206\345\244\207\344\270\255", nullptr));
|
groupBox_7->setTitle(QCoreApplication::translate("Widget", "\346\216\247\345\210\266\345\217\212\347\212\266\346\200\201", nullptr));
|
||||||
|
lab_info->setText(QCoreApplication::translate("Widget", "\347\212\266\346\200\201", nullptr));
|
||||||
btn_start->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213\345\210\206\351\200\211", nullptr));
|
btn_start->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213\345\210\206\351\200\211", nullptr));
|
||||||
btn_stop->setText(QCoreApplication::translate("Widget", "\345\201\234\346\255\242\345\210\206\351\200\211", nullptr));
|
btn_stop->setText(QCoreApplication::translate("Widget", "\345\201\234\346\255\242\345\210\206\351\200\211", nullptr));
|
||||||
camera_1_img->setText(QString());
|
groupBox_6->setTitle(QCoreApplication::translate("Widget", "\347\233\270\346\234\272\346\230\276\347\244\272", nullptr));
|
||||||
label_2->setText(QCoreApplication::translate("Widget", "\347\233\270\346\234\2721\357\274\210\351\253\230\344\276\247/\346\260\224\347\275\220\344\276\247\357\274\211", nullptr));
|
|
||||||
label_3->setText(QCoreApplication::translate("Widget", "\347\233\270\346\234\2720\357\274\210\344\275\216\344\276\247/\345\207\272\351\243\216\345\217\243\344\276\247\357\274\211", nullptr));
|
label_3->setText(QCoreApplication::translate("Widget", "\347\233\270\346\234\2720\357\274\210\344\275\216\344\276\247/\345\207\272\351\243\216\345\217\243\344\276\247\357\274\211", nullptr));
|
||||||
camera_0_img->setText(QString());
|
camera_0_img->setText(QString());
|
||||||
|
label_2->setText(QCoreApplication::translate("Widget", "\347\233\270\346\234\2721\357\274\210\351\253\230\344\276\247/\346\260\224\347\275\220\344\276\247\357\274\211", nullptr));
|
||||||
|
camera_1_img->setText(QString());
|
||||||
tabWidget->setTabText(tabWidget->indexOf(tab_2), QCoreApplication::translate("Widget", "Tab 2", nullptr));
|
tabWidget->setTabText(tabWidget->indexOf(tab_2), QCoreApplication::translate("Widget", "Tab 2", nullptr));
|
||||||
label_title_3->setText(QCoreApplication::translate("Widget", "\345\217\202\346\225\260\350\256\276\347\275\256\347\225\214\351\235\242", nullptr));
|
label_title_3->setText(QCoreApplication::translate("Widget", "\345\217\202\346\225\260\350\256\276\347\275\256\347\225\214\351\235\242", nullptr));
|
||||||
groupBox_4->setTitle(QCoreApplication::translate("Widget", "\344\270\213\344\275\215\346\234\272\345\217\202\346\225\260", nullptr));
|
groupBox_4->setTitle(QCoreApplication::translate("Widget", "\344\270\213\344\275\215\346\234\272\345\217\202\346\225\260", nullptr));
|
||||||
|
|||||||
34
widget.cpp
34
widget.cpp
@ -14,13 +14,14 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <img_utils.h>
|
#include <img_utils.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
// 硬编码参数值
|
// 硬编码参数值
|
||||||
int file_delay = 1270; // 延迟时间(毫秒)
|
int file_delay = 1270; // 延迟时间(毫秒)
|
||||||
int file_encoder = 12000; // 编码器值++
|
int file_encoder = 12000; // 编码器值++
|
||||||
int file_valve = 200; // 阀门通道
|
int file_valve = 200; // 阀门通道
|
||||||
|
|
||||||
Widget::Widget(QWidget *parent)
|
Widget::Widget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, ui(new Ui::Widget)
|
, ui(new Ui::Widget)
|
||||||
@ -28,13 +29,23 @@ Widget::Widget(QWidget *parent)
|
|||||||
this->isCamRunning = false;
|
this->isCamRunning = false;
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->camera_0_img->setScaledContents(true);
|
ui->camera_0_img->setScaledContents(false);
|
||||||
ui->camera_1_img->setScaledContents(true);
|
ui->camera_1_img->setScaledContents(false);
|
||||||
|
|
||||||
iniColor();
|
iniColor();
|
||||||
iniLowMac();
|
iniLowMac();
|
||||||
iniCamera();
|
iniCamera();
|
||||||
|
|
||||||
|
// 初始化存储工作者和线程
|
||||||
|
storageWorker = new StorageWorker();
|
||||||
|
storageWorker->moveToThread(&storageThread);
|
||||||
|
|
||||||
|
connect(&storageThread, &QThread::started, storageWorker, &StorageWorker::process);
|
||||||
|
connect(this, &Widget::destroyed, &storageThread, &QThread::quit);
|
||||||
|
connect(&storageThread, &QThread::finished, storageWorker, &QObject::deleteLater);
|
||||||
|
|
||||||
|
storageThread.start();
|
||||||
|
|
||||||
// 启动显示定时器,每秒检查一次
|
// 启动显示定时器,每秒检查一次
|
||||||
QTimer* timer = new QTimer(this);
|
QTimer* timer = new QTimer(this);
|
||||||
connect(timer, &QTimer::timeout, this, &Widget::refreshImage);
|
connect(timer, &QTimer::timeout, this, &Widget::refreshImage);
|
||||||
@ -43,7 +54,16 @@ Widget::Widget(QWidget *parent)
|
|||||||
|
|
||||||
Widget::~Widget()
|
Widget::~Widget()
|
||||||
{
|
{
|
||||||
// DestoryCamera();
|
// 停止存储线程
|
||||||
|
g_storageQueue.stop();
|
||||||
|
storageThread.quit();
|
||||||
|
storageThread.wait();
|
||||||
|
|
||||||
|
// 现有清理代码...
|
||||||
|
DestoryCamera();
|
||||||
|
DestoryLowMac();
|
||||||
|
|
||||||
|
delete ui;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,8 +75,11 @@ void Widget::refreshImage()
|
|||||||
// refresh buttons
|
// refresh buttons
|
||||||
this->ui->btn_start->setEnabled(!this->isCamRunning);
|
this->ui->btn_start->setEnabled(!this->isCamRunning);
|
||||||
this->ui->btn_stop->setEnabled(this->isCamRunning);
|
this->ui->btn_stop->setEnabled(this->isCamRunning);
|
||||||
|
// refresh info
|
||||||
|
this->ui->lab_info->setText(this->isCamRunning? "运行": "停止");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
||||||
{
|
{
|
||||||
// 更新当前的图片0
|
// 更新当前的图片0
|
||||||
@ -85,6 +108,7 @@ void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
|||||||
QPixmap pixmap0 = ImageUtils::mat2QPixmap(img);
|
QPixmap pixmap0 = ImageUtils::mat2QPixmap(img);
|
||||||
if (!pixmap0.isNull())
|
if (!pixmap0.isNull())
|
||||||
{
|
{
|
||||||
|
pixmap0 = pixmap0.scaled(ui->camera_0_img->width(), ui->camera_0_img->height());
|
||||||
ui->camera_0_img->setPixmap(pixmap0);
|
ui->camera_0_img->setPixmap(pixmap0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,6 +137,7 @@ void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
|||||||
QPixmap pixmap1 = ImageUtils::mat2QPixmap(img);
|
QPixmap pixmap1 = ImageUtils::mat2QPixmap(img);
|
||||||
if (!pixmap1.isNull())
|
if (!pixmap1.isNull())
|
||||||
{
|
{
|
||||||
|
pixmap1 = pixmap1.scaled(ui->camera_1_img->width(), ui->camera_1_img->height());
|
||||||
ui->camera_1_img->setPixmap(pixmap1);
|
ui->camera_1_img->setPixmap(pixmap1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +148,6 @@ void Widget::refreshSingleImage(int camera_id, bool overlay_result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Widget::on_pushButton_2_clicked()
|
void Widget::on_pushButton_2_clicked()
|
||||||
{
|
{
|
||||||
SaveImg_Flag = 1;
|
SaveImg_Flag = 1;
|
||||||
|
|||||||
6
widget.h
6
widget.h
@ -1,11 +1,12 @@
|
|||||||
#ifndef WIDGET_H
|
#ifndef WIDGET_H
|
||||||
#define WIDGET_H
|
#define WIDGET_H
|
||||||
|
#include <QThread>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <camera.h>
|
#include <camera.h>
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
#include "storageworker.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@ -41,5 +42,8 @@ private:
|
|||||||
|
|
||||||
bool isCamRunning;
|
bool isCamRunning;
|
||||||
|
|
||||||
|
QThread storageThread; // 存储线程
|
||||||
|
StorageWorker* storageWorker; // 存储工作者
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // WIDGET_H
|
#endif // WIDGET_H
|
||||||
|
|||||||
279
widget.ui
279
widget.ui
@ -13,15 +13,9 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Widget</string>
|
<string>Widget</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>801</width>
|
|
||||||
<height>601</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
@ -29,92 +23,62 @@
|
|||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Tab 1</string>
|
<string>Tab 1</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QPushButton" name="pushButtonStart">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="5,1">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QGroupBox" name="groupBox_5">
|
||||||
<x>100</x>
|
<property name="title">
|
||||||
<y>130</y>
|
<string>GroupBox</string>
|
||||||
<width>201</width>
|
|
||||||
<height>61</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<string>开始</string>
|
<item row="1" column="1">
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
<widget class="QPushButton" name="pushButton_2">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>400</x>
|
|
||||||
<y>120</y>
|
|
||||||
<width>181</width>
|
|
||||||
<height>71</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>保存图片</string>
|
<string>保存图片</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
<widget class="QPushButton" name="btn_goto_sort">
|
<widget class="QPushButton" name="btn_goto_sort">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>120</x>
|
|
||||||
<y>290</y>
|
|
||||||
<width>121</width>
|
|
||||||
<height>61</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>停止</string>
|
<string>停止</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
<widget class="QPushButton" name="btn_0to3">
|
<widget class="QPushButton" name="btn_0to3">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>410</x>
|
|
||||||
<y>290</y>
|
|
||||||
<width>141</width>
|
|
||||||
<height>61</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>喷阀测试</string>
|
<string>喷阀测试</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
</item>
|
||||||
<property name="geometry">
|
<item row="1" column="0">
|
||||||
<rect>
|
<widget class="QPushButton" name="pushButtonStart">
|
||||||
<x>160</x>
|
<property name="text">
|
||||||
<y>390</y>
|
<string>开始</string>
|
||||||
<width>401</width>
|
|
||||||
<height>131</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>连接状态:</string>
|
<string>连接状态:</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QLabel" name="label">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<property name="geometry">
|
<property name="sizeConstraint">
|
||||||
<rect>
|
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
|
||||||
<x>40</x>
|
|
||||||
<y>70</y>
|
|
||||||
<width>41</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>下位机</string>
|
<string>下位机</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QLabel" name="lab_lowermachine_isconnect">
|
<widget class="QLabel" name="lab_lowermachine_isconnect">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>90</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>31</width>
|
|
||||||
<height>31</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
@ -237,123 +201,116 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="btn_reconnect">
|
<widget class="QPushButton" name="btn_reconnect">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>590</x>
|
|
||||||
<y>440</y>
|
|
||||||
<width>101</width>
|
|
||||||
<height>41</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>重新连接</string>
|
<string>重新连接</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Tab 2</string>
|
<string>Tab 2</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QLabel" name="lab_info">
|
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="3,10">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QGroupBox" name="groupBox_7">
|
||||||
<x>20</x>
|
<property name="title">
|
||||||
<y>50</y>
|
<string>控制及状态</string>
|
||||||
<width>151</width>
|
|
||||||
<height>81</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>20</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lab_info">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>28</pointsize>
|
<pointsize>28</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>准备中</string>
|
<string>状态</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="btn_start">
|
<widget class="QPushButton" name="btn_start">
|
||||||
<property name="geometry">
|
<property name="minimumSize">
|
||||||
<rect>
|
<size>
|
||||||
<x>20</x>
|
<width>70</width>
|
||||||
<y>130</y>
|
<height>70</height>
|
||||||
<width>101</width>
|
</size>
|
||||||
<height>41</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>开始分选</string>
|
<string>开始分选</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="btn_stop">
|
<widget class="QPushButton" name="btn_stop">
|
||||||
<property name="geometry">
|
<property name="minimumSize">
|
||||||
<rect>
|
<size>
|
||||||
<x>20</x>
|
<width>70</width>
|
||||||
<y>190</y>
|
<height>70</height>
|
||||||
<width>101</width>
|
</size>
|
||||||
<height>41</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>停止分选</string>
|
<string>停止分选</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="camera_1_img">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<spacer name="verticalSpacer">
|
||||||
<x>160</x>
|
<property name="orientation">
|
||||||
<y>290</y>
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
<width>591</width>
|
|
||||||
<height>191</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="sizeHint" stdset="0">
|
||||||
<string notr="true">background-color: rgb(129, 129, 129);
|
<size>
|
||||||
border: 4px solid black;</string>
|
<width>20</width>
|
||||||
</property>
|
<height>40</height>
|
||||||
<property name="lineWidth">
|
</size>
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="label_2">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QGroupBox" name="groupBox_6">
|
||||||
<x>160</x>
|
<property name="title">
|
||||||
<y>270</y>
|
<string>相机显示</string>
|
||||||
<width>141</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,5,0,5">
|
||||||
<string>相机1(高侧/气罐侧)</string>
|
<item>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>160</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>141</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>相机0(低侧/出风口侧)</string>
|
<string>相机0(低侧/出风口侧)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QLabel" name="camera_0_img">
|
<widget class="QLabel" name="camera_0_img">
|
||||||
<property name="geometry">
|
<property name="sizePolicy">
|
||||||
<rect>
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
<x>160</x>
|
<horstretch>0</horstretch>
|
||||||
<y>50</y>
|
<verstretch>0</verstretch>
|
||||||
<width>591</width>
|
</sizepolicy>
|
||||||
<height>191</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(129, 129, 129);
|
<string notr="true">background-color: rgb(129, 129, 129);
|
||||||
@ -366,6 +323,38 @@ border: 4px solid black;</string>
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>相机1(高侧/气罐侧)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="camera_1_img">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">background-color: rgb(129, 129, 129);
|
||||||
|
border: 4px solid black;</string>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_3">
|
<widget class="QWidget" name="tab_3">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -618,6 +607,8 @@ border: 4px solid black;</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user