fix(dashboard): 显示问题修改

-PLC-未采集、机器人-未采集、安全回路-未采集 问题修改
-生成工件,成功后添加弹出提示生成成功
This commit is contained in:
lidg
2026-11-09 17:25:14 +08:00
parent 089d91f323
commit a8b2b31ce7
11 changed files with 173 additions and 113 deletions
+11 -6
View File
@@ -178,12 +178,17 @@ void Widget::setupMainArea(QVBoxLayout *rootLayout)
devicePage, &DevicePage::updateStatus);
connect(dashboardPage, &DashboardPage::deviceStatusChanged,
this, [this](const DeviceStatus &status) {
const QString plc = !status.statusValid ? "未采集"
: status.plcConnected ? "在线" : "离线";
const QString robot = !status.statusValid ? "未采集"
: status.robotReady ? "就绪" : "未就绪";
const QString safety = !status.statusValid ? "未采集"
: status.safetyDoorClosed && !status.emergencyStop ? "正常" : "异常";
const bool offline = !status.statusValid || !status.plcConnected;
const QString plc = offline ? "离线"
: status.plcRunning ? "运行中"
: status.plcReady ? "就绪" : "未就绪";
const QString robot = offline ? "离线"
: status.emergencyStop ? "急停"
: status.robotAlarm ? "报警"
: status.robotRunning ? "运行中"
: status.robotIdle ? "空闲" : "未就绪";
const QString safety = offline ? "离线"
: status.safetyDoorClosed ? "正常" : "异常";
plcStatusLabel->setText("PLC:" + plc);
robotStatusLabel->setText("机器人:" + robot);
safetyStatusLabel->setText("安全回路:" + safety);