From bc7f1c4e028e69be51079b59dae4ae5c4d43f5bb Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 31 一月 2026 21:54:56 +0800
Subject: [PATCH] 1.状态指示图,目前灰色表示掉线,绿色表示在线。增加Slot的小点表示有没有料,及加工状态 。 2.增加图示
---
SourceCode/Bond/Servo/CEquipment.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index e4085e9..599a79c 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -208,6 +208,21 @@
return m_strDescription;
}
+ void CEquipment::setCurrentRecipe(const std::string& recipe)
+ {
+ Lock();
+ m_currentRecipe = recipe;
+ Unlock();
+ }
+
+ std::string CEquipment::getCurrentRecipe()
+ {
+ Lock();
+ std::string out = m_currentRecipe;
+ Unlock();
+ return out;
+ }
+
void CEquipment::setStation(int network, int station)
{
m_station.nNetNo = network;
@@ -762,6 +777,16 @@
pEqAlarmStep->getAlarmLevel());
}
+ return 1;
+ }
+ else if (pStep->getName().compare(STEP_STATUS) == 0) {
+ SERVO::CEqStatusStep* pEqStatusStep = (SERVO::CEqStatusStep*)pStep;
+ if (m_listener.onEqStatusChanged != nullptr) {
+ const unsigned int unitId = pEqStatusStep->getUnitId();
+ const int status = pEqStatusStep->getStatus(unitId);
+ const int reason = pEqStatusStep->getReasonCode(unitId);
+ m_listener.onEqStatusChanged(this, (int)unitId, status, reason);
+ }
return 1;
}
else if (isCimMessageConfirmStep(pStep)) {
@@ -1608,8 +1633,11 @@
std::vector<CParam> tempParams;
this->parsingProcessData((const char*)rawData.data(), rawData.size(), tempParams);
int n = processData.getTotalParameter();
- std::vector<CParam> params(tempParams.begin(), tempParams.begin() + min(n, (int)tempParams.size()));
+ std::vector<CParam> params(tempParams.begin(), tempParams.begin() + (std::min)(n, (int)tempParams.size()));
pGlass->addParams(params);
+ if (m_listener.onProcessDataReport != nullptr) {
+ m_listener.onProcessDataReport(this, params);
+ }
// 鍏宠仈鐨凣lass涔熻鏇存柊
CGlass* pBuddy = pGlass->getBuddy();
@@ -1617,6 +1645,9 @@
if (pBuddy != nullptr) {
LOGI("<Equipment-%s>decodeProcessDataReport addParams pBuddy=%x %s", getName().c_str(), pBuddy, pGlass->getID().c_str());
pBuddy->addParams(params);
+ if (m_listener.onProcessDataReport != nullptr) {
+ m_listener.onProcessDataReport(this, params);
+ }
}
return nRet;
@@ -1649,6 +1680,10 @@
m_strName.c_str(), nRet);
}
+ if (m_listener.onReceivedJob != nullptr) {
+ m_listener.onReceivedJob(this, port, pJobDataS);
+ }
+
return nRet;
}
@@ -1670,6 +1705,10 @@
int CEquipment::onSentOutJob(int port, CJobDataS* pJobDataS)
{
LOGI("<CEquipment-%s>onSentOutJob.", m_strName.c_str());
+
+ if (m_listener.onSentOutJob != nullptr) {
+ m_listener.onSentOutJob(this, port, pJobDataS);
+ }
return 0;
}
@@ -1864,7 +1903,9 @@
CSVData svData;
int nRet = svData.unserialize(&pszData[0], (int)size);
if (nRet < 0) return nRet;
+ Lock();
m_svDatas.push_back(svData);
+ Unlock();
if (m_listener.onSVDataReport != nullptr) {
m_listener.onSVDataReport(this, &svData);
@@ -2258,6 +2299,14 @@
}
}
+ PROCESS_STATE CEquipment::getProcessState(int slotNo) const
+ {
+ if (slotNo <= 0 || slotNo > SLOT_MAX) {
+ return PROCESS_STATE::Ready;
+ }
+ return m_processState[slotNo - 1];
+ }
+
std::vector<SERVO::CSVData>& CEquipment::getSVDatas()
{
return m_svDatas;
--
Gitblit v1.9.3