From d68541dce155a682f65b7c3fbfbfbeef17ea5b8f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 12 五月 2025 12:00:41 +0800
Subject: [PATCH] 1.StoredJob, Fetched out Job实现; 2.CStep增加定制的Attribute, 以便通过的Step不使用getAttributeVector也能添加不一样的Attribute;
---
SourceCode/Bond/Servo/CEquipment.cpp | 142 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 124 insertions(+), 18 deletions(-)
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index fe9cfe6..0bf4132 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -203,48 +203,50 @@
void CEquipment::getAttributeVector(CAttributeVector& attrubutes)
{
attrubutes.clear();
+
+ unsigned int weight = 0;
attrubutes.addAttribute(new CAttribute("Network",
- std::to_string(m_station.nNetNo).c_str(), ""));
+ std::to_string(m_station.nNetNo).c_str(), "", weight++));
attrubutes.addAttribute(new CAttribute("Station",
- std::to_string(m_station.nStNo).c_str(), ""));
+ std::to_string(m_station.nStNo).c_str(), "", weight++));
attrubutes.addAttribute(new CAttribute("ID",
- std::to_string(m_nID).c_str(), ""));
+ std::to_string(m_nID).c_str(), "", weight++));
attrubutes.addAttribute(new CAttribute("Name",
- m_strName.c_str(), ""));
+ m_strName.c_str(), "", weight++));
attrubutes.addAttribute(new CAttribute("Description",
- m_strDescription.c_str(), ""));
+ m_strDescription.c_str(), "", weight++));
attrubutes.addAttribute(new CAttribute("Alive",
- this->isAlive() ? _T("TRUE") : _T("FALSE"), ""));
+ this->isAlive() ? _T("TRUE") : _T("FALSE"), "", weight++));
attrubutes.addAttribute(new CAttribute("CIM State",
- m_bCimState ? _T("ON") : _T("OFF"), ""));
+ m_bCimState ? _T("ON") : _T("OFF"), "", weight++));
attrubutes.addAttribute(new CAttribute("Upstream",
- m_bUpstreamInline ? _T("Inline") : _T("Offline"), ""));
+ m_bUpstreamInline ? _T("Inline") : _T("Offline"), "", weight++));
attrubutes.addAttribute(new CAttribute("Downstream",
- m_bDownstreamInline ? _T("Inline") : _T("Offline"), ""));
+ m_bDownstreamInline ? _T("Inline") : _T("Offline"), "", weight++));
attrubutes.addAttribute(new CAttribute("Local Alarm",
- m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), ""));
+ m_bLocalAlarm ? _T("TRUE") : _T("FALSE"), "", weight++));
attrubutes.addAttribute(new CAttribute("Auto Recipe Change",
- m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), ""));
+ m_bAutoRecipeChange ? _T("TRUE") : _T("FALSE"), "", weight++));
char szTemp[256];
for (int i = 0; i < VCR_MAX; i++) {
sprintf_s(szTemp, 256, "VCR-%d", i + 1);
attrubutes.addAttribute(new CAttribute(szTemp,
- m_bVCREnable[i] ? _T("Enable") : _T("Disable"), ""));
+ m_bVCREnable[i] ? _T("Enable") : _T("Disable"), "", weight++));
}
for (auto item : m_inputPins) {
attrubutes.addAttribute(new CAttribute(item->getName().c_str(),
- std::to_string((int)item->getType()).c_str(), ""));
+ std::to_string((int)item->getType()).c_str(), "", weight++));
}
for (auto item : m_outputPins) {
attrubutes.addAttribute(new CAttribute(item->getName().c_str(),
- std::to_string((int)item->getType()).c_str(), ""));
+ std::to_string((int)item->getType()).c_str(), "", weight++));
}
for (auto item : m_glassList) {
attrubutes.addAttribute(new CAttribute("Glass",
- item->getID().c_str(), ""));
+ item->getID().c_str(), "", weight++));
}
}
@@ -432,6 +434,40 @@
CHECK_READ_STEP_SIGNAL(STEP_ID_RECIVE_JOB_UPS2, pszData, size);
CHECK_READ_STEP_SIGNAL(STEP_ID_SENT_OUT_JOB_DOWNS1, pszData, size);
CHECK_READ_STEP_SIGNAL(STEP_ID_SENT_OUT_JOB_DOWNS2, pszData, size);
+
+ // Store Job Report #1~15
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT1, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT2, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT3, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT4, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT5, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT6, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT7, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT8, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT9, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT10, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT11, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT12, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT13, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT14, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_STORE_JOB_REPORT15, pszData, size);
+
+ // Fetched Out Job Report #1~15
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT1, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT2, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT3, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT4, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT5, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT6, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT7, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT8, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT9, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT10, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT11, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT12, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT13, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT14, pszData, size);
+ CHECK_READ_STEP_SIGNAL(STEP_ID_FETCHED_OUT_JOB_REPORT15, pszData, size);
// CEqCassetteTranserStateStep
@@ -823,7 +859,7 @@
return 0;
}
- int CEquipment::storeJob(const char* pszGlassId)
+ int CEquipment::storedJob(const char* pszGlassId)
{
if (m_pArm == nullptr) {
return -1;
@@ -1025,12 +1061,12 @@
return m_recipesManager.decodeRecipeParameterReport(pszData, size);
}
- int CEquipment::decodeFetchedOutJobReport(int port, const char* pszData, size_t size)
+ int CEquipment::decodeFetchedOutJobReport(CStep* pStep, int port, const char* pszData, size_t size)
{
int index = 0;
short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo;
CJobDataB jobDataB;
- int nRet = jobDataB.unserialize(&pszData[index], size);
+ int nRet = jobDataB.unserialize(&pszData[index], (int)size);
if (nRet < 0) return nRet;
index += nRet;
@@ -1043,6 +1079,25 @@
memcpy(&subSlotNo, &pszData[index], sizeof(short));
index += sizeof(short);
+
+ // 缓存Attribute,用于调试时显示信息
+ unsigned int weight = 201;
+ pStep->addAttribute(new CAttribute("UnitOrPort",
+ std::to_string(unitOrPort).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("UnitOrPortNo",
+ std::to_string(unitOrPortNo).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("SubUnitNo",
+ std::to_string(subUnitNo).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("SubSlotNo",
+ std::to_string(subSlotNo).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("CassetteSequenceNo",
+ std::to_string(jobDataB.getCassetteSequenceNo()).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("JobSequenceNo",
+ std::to_string(jobDataB.getJobSequenceNo()).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("GlassId",
+ jobDataB.getGlassId().c_str(), "", weight++));
+
+
onFetchedOut(port, jobDataB.getGlassId().c_str());
return index;
@@ -1050,6 +1105,57 @@
int CEquipment::onFetchedOut(int port, const char* pszGlassId)
{
+ LOGI("<CEquipment-%s>onFetchedOut:port:%d|GlassId:%s",
+ m_strName.c_str(), port, pszGlassId);
return fetchedOut(pszGlassId);
}
+
+ int CEquipment::decodeStoredJobReport(CStep* pStep, int port, const char* pszData, size_t size)
+ {
+ int index = 0;
+ short unitOrPort, unitOrPortNo, subUnitNo, subSlotNo;
+ CJobDataB jobDataB;
+ int nRet = jobDataB.unserialize(&pszData[index], (int)size);
+ if (nRet < 0) return nRet;
+ index += nRet;
+
+ memcpy(&unitOrPort, &pszData[index], sizeof(short));
+ index += sizeof(short);
+ memcpy(&unitOrPortNo, &pszData[index], sizeof(short));
+ index += sizeof(short);
+ memcpy(&subUnitNo, &pszData[index], sizeof(short));
+ index += sizeof(short);
+ memcpy(&subSlotNo, &pszData[index], sizeof(short));
+ index += sizeof(short);
+
+
+ // 缓存Attribute,用于调试时显示信息
+ unsigned int weight = 201;
+ pStep->addAttribute(new CAttribute("UnitOrPort",
+ std::to_string(unitOrPort).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("UnitOrPortNo",
+ std::to_string(unitOrPortNo).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("SubUnitNo",
+ std::to_string(subUnitNo).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("SubSlotNo",
+ std::to_string(subSlotNo).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("CassetteSequenceNo",
+ std::to_string(jobDataB.getCassetteSequenceNo()).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("JobSequenceNo",
+ std::to_string(jobDataB.getJobSequenceNo()).c_str(), "", weight++));
+ pStep->addAttribute(new CAttribute("GlassId",
+ jobDataB.getGlassId().c_str(), "", weight++));
+
+
+ onStore(port, jobDataB.getGlassId().c_str());
+
+ return index;
+ }
+
+ int CEquipment::onStore(int port, const char* pszGlassId)
+ {
+ LOGI("<CEquipment-%s>onStore:port:%d|GlassId:%s",
+ m_strName.c_str(), port, pszGlassId);
+ return storedJob(pszGlassId);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3