From 9fbd7479ce17f76f72cc0e5a675336261ec76472 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 12 五月 2025 15:39:53 +0800
Subject: [PATCH] 1.使用CEqReadStep替换CEqJobEventStep, 实现ReceivedJob 2.实现SentOutJob
---
SourceCode/Bond/Servo/CEquipment.cpp | 64 ++++++++++++++++++++++++++++---
1 files changed, 57 insertions(+), 7 deletions(-)
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 0bf4132..3b15620 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -822,7 +822,7 @@
return pGlass;
}
- int CEquipment::fetchedOut(const char* pszGlassId)
+ int CEquipment::fetchedOutJob(const char* pszGlassId)
{
if (m_pArm == nullptr) {
return -1;
@@ -1061,6 +1061,56 @@
return m_recipesManager.decodeRecipeParameterReport(pszData, size);
}
+ int CEquipment::decodeReceivedJobReport(CStep* pStep, int port, const char* pszData, size_t size)
+ {
+ CJobDataS jobDataS;
+ int nRet = jobDataS.unserialize(&pszData[0], (int)size);
+ if (nRet < 0) return nRet;
+
+ // 缓存Attribute,用于调试时显示信息
+ unsigned int weight = 201;
+ CAttributeVector attrubutes;
+ jobDataS.getAttributeVector(attrubutes, weight);
+ pStep->addAttributeVector(attrubutes);
+
+
+ onReceivedJob(port, &jobDataS);
+
+ return nRet;
+ }
+
+ int CEquipment::onReceivedJob(int port, CJobDataS* pJobDataS)
+ {
+ LOGI("<CEquipment-%s>onReceivedJob.", m_strName.c_str());
+ // return fetchedOutJob(pszGlassId);
+ return 0;
+ }
+
+ int CEquipment::decodeSentOutJobReport(CStep* pStep, int port, const char* pszData, size_t size)
+ {
+ CJobDataS jobDataS;
+ int nRet = jobDataS.unserialize(&pszData[0], (int)size);
+ if (nRet < 0) return nRet;
+
+ // 缓存Attribute,用于调试时显示信息
+ unsigned int weight = 201;
+ CAttributeVector attrubutes;
+ jobDataS.getAttributeVector(attrubutes, weight);
+ pStep->addAttributeVector(attrubutes);
+
+
+ onReceivedJob(port, &jobDataS);
+
+ return nRet;
+ }
+
+ int CEquipment::onSentOutJob(int port, CJobDataS* pJobDataS)
+ {
+ LOGI("<CEquipment-%s>onSentOutJob.", m_strName.c_str());
+ // return fetchedOutJob(pszGlassId);
+ return 0;
+ }
+
int CEquipment::decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size)
{
int index = 0;
@@ -1098,16 +1148,16 @@
jobDataB.getGlassId().c_str(), "", weight++));
- onFetchedOut(port, jobDataB.getGlassId().c_str());
+ onFetchedOutJob(port, jobDataB.getGlassId().c_str());
return index;
}
- int CEquipment::onFetchedOut(int port, const char* pszGlassId)
+ int CEquipment::onFetchedOutJob(int port, const char* pszGlassId)
{
- LOGI("<CEquipment-%s>onFetchedOut:port:%d|GlassId:%s",
+ LOGI("<CEquipment-%s>onFetchedOutJob:port:%d|GlassId:%s",
m_strName.c_str(), port, pszGlassId);
- return fetchedOut(pszGlassId);
+ return fetchedOutJob(pszGlassId);
}
int CEquipment::decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size)
@@ -1147,12 +1197,12 @@
jobDataB.getGlassId().c_str(), "", weight++));
- onStore(port, jobDataB.getGlassId().c_str());
+ onStoreJob(port, jobDataB.getGlassId().c_str());
return index;
}
- int CEquipment::onStore(int port, const char* pszGlassId)
+ int CEquipment::onStoreJob(int port, const char* pszGlassId)
{
LOGI("<CEquipment-%s>onStore:port:%d|GlassId:%s",
m_strName.c_str(), port, pszGlassId);
--
Gitblit v1.9.3