相机dll调用
This commit is contained in:
+7
-5
@@ -106,9 +106,7 @@ void Widget::setupTopBar(QVBoxLayout *rootLayout)
|
||||
robotStatusLabel = UiHelpers::makeBadge("机器人:未采集", "#607d8b");
|
||||
safetyStatusLabel = UiHelpers::makeBadge("安全回路:未采集", "#607d8b");
|
||||
cameraStatusLabel = UiHelpers::makeBadge(
|
||||
ConfigManager::instance().visionConfig().enabled
|
||||
? "相机:离线" : "相机:未启用",
|
||||
"#607d8b");
|
||||
ConfigManager::instance().visionConfig().enabled ? "相机:离线" : "相机:未启用", "#607d8b");
|
||||
topLayout->addWidget(plcStatusLabel);
|
||||
topLayout->addWidget(robotStatusLabel);
|
||||
topLayout->addWidget(safetyStatusLabel);
|
||||
@@ -221,9 +219,13 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
|
||||
connect(visionService, &VisionService::logMessage, this, [this](const QString &message) {
|
||||
appendLog("生产日志", "视觉引导", "通信/测量", message, "记录");
|
||||
});
|
||||
connect(visionService, &VisionService::avoidanceLog, this,
|
||||
[this](const QString &state, const QString &message) {
|
||||
appendLog("生产日志", "视觉避障", "距离检测", message, state);
|
||||
});
|
||||
connect(visionService, &VisionService::availabilityChanged,
|
||||
this, [this](bool ready, bool, const QString &session) {
|
||||
if (!ConfigManager::instance().visionConfig().enabled) {
|
||||
if (!visionService->isEnabled()) {
|
||||
cameraStatusLabel->setText("相机:未启用");
|
||||
} else if (session.isEmpty()) {
|
||||
cameraStatusLabel->setText("相机:离线");
|
||||
@@ -231,7 +233,7 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
|
||||
cameraStatusLabel->setText(ready ? "相机:就绪" : "相机:在线");
|
||||
}
|
||||
});
|
||||
if (ConfigManager::instance().visionConfig().enabled)
|
||||
if (visionService->isEnabled())
|
||||
QTimer::singleShot(0, visionService, &VisionService::startService);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user