From 436f0ab66f5eded4367e61edb46edcab57b5787b Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 05 六月 2025 14:07:53 +0800
Subject: [PATCH] 1.Path增加Unit,因为BakeCooling比较特殊,它分为烧烤笔冷却,相当于两单元
---
SourceCode/Bond/Servo/CPath.h | 8 ++-
SourceCode/Bond/Servo/CGlass.cpp | 29 ++++----------
SourceCode/Bond/Servo/CBakeCooling.h | 1
SourceCode/Bond/Servo/CEquipment.cpp | 12 ++----
SourceCode/Bond/Servo/CGlass.h | 9 ++--
SourceCode/Bond/Servo/CPath.cpp | 28 +++++++++----
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7.xlsx | 0
SourceCode/Bond/Servo/CEquipment.h | 3 +
SourceCode/Bond/Servo/CLoadPort.cpp | 4 +-
9 files changed, 45 insertions(+), 49 deletions(-)
diff --git a/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7.xlsx b/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7.xlsx
new file mode 100644
index 0000000..303ffbe
--- /dev/null
+++ b/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7.xlsx
Binary files differ
diff --git a/SourceCode/Bond/Servo/CBakeCooling.h b/SourceCode/Bond/Servo/CBakeCooling.h
index 5af948a..5982b84 100644
--- a/SourceCode/Bond/Servo/CBakeCooling.h
+++ b/SourceCode/Bond/Servo/CBakeCooling.h
@@ -21,6 +21,7 @@
virtual void getAttributeVector(CAttributeVector& attrubutes);
virtual int recvIntent(CPin* pPin, CIntent* pIntent);
virtual int getIndexerOperationModeBaseValue();
+ virtual short getSlotUnit(short slot) { return slot <= 2 ? 0 : 1; };
};
}
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index bd36700..03f4b5d 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -756,7 +756,7 @@
return 0;
}
- int CEquipment::storedJob(CJobDataB* pJobDataB, short& putSlot)
+ int CEquipment::storedJob(CJobDataB* pJobDataB, short putSlot)
{
if (m_pArm == nullptr) {
return -1;
@@ -770,7 +770,7 @@
ASSERT(pGlass);
Lock();
- pGlass->addPath(m_nID);
+ pGlass->addPath(m_nID, getSlotUnit(putSlot));
m_slot[putSlot - 1].setContext(pGlass);
pGlass->release(); // tempFetchOut需要调用一次release
Unlock();
@@ -780,7 +780,7 @@
CGlass* pBuddy = pGlass->getBuddy();
if (pBuddy != nullptr) {
Lock();
- pBuddy->addPath(m_nID);
+ pBuddy->addPath(m_nID, 0);
if (putSlot % 2 == 0) {
m_slot[putSlot - 2].setContext(pBuddy);
}
@@ -1118,7 +1118,7 @@
MaterialsType glassType = pGlass->getType();
if (glassType == MaterialsType::G1 && putSlotType == MaterialsType::G2) continue;
if (glassType == MaterialsType::G2 && putSlotType == MaterialsType::G1) continue;
- if (!pGlass->isProcessed(m_nID)) continue;
+ if (!pGlass->isProcessed(m_nID, 0)) continue;
return &m_slot[i];
}
@@ -1441,10 +1441,6 @@
int CEquipment::onProcessData(CProcessData* pProcessData)
{
LOGI("<CEquipment-%s>onProcessData.", m_strName.c_str());
- CGlass* pGlass = getGlass(pProcessData->getGlassId().c_str());
- if (pGlass != nullptr) {
- pGlass->processEnd(m_nID);
- }
return 0;
}
diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 95e5555..a005fba 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -101,12 +101,13 @@
virtual void onReceiveLBData(const char* pszData, size_t size);
virtual int onStepEvent(CStep* pStep, int code);
virtual CPin* addPin(PinType type, char* pszName);
+ virtual short getSlotUnit(short slot) { return 0; };
CPin* getPin(char* pszName);
std::vector<CPin*>& CEquipment::getInputPins();
std::vector<CPin*>& CEquipment::getOutputPins();
virtual int recvIntent(CPin* pPin, CIntent* pIntent);
virtual int fetchedOutJob(CJobDataB* pJobDataB);
- virtual int storedJob(CJobDataB* pJobDataB, short& putSlot);
+ virtual int storedJob(CJobDataB* pJobDataB, short putSlot);
virtual int onReceivedJob(int port, CJobDataS* pJobDataS);
virtual int onSentOutJob(int port, CJobDataS* pJobDataS);
virtual BOOL onPreFetchedOutJob(int port, CJobDataB* pJobDataB);
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index 029f39f..e975351 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -66,29 +66,16 @@
return m_strID;
}
- CPath* CGlass::getPathWithSiteID(unsigned int nSiteId)
- {
- CPath* pPath = m_pPath;
- while (pPath != nullptr) {
- if (nSiteId == pPath->getSiteID()) {
- return pPath;
- }
- pPath = pPath->getNext();
- }
-
- return nullptr;
- }
-
CPath* CGlass::getPath()
{
return m_pPath;
}
- CPath* CGlass::getPathWithSiteId(unsigned int nSiteId)
+ CPath* CGlass::getPathWithEq(unsigned int nEqId, unsigned int nUnit)
{
CPath* pTemp = m_pPath;
while (pTemp != nullptr) {
- if (pTemp->getSiteID() == nSiteId) {
+ if (pTemp->getEqID() == nEqId && pTemp->getUnit() == nUnit) {
return pTemp;
}
@@ -98,9 +85,9 @@
return nullptr;
}
- void CGlass::addPath(unsigned int nSiteId)
+ void CGlass::addPath(unsigned int nEqId, unsigned int nUnit)
{
- CPath* pPath = new CPath(nSiteId);
+ CPath* pPath = new CPath(nEqId, nUnit);
if (m_pPath == nullptr) {
m_pPath = pPath;
}
@@ -197,17 +184,17 @@
return m_strBuddyId;
}
- void CGlass::processEnd(unsigned int nSiteId)
+ void CGlass::processEnd(unsigned int nEqId, unsigned int nUnit)
{
- CPath* pPath = getPathWithSiteID(nSiteId);
+ CPath* pPath = getPathWithEq(nEqId, nUnit);
if (pPath != nullptr) {
pPath->processEnd();
}
}
- BOOL CGlass::isProcessed(unsigned int nSiteId)
+ BOOL CGlass::isProcessed(unsigned int nEqId, unsigned int nUnit)
{
- CPath* pPath = getPathWithSiteID(nSiteId);
+ CPath* pPath = getPathWithEq(nEqId, nUnit);
if (pPath == nullptr) return FALSE;
return pPath->isProcessEnd();
diff --git a/SourceCode/Bond/Servo/CGlass.h b/SourceCode/Bond/Servo/CGlass.h
index 1235c8e..d2f4197 100644
--- a/SourceCode/Bond/Servo/CGlass.h
+++ b/SourceCode/Bond/Servo/CGlass.h
@@ -24,10 +24,9 @@
void setType(MaterialsType type);
void setID(const char* pszID);
std::string& getID();
- CPath* getPathWithSiteID(unsigned int nSiteId);
+ CPath* getPathWithEq(unsigned int nEqId, unsigned int nUnit);
CPath* getPath();
- CPath* getPathWithSiteId(unsigned int nSiteId);
- void addPath(unsigned int nSiteId);
+ void addPath(unsigned int nEqId, unsigned int nUnit);
void serialize(CArchive& ar);
void setJobDataB(CJobDataB* pJobDataB);
CJobDataB* getJobDataB();
@@ -36,8 +35,8 @@
BOOL setBuddy(CGlass* pGlass);
CGlass* getBuddy();
std::string& getBuddyId();
- void processEnd(unsigned int nSiteId);
- BOOL isProcessed(unsigned int nSiteId);
+ void processEnd(unsigned int nEqId, unsigned int nUnit);
+ BOOL isProcessed(unsigned int nEqId, unsigned int nUnit);
private:
MaterialsType m_type;
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index 5217337..895ca1e 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -1097,8 +1097,8 @@
}
CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
- pGlass->addPath(m_nID);
- pGlass->processEnd(m_nID);
+ pGlass->addPath(m_nID, 0);
+ pGlass->processEnd(m_nID, 0);
pGlass->setID(szBuffer);
pGlass->setJobDataB(&jb);
pGlass->setType(type);
diff --git a/SourceCode/Bond/Servo/CPath.cpp b/SourceCode/Bond/Servo/CPath.cpp
index 1633b5a..3eb286b 100644
--- a/SourceCode/Bond/Servo/CPath.cpp
+++ b/SourceCode/Bond/Servo/CPath.cpp
@@ -6,7 +6,7 @@
namespace SERVO {
CPath::CPath()
{
- m_nSiteID = 0;
+ m_nEqID = 0;
m_timeOut = 0;
m_timeIn = CToolUnits::getTimestamp();
m_bProcessed = FALSE;
@@ -14,9 +14,10 @@
m_pNext = nullptr;
}
- CPath::CPath(unsigned int nSiteId)
+ CPath::CPath(unsigned int nEqId, unsigned int nUnit)
{
- m_nSiteID = nSiteId;
+ m_nEqID = nEqId;
+ m_nUnit = nUnit;
m_timeOut = 0;
m_timeIn = CToolUnits::getTimestamp();
m_pPrev = nullptr;
@@ -32,8 +33,10 @@
void CPath::getDescription(std::string& strOut)
{
strOut.clear();
- strOut = "CPath<SiteID:";
- strOut = strOut + std::to_string(m_nSiteID);
+ strOut = "CPath<EqID:";
+ strOut = strOut + std::to_string(m_nEqID);
+ strOut = strOut + ",Unit:";
+ strOut = strOut + std::to_string(m_nUnit);
strOut = strOut + ",InTime:";
strOut = strOut + CToolUnits::timeToString2(m_timeIn);
strOut = strOut + ",OutTime:";
@@ -44,7 +47,8 @@
void CPath::serialize(CArchive& ar)
{
if (ar.IsStoring()) {
- ar << m_nSiteID;
+ ar << m_nEqID;
+ ar << m_nUnit;
ar << m_timeIn;
ar << m_timeOut;
ar << m_bProcessed;
@@ -54,7 +58,8 @@
}
}
else {
- ar >> m_nSiteID;
+ ar >> m_nEqID;
+ ar >> m_nUnit;
ar >> m_timeIn;
ar >> m_timeOut;
ar >> m_bProcessed;
@@ -69,9 +74,14 @@
}
}
- unsigned int CPath::getSiteID()
+ unsigned int CPath::getEqID()
{
- return m_nSiteID;
+ return m_nEqID;
+ }
+
+ unsigned int CPath::getUnit()
+ {
+ return m_nUnit;
}
ULONGLONG CPath::getInTime()
diff --git a/SourceCode/Bond/Servo/CPath.h b/SourceCode/Bond/Servo/CPath.h
index af53f62..577d07a 100644
--- a/SourceCode/Bond/Servo/CPath.h
+++ b/SourceCode/Bond/Servo/CPath.h
@@ -6,7 +6,7 @@
{
public:
CPath();
- CPath(unsigned int nSiteId);
+ CPath(unsigned int nEqId, unsigned int nUnit);
virtual ~CPath();
public:
@@ -17,7 +17,8 @@
void addPath(CPath* pPath);
CPath* getTailPath();
CPath* getHeadPath();
- unsigned int getSiteID();
+ unsigned int getEqID();
+ unsigned int getUnit();
ULONGLONG getInTime();
void setOutTime(ULONGLONG time);
ULONGLONG getOutTime();
@@ -25,7 +26,8 @@
BOOL isProcessEnd();
private:
- unsigned int m_nSiteID;
+ unsigned int m_nEqID;
+ unsigned int m_nUnit;
ULONGLONG m_timeIn;
ULONGLONG m_timeOut;
BOOL m_bProcessed;
--
Gitblit v1.9.3