feat(vision): 状态栏增加相机状态

This commit is contained in:
lidg
2026-10-29 11:57:47 +08:00
parent a7af930a0a
commit 31454722a0
9 changed files with 92 additions and 26 deletions
+1 -12
View File
@@ -176,8 +176,6 @@ void RackPage::updateTrayCells(const QList<TraySlot> &traySlots)
const QStringList colors = QStringList()
<< "#90a4ae" << "#f9a825" << "#1e88e5" << "#8e24aa"
<< "#2e7d32" << "#d32f2f" << "#ef6c00";
const QStringList names = QStringList()
<< "空" << "待" << "正检" << "反检" << "OK" << "NG" << "异常";
for (int index = 0; index < trayCells.size(); ++index) {
const int rowNo = index / 7 + 1;
@@ -191,10 +189,8 @@ void RackPage::updateTrayCells(const QList<TraySlot> &traySlots)
}
QString state = "EMPTY";
int workpieceId = 0;
if (slot) {
state = slot->state;
workpieceId = slot->workpieceId;
}
int stateIndex = 0;
@@ -212,14 +208,7 @@ void RackPage::updateTrayCells(const QList<TraySlot> &traySlots)
stateIndex = 6;
}
const QString workpieceText = workpieceId > 0
? QString("工件 %1").arg(workpieceId) : QString();
trayCells.at(index)->setText(QString("%1-%2\n%3%4")
.arg(rowNo)
.arg(columnNo)
.arg(names.at(stateIndex))
.arg(workpieceText.isEmpty() ? QString()
: "\n" + workpieceText));
trayCells.at(index)->setText(QString("%1-%2").arg(rowNo).arg(columnNo));
trayCells.at(index)->setStyleSheet(
QString("QLabel { background: %1; border: 1px solid #ffffff; "
"border-radius: 3px; color: white; font-size: 11px; }")