添加管控软件和相机的通讯
This commit is contained in:
+16
-1
@@ -8,7 +8,10 @@
|
||||
#include "pages/qualitypage.h"
|
||||
#include "pages/rackpage.h"
|
||||
#include "pages/uihelpers.h"
|
||||
#include "pages/visionpage.h"
|
||||
#include "services/logservice.h"
|
||||
#include "services/visionservice.h"
|
||||
#include "config/configmanager.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFrame>
|
||||
@@ -26,6 +29,8 @@ Widget::Widget(QWidget *parent)
|
||||
, dashboardPage(nullptr)
|
||||
, logPage(nullptr)
|
||||
, qualityPage(nullptr)
|
||||
, visionService(nullptr)
|
||||
, visionPage(nullptr)
|
||||
, systemStateLabel(nullptr)
|
||||
, currentOrderLabel(nullptr)
|
||||
, currentWorkpieceLabel(nullptr)
|
||||
@@ -51,6 +56,7 @@ Widget::Widget(QWidget *parent)
|
||||
|
||||
Widget::~Widget()
|
||||
{
|
||||
if (visionService) visionService->shutdown();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -113,7 +119,7 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
|
||||
navList = new QListWidget;
|
||||
navList->setFixedWidth(170);
|
||||
navList->addItems(QStringList() << "控制面板" << "订单管理" << "料架/托盘"
|
||||
<< "设备状态" << "日志" << "质量管理");
|
||||
<< "设备状态" << "日志" << "质量管理" << "视觉引导");
|
||||
navList->setCurrentRow(0);
|
||||
bodyLayout->addWidget(navList);
|
||||
|
||||
@@ -123,6 +129,11 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
|
||||
DevicePage *devicePage = new DevicePage(this);
|
||||
logPage = new LogPage(this);
|
||||
qualityPage = new QualityPage(this);
|
||||
visionService = new VisionService(ConfigManager::instance().visionConfig(), this);
|
||||
visionPage = new VisionPage(visionService, this);
|
||||
connect(dashboardPage, &DashboardPage::visionCycleChanged, visionPage, &VisionPage::updateCycle);
|
||||
connect(dashboardPage, &DashboardPage::visionProductionActiveChanged, visionPage, &VisionPage::setProductionActive);
|
||||
dashboardPage->attachVisionService(visionService);
|
||||
|
||||
pageStack = new QStackedWidget;
|
||||
pageStack->addWidget(dashboardPage);
|
||||
@@ -131,6 +142,7 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
|
||||
pageStack->addWidget(devicePage);
|
||||
pageStack->addWidget(logPage);
|
||||
pageStack->addWidget(qualityPage);
|
||||
pageStack->addWidget(visionPage);
|
||||
bodyLayout->addWidget(pageStack, 1);
|
||||
|
||||
rootLayout->addLayout(bodyLayout, 1);
|
||||
@@ -169,6 +181,9 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
|
||||
connect(dashboardPage, &DashboardPage::logRequested, this, &Widget::appendLog);
|
||||
connect(orderPage, &OrderPage::logRequested, this, &Widget::appendLog);
|
||||
connect(rackPage, &RackPage::logRequested, this, &Widget::appendLog);
|
||||
connect(visionService, &VisionService::logMessage, this, [this](const QString &message) {
|
||||
appendLog("生产日志", "视觉引导", "通信/测量", message, "记录");
|
||||
});
|
||||
}
|
||||
|
||||
void Widget::appendLog(const QString &type, const QString &module, const QString &action,
|
||||
|
||||
Reference in New Issue
Block a user