fix(dashboard): 显示问题修改
-PLC-未采集、机器人-未采集、安全回路-未采集 问题修改 -生成工件,成功后添加弹出提示生成成功
This commit is contained in:
+11
-8
@@ -19,18 +19,21 @@ reconnectDelayMs=200
|
||||
reconnectAttempts=2
|
||||
|
||||
; Coils
|
||||
clearAlarmCommand=3
|
||||
plcReady=100
|
||||
robotReady=101
|
||||
safetyDoorClosed=102
|
||||
emergencyStop=103
|
||||
clearAlarmCommand=815
|
||||
plcRunning=817
|
||||
safetyDoorClosed=826
|
||||
safetyDoor1Closed=827
|
||||
safetyDoor2Closed=828
|
||||
safetyDoor3Closed=829
|
||||
emergencyStop=830
|
||||
robotIdle=832
|
||||
robotRunning=833
|
||||
robotAlarm=834
|
||||
plcReady=835
|
||||
inspectionMachineReady=500
|
||||
visionReady=501
|
||||
robotControlCabinetReady=502
|
||||
mainControlCabinetReady=503
|
||||
safetyDoor1Closed=504
|
||||
safetyDoor2Closed=505
|
||||
safetyDoor3Closed=506
|
||||
activeAlarm=507
|
||||
currentStep=200
|
||||
checkResult=201
|
||||
|
||||
@@ -85,8 +85,11 @@ bool ConfigManager::load(const QString &filePath)
|
||||
|
||||
ModbusAddressMap &addresses = m_modbusConfig.addressMap;
|
||||
addresses.clearAlarmCommand = settings.value("modbus/clearAlarmCommand", addresses.clearAlarmCommand).toInt();
|
||||
addresses.plcRunning = settings.value("modbus/plcRunning", addresses.plcRunning).toInt();
|
||||
addresses.plcReady = settings.value("modbus/plcReady", addresses.plcReady).toInt();
|
||||
addresses.robotReady = settings.value("modbus/robotReady", addresses.robotReady).toInt();
|
||||
addresses.robotIdle = settings.value("modbus/robotIdle", addresses.robotIdle).toInt();
|
||||
addresses.robotRunning = settings.value("modbus/robotRunning", addresses.robotRunning).toInt();
|
||||
addresses.robotAlarm = settings.value("modbus/robotAlarm", addresses.robotAlarm).toInt();
|
||||
addresses.safetyDoorClosed = settings.value("modbus/safetyDoorClosed", addresses.safetyDoorClosed).toInt();
|
||||
addresses.emergencyStop = settings.value("modbus/emergencyStop", addresses.emergencyStop).toInt();
|
||||
addresses.inspectionMachineReady =
|
||||
|
||||
@@ -17,8 +17,11 @@ bool ModbusAddressMap::isValid(QString *error) const
|
||||
{
|
||||
const QList<QPair<QString, int> > coilAddresses = QList<QPair<QString, int> >()
|
||||
<< qMakePair(QString("clearAlarmCommand"), clearAlarmCommand)
|
||||
<< qMakePair(QString("plcRunning"), plcRunning)
|
||||
<< qMakePair(QString("plcReady"), plcReady)
|
||||
<< qMakePair(QString("robotReady"), robotReady)
|
||||
<< qMakePair(QString("robotIdle"), robotIdle)
|
||||
<< qMakePair(QString("robotRunning"), robotRunning)
|
||||
<< qMakePair(QString("robotAlarm"), robotAlarm)
|
||||
<< qMakePair(QString("safetyDoorClosed"), safetyDoorClosed)
|
||||
<< qMakePair(QString("emergencyStop"), emergencyStop)
|
||||
<< qMakePair(QString("inspectionMachineReady"), inspectionMachineReady)
|
||||
|
||||
+10
-7
@@ -7,10 +7,16 @@ struct ModbusAddressMap
|
||||
{
|
||||
int clearAlarmCommand = 3;
|
||||
|
||||
int plcReady = 100;
|
||||
int robotReady = 101;
|
||||
int safetyDoorClosed = 102;
|
||||
int emergencyStop = 103;
|
||||
int plcRunning = 817;
|
||||
int safetyDoorClosed = 826;
|
||||
int safetyDoor1Closed = 827;
|
||||
int safetyDoor2Closed = 828;
|
||||
int safetyDoor3Closed = 829;
|
||||
int emergencyStop = 830;
|
||||
int robotIdle = 832;
|
||||
int robotRunning = 833;
|
||||
int robotAlarm = 834;
|
||||
int plcReady = 835;
|
||||
|
||||
// Additional device status coils. Replace these placeholders with the
|
||||
// approved PLC point table before commissioning.
|
||||
@@ -18,9 +24,6 @@ struct ModbusAddressMap
|
||||
int visionReady = 501;
|
||||
int robotControlCabinetReady = 502;
|
||||
int mainControlCabinetReady = 503;
|
||||
int safetyDoor1Closed = 504;
|
||||
int safetyDoor2Closed = 505;
|
||||
int safetyDoor3Closed = 506;
|
||||
int activeAlarm = 507;
|
||||
|
||||
int currentStep = 200;
|
||||
|
||||
+19
-11
@@ -1153,20 +1153,25 @@ void DashboardPage::updateCurrentProcessDuration(int elapsedMs)
|
||||
void DashboardPage::onDeviceStatusChanged(const DeviceStatus &status)
|
||||
{
|
||||
emit deviceStatusChanged(status);
|
||||
const QString plcText = boolStatus(status.statusValid,
|
||||
status.plcReady, "就绪", "未就绪");
|
||||
const QString robotText = boolStatus(status.statusValid,
|
||||
status.robotReady, "就绪", "未就绪");
|
||||
const QString safetyText = !status.statusValid ? "未采集"
|
||||
const bool offline = !status.statusValid || !status.plcConnected;
|
||||
const QString plcText = offline ? "离线"
|
||||
: status.plcRunning ? "运行中"
|
||||
: status.plcReady ? "就绪" : "未就绪";
|
||||
const QString robotText = offline ? "离线"
|
||||
: status.emergencyStop ? "急停"
|
||||
: status.robotAlarm ? "报警"
|
||||
: status.robotRunning ? "运行中"
|
||||
: status.robotIdle ? "空闲" : "未就绪";
|
||||
const QString safetyText = offline ? "离线"
|
||||
: status.safetyDoorClosed ? "正常" : "异常";
|
||||
const QString emergencyText = offline ? "离线"
|
||||
: status.emergencyStop ? "已触发" : "正常";
|
||||
deviceStatusLabel->setText(
|
||||
QString("PLC:%1 | 机器人:%2 | 安全回路:%3 | 急停:%4")
|
||||
.arg(!status.statusValid ? "未采集"
|
||||
: status.plcConnected ? "在线" : "离线")
|
||||
.arg(plcText)
|
||||
.arg(robotText)
|
||||
.arg(safetyText)
|
||||
.arg(boolStatus(status.statusValid, status.emergencyStop,
|
||||
"已触发", "正常")));
|
||||
.arg(emergencyText));
|
||||
|
||||
updateStatusCell(inspectionMachineCell,
|
||||
QString("检测机\n%1").arg(boolStatus(
|
||||
@@ -1176,8 +1181,11 @@ void DashboardPage::onDeviceStatusChanged(const DeviceStatus &status)
|
||||
: status.inspectionMachineReady ? "#2e7d32" : "#d32f2f");
|
||||
updateStatusCell(robotCell,
|
||||
QString("机器人\n%1").arg(robotText),
|
||||
!status.statusValid ? "#607d8b"
|
||||
: status.robotReady ? "#2e7d32" : "#d32f2f");
|
||||
offline ? "#607d8b"
|
||||
: status.emergencyStop || status.robotAlarm
|
||||
? "#d32f2f"
|
||||
: status.robotRunning || status.robotIdle
|
||||
? "#2e7d32" : "#d32f2f");
|
||||
updateStatusCell(robotControlCabinetCell,
|
||||
QString("机器人控制柜\n%1").arg(boolStatus(
|
||||
status.statusValid, status.robotControlCabinetReady,
|
||||
|
||||
+20
-12
@@ -67,19 +67,23 @@ void DevicePage::setRow(int row, const QStringList &values)
|
||||
|
||||
void DevicePage::updateStatus(const DeviceStatus &status)
|
||||
{
|
||||
communicationErrorLabel->setText(status.statusValid
|
||||
const bool offline = !status.statusValid || !status.plcConnected;
|
||||
communicationErrorLabel->setText(!offline
|
||||
? "通信状态:PLC 在线"
|
||||
: "通信状态:PLC 状态未采集");
|
||||
communicationErrorLabel->setStyleSheet(status.statusValid
|
||||
: "通信状态:PLC 离线");
|
||||
communicationErrorLabel->setStyleSheet(!offline
|
||||
? "color: #2e7d32; padding: 4px 0;"
|
||||
: "color: #d32f2f; padding: 4px 0;");
|
||||
|
||||
const QString connection = !status.statusValid
|
||||
? "未采集" : status.plcConnected ? "在线" : "离线";
|
||||
const QString plcState = !status.statusValid
|
||||
? "未知" : status.plcReady ? "就绪" : "未就绪";
|
||||
const QString robotState = !status.statusValid
|
||||
? "未知" : status.robotReady ? "就绪" : "未就绪";
|
||||
const QString connection = offline ? "离线" : "在线";
|
||||
const QString plcState = offline ? "离线"
|
||||
: status.plcRunning ? "运行中"
|
||||
: status.plcReady ? "就绪" : "未就绪";
|
||||
const QString robotState = offline ? "离线"
|
||||
: status.emergencyStop ? "急停"
|
||||
: status.robotAlarm ? "报警"
|
||||
: status.robotRunning ? "运行中"
|
||||
: status.robotIdle ? "空闲" : "未就绪";
|
||||
const QString inspectionState = !status.statusValid
|
||||
? "未知" : status.inspectionMachineReady ? "就绪" : "未就绪";
|
||||
const QString visionState = !status.statusValid
|
||||
@@ -101,10 +105,14 @@ void DevicePage::updateStatus(const DeviceStatus &status)
|
||||
const QString now = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
setRow(0, QStringList() << "PLC" << connection << plcState
|
||||
<< QString("PLC 步骤 %1").arg(status.currentStep) << now);
|
||||
<< (offline ? "未知"
|
||||
: QString("PLC 步骤 %1").arg(status.currentStep)) << now);
|
||||
setRow(1, QStringList() << "上下料机器人" << connection << robotState
|
||||
<< (!status.statusValid ? "未知"
|
||||
: status.robotReady ? "等待动作" : "等待就绪") << now);
|
||||
<< (offline ? "未知"
|
||||
: status.emergencyStop ? "急停已触发"
|
||||
: status.robotAlarm ? "请处理机器人报警"
|
||||
: status.robotRunning ? "执行中"
|
||||
: status.robotIdle ? "等待动作" : "等待就绪") << now);
|
||||
setRow(2, QStringList() << "检测机" << connection
|
||||
<< inspectionState
|
||||
<< (!status.statusValid ? "未知" : "等待检测") << now);
|
||||
|
||||
@@ -286,6 +286,7 @@ void OrderPage::generateSelectedWorkpieces()
|
||||
emit productionDataChanged();
|
||||
emit logRequested("操作日志", "订单管理", "生成工件",
|
||||
"生成并分配订单 " + orderNo + " 的工件", "成功");
|
||||
QMessageBox::information(this, "生成工件", "生成成功");
|
||||
}
|
||||
|
||||
void OrderPage::deleteSelectedOrder()
|
||||
|
||||
+84
-64
@@ -162,14 +162,7 @@ void DeviceService::finishStatusRequest(bool success,
|
||||
{
|
||||
DeviceStatus finalStatus = status;
|
||||
finalStatus.statusValid = success;
|
||||
// PLC communication establishes readiness; M100 is not a production interlock.
|
||||
finalStatus.plcReady = success && finalStatus.plcConnected;
|
||||
if (success) {
|
||||
finalStatus.safetyDoorClosed = finalStatus.safetyDoorClosed
|
||||
&& finalStatus.safetyDoor1Closed
|
||||
&& finalStatus.safetyDoor2Closed
|
||||
&& finalStatus.safetyDoor3Closed;
|
||||
}
|
||||
finalStatus.plcConnected = success;
|
||||
|
||||
m_statusRequestPending = false;
|
||||
const QList<StatusCallback> callbacks = m_statusCallbacks;
|
||||
@@ -189,7 +182,7 @@ void DeviceService::readStatusStep(int index, const DeviceStatus &status)
|
||||
{
|
||||
const bool useErrorCode =
|
||||
ConfigManager::instance().productionConfig().usePlcErrorCode;
|
||||
if (index >= (useErrorCode ? 15 : 14)) {
|
||||
if (index >= (useErrorCode ? 19 : 18)) {
|
||||
finishStatusRequest(true, status, QString());
|
||||
return;
|
||||
}
|
||||
@@ -211,20 +204,24 @@ void DeviceService::readStatusStep(int index, const DeviceStatus &status)
|
||||
|
||||
DeviceStatus nextStatus = status;
|
||||
switch (index) {
|
||||
case 1: nextStatus.robotReady = value != 0; break;
|
||||
case 1: nextStatus.plcRunning = value != 0; break;
|
||||
case 2: nextStatus.safetyDoorClosed = value != 0; break;
|
||||
case 3: nextStatus.emergencyStop = value != 0; break;
|
||||
case 4: nextStatus.inspectionMachineReady = value != 0; break;
|
||||
case 5: nextStatus.visionReady = value != 0; break;
|
||||
case 6: nextStatus.robotControlCabinetReady = value != 0; break;
|
||||
case 7: nextStatus.mainControlCabinetReady = value != 0; break;
|
||||
case 8: nextStatus.safetyDoor1Closed = value != 0; break;
|
||||
case 9: nextStatus.safetyDoor2Closed = value != 0; break;
|
||||
case 10: nextStatus.safetyDoor3Closed = value != 0; break;
|
||||
case 11: nextStatus.activeAlarm = value != 0; break;
|
||||
case 12: nextStatus.currentStep = value; break;
|
||||
case 13: nextStatus.checkResult = value; break;
|
||||
case 14: nextStatus.errorCode = value; break;
|
||||
case 3: nextStatus.safetyDoor1Closed = value != 0; break;
|
||||
case 4: nextStatus.safetyDoor2Closed = value != 0; break;
|
||||
case 5: nextStatus.safetyDoor3Closed = value != 0; break;
|
||||
case 6: nextStatus.emergencyStop = value != 0; break;
|
||||
case 7: nextStatus.robotIdle = value != 0; break;
|
||||
case 8: nextStatus.robotRunning = value != 0; break;
|
||||
case 9: nextStatus.robotAlarm = value != 0; break;
|
||||
case 10: nextStatus.plcReady = value != 0; break;
|
||||
case 11: nextStatus.inspectionMachineReady = value != 0; break;
|
||||
case 12: nextStatus.visionReady = value != 0; break;
|
||||
case 13: nextStatus.robotControlCabinetReady = value != 0; break;
|
||||
case 14: nextStatus.mainControlCabinetReady = value != 0; break;
|
||||
case 15: nextStatus.activeAlarm = value != 0; break;
|
||||
case 16: nextStatus.currentStep = value; break;
|
||||
case 17: nextStatus.checkResult = value; break;
|
||||
case 18: nextStatus.errorCode = value; break;
|
||||
default: break;
|
||||
}
|
||||
readStatusStep(index + 1, nextStatus);
|
||||
@@ -233,7 +230,7 @@ void DeviceService::readStatusStep(int index, const DeviceStatus &status)
|
||||
const ModbusAddressMap &addresses = m_modbus->config().addressMap;
|
||||
switch (index) {
|
||||
case 1:
|
||||
m_modbus->readCoil(addresses.robotReady,
|
||||
m_modbus->readCoil(addresses.plcRunning,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
@@ -245,71 +242,91 @@ void DeviceService::readStatusStep(int index, const DeviceStatus &status)
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
m_modbus->readCoil(addresses.emergencyStop,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
m_modbus->readCoil(addresses.inspectionMachineReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 5:
|
||||
m_modbus->readCoil(addresses.visionReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 6:
|
||||
m_modbus->readCoil(addresses.robotControlCabinetReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 7:
|
||||
m_modbus->readCoil(addresses.mainControlCabinetReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 8:
|
||||
m_modbus->readCoil(addresses.safetyDoor1Closed,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 9:
|
||||
case 4:
|
||||
m_modbus->readCoil(addresses.safetyDoor2Closed,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 10:
|
||||
case 5:
|
||||
m_modbus->readCoil(addresses.safetyDoor3Closed,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 6:
|
||||
m_modbus->readCoil(addresses.emergencyStop,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 7:
|
||||
m_modbus->readCoil(addresses.robotIdle,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 8:
|
||||
m_modbus->readCoil(addresses.robotRunning,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 9:
|
||||
m_modbus->readCoil(addresses.robotAlarm,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 10:
|
||||
m_modbus->readCoil(addresses.plcReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 11:
|
||||
m_modbus->readCoil(addresses.activeAlarm,
|
||||
m_modbus->readCoil(addresses.inspectionMachineReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 12:
|
||||
m_modbus->readHoldingRegister(addresses.currentStep, next);
|
||||
m_modbus->readCoil(addresses.visionReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 13:
|
||||
m_modbus->readHoldingRegister(addresses.checkResult, next);
|
||||
m_modbus->readCoil(addresses.robotControlCabinetReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 14:
|
||||
if (useErrorCode) {
|
||||
m_modbus->readHoldingRegister(addresses.errorCode, next);
|
||||
} else {
|
||||
finishStatusRequest(true, status, QString());
|
||||
}
|
||||
m_modbus->readCoil(addresses.mainControlCabinetReady,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 15:
|
||||
m_modbus->readCoil(addresses.activeAlarm,
|
||||
[next](bool ok, bool value, const QString &error) {
|
||||
next(ok, value ? 1 : 0, error);
|
||||
});
|
||||
break;
|
||||
case 16:
|
||||
m_modbus->readHoldingRegister(addresses.currentStep, next);
|
||||
break;
|
||||
case 17:
|
||||
m_modbus->readHoldingRegister(addresses.checkResult, next);
|
||||
break;
|
||||
case 18:
|
||||
m_modbus->readHoldingRegister(addresses.errorCode, next);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -334,7 +351,10 @@ DeviceStatus DeviceService::simulatedStatus() const
|
||||
status.statusValid = true;
|
||||
status.plcConnected = true;
|
||||
status.plcReady = true;
|
||||
status.robotReady = true;
|
||||
status.plcRunning = false;
|
||||
status.robotIdle = true;
|
||||
status.robotRunning = false;
|
||||
status.robotAlarm = false;
|
||||
status.safetyDoorClosed = true;
|
||||
status.emergencyStop = false;
|
||||
status.inspectionMachineReady = true;
|
||||
|
||||
@@ -14,7 +14,10 @@ struct DeviceStatus
|
||||
bool statusValid = false;
|
||||
bool plcConnected = false;
|
||||
bool plcReady = false;
|
||||
bool robotReady = false;
|
||||
bool plcRunning = false;
|
||||
bool robotIdle = false;
|
||||
bool robotRunning = false;
|
||||
bool robotAlarm = false;
|
||||
bool safetyDoorClosed = false;
|
||||
bool emergencyStop = false;
|
||||
bool inspectionMachineReady = false;
|
||||
|
||||
@@ -3496,7 +3496,7 @@ void ProductionService::persistDeviceStatus(const DeviceStatus &status)
|
||||
QString persistenceError;
|
||||
if (!ProductionRepository().insertDeviceStatus(
|
||||
"PLC", status.plcConnected, status.plcReady,
|
||||
status.robotReady, status.safetyDoorClosed,
|
||||
status.robotIdle, status.safetyDoorClosed,
|
||||
status.emergencyStop, status.currentStep,
|
||||
status.checkResult, status.errorCode, &persistenceError)) {
|
||||
qWarning() << "Failed to persist device status:" << persistenceError;
|
||||
@@ -3574,7 +3574,10 @@ void ProductionService::onDeviceStatusChanged(const DeviceStatus &status)
|
||||
|| status.statusValid != m_deviceStatus.statusValid
|
||||
|| status.plcConnected != m_deviceStatus.plcConnected
|
||||
|| status.plcReady != m_deviceStatus.plcReady
|
||||
|| status.robotReady != m_deviceStatus.robotReady
|
||||
|| status.plcRunning != m_deviceStatus.plcRunning
|
||||
|| status.robotIdle != m_deviceStatus.robotIdle
|
||||
|| status.robotRunning != m_deviceStatus.robotRunning
|
||||
|| status.robotAlarm != m_deviceStatus.robotAlarm
|
||||
|| status.safetyDoorClosed != m_deviceStatus.safetyDoorClosed
|
||||
|| status.emergencyStop != m_deviceStatus.emergencyStop
|
||||
|| status.inspectionMachineReady != m_deviceStatus.inspectionMachineReady
|
||||
|
||||
+11
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user