From 2f0684bf01209b9ddfdc53da44fb85f4db6db326 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 06 六月 2025 15:56:02 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
.gitignore | 1
SourceCode/Bond/Servo/CArm.cpp | 4
SourceCode/Bond/Servo/resource.h | 0
SourceCode/Bond/Servo/CGlass.h | 9
SourceCode/Bond/Servo/CMaster.h | 5
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7(1).xlsx | 0
SourceCode/Bond/Servo/CPath.h | 8
SourceCode/Bond/Servo/CSlot.cpp | 11 -
SourceCode/Bond/Servo/CBakeCooling.h | 1
SourceCode/Bond/Servo/CEquipment.cpp | 111 ++++++++++---
SourceCode/Bond/Servo/Servo.rc | 0
Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7.xlsx | 0
SourceCode/Bond/Servo/CMaster.cpp | 115 +++++++++++---
SourceCode/Bond/Servo/CPageGraph2.cpp | 28 +++
SourceCode/Bond/Servo/CGlass.cpp | 29 +--
SourceCode/Bond/Servo/CPath.cpp | 28 ++-
SourceCode/Bond/Servo/Model.cpp | 2
SourceCode/Bond/Servo/CLoadPort.cpp | 4
SourceCode/Bond/Servo/ServoDlg.cpp | 35 ++-
/dev/null | 0
SourceCode/Bond/Servo/CMeasurement.cpp | 4
SourceCode/Bond/x64/Debug/EqsGraph.ini | 2
SourceCode/Bond/Servo/CArmTray.cpp | 4
SourceCode/Bond/Servo/CEFEM.cpp | 10 +
SourceCode/Bond/Servo/CEquipment.h | 16 +
SourceCode/Bond/Servo/ServoCommo.h | 2
SourceCode/Bond/Servo/CBonder.cpp | 5
27 files changed, 312 insertions(+), 122 deletions(-)
diff --git a/.gitignore b/.gitignore
index f1a3d18..cde4f6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,3 +52,4 @@
SourceCode/Bond/x64/Debug/Backups/
Document/鍏变韩鏂囦欢澶�/
Document/鍏变韩鏂囦欢澶�.rar
+SourceCode/Bond/x64/Debug/Master.dat
diff --git "a/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7\0501\051.xlsx" "b/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7\0501\051.xlsx"
new file mode 100644
index 0000000..15ab4ed
--- /dev/null
+++ "b/Document/ESWIN_EAS_Bonder_Inline_Mapping_Address_v1.1.7\0501\051.xlsx"
Binary files differ
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/CArm.cpp b/SourceCode/Bond/Servo/CArm.cpp
index 3a8d15b..cf6320e 100644
--- a/SourceCode/Bond/Servo/CArm.cpp
+++ b/SourceCode/Bond/Servo/CArm.cpp
@@ -106,6 +106,10 @@
pGlass = pPreviousGlass;
pGlass->addRef();
m_slot[0].setContext(nullptr);
+ CGlass* pBuddy = pGlass->getBuddy();
+ if (pBuddy != nullptr) {
+ m_slot[1].setContext(nullptr);
+ }
Unlock();
if (m_listener.onDataChanged != nullptr) {
diff --git a/SourceCode/Bond/Servo/CArmTray.cpp b/SourceCode/Bond/Servo/CArmTray.cpp
index 6e74681..0a043b6 100644
--- a/SourceCode/Bond/Servo/CArmTray.cpp
+++ b/SourceCode/Bond/Servo/CArmTray.cpp
@@ -41,6 +41,10 @@
m_slot[0].setPosition(m_nID);
m_slot[0].setNo(1);
m_slot[0].setName("Slot 1");
+ m_slot[1].enable();
+ m_slot[1].setPosition(m_nID);
+ m_slot[1].setNo(2);
+ m_slot[1].setName("Slot 2");
}
void CArmTray::onTimer(UINT nTimerid)
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/CBonder.cpp b/SourceCode/Bond/Servo/CBonder.cpp
index c7bd953..4a48f1e 100644
--- a/SourceCode/Bond/Servo/CBonder.cpp
+++ b/SourceCode/Bond/Servo/CBonder.cpp
@@ -390,6 +390,11 @@
Lock();
CGlass* pGlass1 = getGlassFromSlot(1);
CGlass* pGlass2 = getGlassFromSlot(2);
+ if (pGlass1 == nullptr || pGlass2 == nullptr) {
+ LOGE("<CBonder-%s>onProcessData,错误!不满足两片玻璃且分别为G1与G2的条件,请检查数据是否正确!", m_strName.c_str());
+ Unlock();
+ return -1;
+ }
if (pGlass1->getBuddy() != nullptr || pGlass2->getBuddy() != nullptr) {
LOGE("<CBonder-%s>onProcessData,错误!玻璃较早前已被绑定,请检查数据是否正确!", m_strName.c_str());
Unlock();
diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index 6cbb23b..326a19f 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -663,6 +663,16 @@
m_pPort[i]->onReceiveLBData(pszData, size);
}
}
+
+ // 更新信号到LoadPort, Robot, Aligner, Fliper
+ m_pPort[0]->setLinkSignalBlock(0, &m_bLinkSignal[0][0]);
+ m_pPort[1]->setLinkSignalBlock(0, &m_bLinkSignal[1][0]);
+ m_pPort[2]->setLinkSignalBlock(0, &m_bLinkSignal[2][0]);
+ m_pPort[3]->setLinkSignalBlock(0, &m_bLinkSignal[3][0]);
+ m_pArmTray[0]->setLinkSignalBlock(0, &m_bLinkSignal[4][0]);
+ m_pArmTray[1]->setLinkSignalBlock(0, &m_bLinkSignal[5][0]);
+ m_pAligner->setLinkSignalBlock(0, &m_bLinkSignal[6][0]);
+ m_pFliper->setLinkSignalBlock(0, &m_bLinkSignal[7][0]);
}
int CEFEM::onReceivedJob(int port, CJobDataS* pJobDataS)
diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 0a7d384..0aa06b1 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -35,6 +35,7 @@
m_bLocalAlarm = FALSE;
m_bAutoRecipeChange = FALSE;
m_bVCREnable[0] = FALSE;
+ memset(m_bLinkSignal, 0, sizeof(m_bLinkSignal));
m_pCclink = nullptr;
m_nBaseAlarmId = 0;
m_pArm = nullptr;
@@ -334,22 +335,23 @@
}
// 梳理各玻璃之间的绑定关系
- /*
Lock();
- std::list<CGlass*> list = m_glassList;
- for (auto item : list) {
- std::string& strBuddyId = item->getBuddyId();
- if (!strBuddyId.empty()) {
- for (auto item2 : m_glassList) {
- if (strBuddyId.compare(item2->getID()) == 0) {
- item->setBuddy(item2);
- TRACE("绑定关系: %s <- %s\n", item->getID().c_str(), item2->getID().c_str());
+ for (int i = 0; i < SLOT_MAX; i++) {
+ CGlass* pGlass = (CGlass*)m_slot[i].getContext();
+ if (pGlass != nullptr) {
+ std::string& strBuddyId = pGlass->getBuddyId();
+ if (!strBuddyId.empty()) {
+ for (int j = 0; j < SLOT_MAX; j++) {
+ CGlass* pBudy = (CGlass*)m_slot[j].getContext();
+ if (pBudy != nullptr && strBuddyId.compare(pBudy->getID()) == 0) {
+ pGlass->setBuddy(pBudy);
+ TRACE("绑定关系: %s <- %s\n", pGlass->getID().c_str(), pBudy->getID().c_str());
+ }
}
}
}
}
Unlock();
- */
}
}
@@ -363,9 +365,20 @@
}
*/
- // 以下解释和处理数据
+ // 连接信号解释和保存
BOOL bFlag;
- int index = 0x540;
+ int index = 0;
+ for (int i = 0; i < 8; i++) {
+ m_bLinkSignal[i][SIGNAL_UPSTREAM_INLINE] = isBitOn(pszData, size, index + 0);
+ m_bLinkSignal[i][SIGNAL_UPSTREAM_TROUBLE] = isBitOn(pszData, size, index + 1);
+ m_bLinkSignal[i][SIGNAL_INTERLOCK] = isBitOn(pszData, size, index + 2);
+ m_bLinkSignal[i][SIGNAL_SEND_ABLE] = isBitOn(pszData, size, index + 3);
+ index += 0x40;
+ }
+
+
+ // 其它信号及响应
+ index = 0x540;
// alive
@@ -582,6 +595,28 @@
return m_bVCREnable[index];
}
+ BOOL CEquipment::isLinkSignalOn(unsigned int path, unsigned int signal)
+ {
+ if (path >= PATH_MAX) return FALSE;
+ if (signal >= SIGNAL_MAX) return FALSE;
+ return m_bLinkSignal[path][signal];
+ }
+
+ void CEquipment::setLinkSignal(unsigned int path, unsigned int signal, BOOL bOn)
+ {
+ if (path >= PATH_MAX) return;
+ if (signal >= SIGNAL_MAX) return;
+ m_bLinkSignal[path][signal] = bOn;
+ }
+
+ void CEquipment::setLinkSignalBlock(unsigned int path, BOOL* pSignal)
+ {
+ if (path >= PATH_MAX) return;
+ for (int i = 0; i < SIGNAL_MAX; i++) {
+ m_bLinkSignal[path][i] = pSignal[i];
+ }
+ }
+
int CEquipment::onStepEvent(CStep* pStep, int code)
{
if (code == STEP_EVENT_READDATA) {
@@ -756,7 +791,7 @@
return 0;
}
- int CEquipment::storedJob(CJobDataB* pJobDataB, short& putSlot)
+ int CEquipment::storedJob(CJobDataB* pJobDataB, short putSlot)
{
if (m_pArm == nullptr) {
return -1;
@@ -770,23 +805,26 @@
ASSERT(pGlass);
Lock();
- pGlass->addPath(m_nID);
+ pGlass->addPath(m_nID, getSlotUnit(putSlot));
m_slot[putSlot - 1].setContext(pGlass);
pGlass->release(); // tempFetchOut需要调用一次release
Unlock();
// 如果此玻璃已经贴合,贴合的玻璃也要从加入到列表中
- /*
CGlass* pBuddy = pGlass->getBuddy();
if (pBuddy != nullptr) {
Lock();
- pBuddy->addPath(m_nID);
- pBuddy->addRef(); // 加入list,addRef
- m_glassList.push_back(pBuddy);
+ pBuddy->addPath(m_nID, 0);
+ if (putSlot % 2 == 0) {
+ m_slot[putSlot - 2].setContext(pBuddy);
+ }
+ else {
+ m_slot[putSlot].setContext(pBuddy);
+ }
Unlock();
}
- */
+
if (m_listener.onDataChanged != nullptr) {
m_listener.onDataChanged(this, EDCC_STORED_JOB);
@@ -1111,13 +1149,42 @@
if (m_slot[i].isLock()) continue;
CGlass* pGlass = (CGlass*)m_slot[i].getContext();
if (pGlass == nullptr) continue;
+ if(!m_bLinkSignal[0][SIGNAL_UPSTREAM_INLINE]
+ || m_bLinkSignal[0][SIGNAL_UPSTREAM_TROUBLE]
+ || !m_bLinkSignal[0][SIGNAL_INTERLOCK]
+ || !m_bLinkSignal[0][SIGNAL_SEND_ABLE] ) continue;
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;
return &m_slot[i];
+ }
+
+ return nullptr;
+ }
+
+ CSlot* CEquipment::getProcessedSlot2(MaterialsType putSlotType, const std::vector<int>& candidates)
+ {
+ for (auto item : candidates) {
+ for (int i = 0; i < SLOT_MAX; i++) {
+ if (item == i + 1) {
+ if (!m_slot[i].isEnable()) continue;
+ if (m_slot[i].isLock()) continue;
+ CGlass* pGlass = (CGlass*)m_slot[i].getContext();
+ if (pGlass == nullptr) continue;
+ if (!m_bLinkSignal[0][SIGNAL_UPSTREAM_INLINE]
+ || m_bLinkSignal[0][SIGNAL_UPSTREAM_TROUBLE]
+ || !m_bLinkSignal[0][SIGNAL_INTERLOCK]
+ || !m_bLinkSignal[0][SIGNAL_SEND_ABLE]) continue;
+
+ MaterialsType glassType = pGlass->getType();
+ if (glassType == MaterialsType::G1 && putSlotType == MaterialsType::G2) continue;
+ if (glassType == MaterialsType::G2 && putSlotType == MaterialsType::G1) continue;
+
+ return &m_slot[i];
+ }
+ }
}
return nullptr;
@@ -1438,10 +1505,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..ac4b84c 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -38,7 +38,11 @@
namespace SERVO {
-#define SLOT_MAX 12
+#define SLOT_MAX PATH_MAX
+#define SIGNAL_UPSTREAM_INLINE 0
+#define SIGNAL_UPSTREAM_TROUBLE 1
+#define SIGNAL_INTERLOCK 2
+#define SIGNAL_SEND_ABLE 3
typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE;
typedef std::function<void(void* pEiuipment, int code)> ONDATACHANGED;
@@ -101,12 +105,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);
@@ -159,6 +164,7 @@
// 获取一个指定物料类型(G1,G2,G1&G2)的且已经加工处理的槽位
CSlot* getProcessedSlot(MaterialsType putSlotType);
+ CSlot* getProcessedSlot2(MaterialsType putSlotType, const std::vector<int>& candidates);
// 获取玻璃物料
CGlass* getGlassFromSlot(int slotNo);
@@ -186,6 +192,11 @@
BOOL isLocalAlarm();
BOOL isAutoRecipeChange();
BOOL isVCREnable(unsigned int index);
+ BOOL isLinkSignalOn(unsigned int path, unsigned int signal);
+
+ // 只在模拟测试时使用的函数,用于模拟信号
+ void setLinkSignal(unsigned int path, unsigned int signal, BOOL bOn);
+ void setLinkSignalBlock(unsigned int path, BOOL* pSignal);
protected:
inline void Lock() { EnterCriticalSection(&m_criticalSection); }
@@ -230,6 +241,7 @@
BOOL m_bLocalAlarm;
BOOL m_bAutoRecipeChange;
BOOL m_bVCREnable[VCR_MAX];
+ BOOL m_bLinkSignal[PATH_MAX][SIGNAL_MAX];
protected:
CCCLinkIEControl* m_pCclink;
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/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index cbcfcde..bc2a884 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -295,6 +295,7 @@
CBonder* pBonder1 = (CBonder*)getEquipment(EQ_ID_Bonder1);
CBonder* pBonder2 = (CBonder*)getEquipment(EQ_ID_Bonder2);
CBakeCooling* pBakeCooling = (CBakeCooling*)getEquipment(EQ_ID_BAKE_COOLING);
+ CMeasurement* pMeasurement = (CMeasurement*)getEquipment(EQ_ID_MEASUREMENT);
ASSERT(pLoadPort1);
ASSERT(pLoadPort2);
@@ -304,6 +305,7 @@
ASSERT(pBonder1);
ASSERT(pBonder2);
ASSERT(pBakeCooling);
+ ASSERT(pMeasurement);
while (1) {
// 待退出信号或时间到
@@ -367,24 +369,51 @@
}
- // Bonder -> BakeCooling
- m_pActiveRobotTask = createTransferTask_bonder_to_bakecooling(pBonder1, pBakeCooling, primaryType, secondaryType);
+ // BakeCooling ->Measurement
+ m_pActiveRobotTask = createTransferTask_bakecooling_to_measurement(pBakeCooling, pMeasurement);
if (m_pActiveRobotTask != nullptr) {
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
}
- m_pActiveRobotTask = createTransferTask_bonder_to_bakecooling(pBonder2, pBakeCooling, primaryType, secondaryType);
+
+ // BakeCooling内部
+ // Bake -> Cooling
+ m_pActiveRobotTask = createTransferTask_bake_to_cooling(pBakeCooling);
if (m_pActiveRobotTask != nullptr) {
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
+ }
+ LOGI("创建新任务<%s>...", strDescription.c_str());
+ continue;
+ }
+
+
+ // Bonder -> BakeCooling
+ m_pActiveRobotTask = createTransferTask_bonder_to_bakecooling(pBonder1, pBakeCooling);
+ if (m_pActiveRobotTask != nullptr) {
+ std::string strDescription = m_pActiveRobotTask->getDescription();
+ unlock();
+ if (m_listener.onRobotTaskEvent != nullptr) {
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
+ }
+ LOGI("创建新任务<%s>...", strDescription.c_str());
+ continue;
+ }
+
+ m_pActiveRobotTask = createTransferTask_bonder_to_bakecooling(pBonder2, pBakeCooling);
+ if (m_pActiveRobotTask != nullptr) {
+ std::string strDescription = m_pActiveRobotTask->getDescription();
+ unlock();
+ if (m_listener.onRobotTaskEvent != nullptr) {
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -396,7 +425,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -407,7 +436,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -421,7 +450,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -432,7 +461,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -452,7 +481,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -463,7 +492,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -477,7 +506,7 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
@@ -488,14 +517,11 @@
std::string strDescription = m_pActiveRobotTask->getDescription();
unlock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 0);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_CREATE);
}
LOGI("创建新任务<%s>...", strDescription.c_str());
continue;
}
-
-
- // BakeCooling ->Measurement
// Measurement -> LoadPort
@@ -525,6 +551,7 @@
break;
}
+ // 读标志位
for (auto item : m_listEquipment) {
if (item->getID() == EQ_ID_Bonder1 ||
item->getID() == EQ_ID_Bonder2) {
@@ -669,7 +696,7 @@
lock();
if (m_listener.onRobotTaskEvent != nullptr) {
- m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, 1);
+ m_listener.onRobotTaskEvent(this, m_pActiveRobotTask, ROBOT_EVENT_FINISH);
}
delete m_pActiveRobotTask;
m_pActiveRobotTask = nullptr;
@@ -1112,20 +1139,14 @@
return pTask;
}
- CRobotTask* CMaster::createTransferTask_bonder_to_bakecooling(CEquipment* pSrcEq, CEquipment* pTarEq,
- MaterialsType primaryType/* = MaterialsType::G1*/, MaterialsType secondaryType/* = MaterialsType::G2*/)
+ CRobotTask* CMaster::createTransferTask_bonder_to_bakecooling(CEquipment* pSrcEq, CEquipment* pTarEq)
{
std::vector<int> slots = {1, 2};
CRobotTask* pTask = nullptr;
CSlot* pSrcSlot, * pTarSlot;
- pTarSlot = pTarEq->getAvailableSlotForGlass2(primaryType, slots);
- pSrcSlot = pSrcEq->getProcessedSlot(primaryType);
- if (pSrcSlot == nullptr || nullptr == pTarSlot) {
- pTarSlot = pTarEq->getAvailableSlotForGlass(secondaryType);
- pSrcSlot = pSrcEq->getProcessedSlot(secondaryType);
- }
-
+ pTarSlot = pTarEq->getAvailableSlotForGlass2(MaterialsType::G1, slots);
+ pSrcSlot = pSrcEq->getProcessedSlot(MaterialsType::G1);
if (pSrcSlot != nullptr && nullptr != pTarSlot) {
pTask = new CRobotTask();
@@ -1137,4 +1158,46 @@
return pTask;
}
+
+ CRobotTask* CMaster::createTransferTask_bake_to_cooling(CEquipment* pSrcEq)
+ {
+ std::vector<int> slotsTar = { 3, 4 };
+ std::vector<int> slotsSrc = { 1, 2 };
+
+ CRobotTask* pTask = nullptr;
+ CSlot* pSrcSlot, * pTarSlot;
+ pTarSlot = pSrcEq->getAvailableSlotForGlass2(MaterialsType::G1, slotsTar);
+ pSrcSlot = pSrcEq->getProcessedSlot2(MaterialsType::G1, slotsSrc);
+
+ if (pSrcSlot != nullptr && nullptr != pTarSlot) {
+ pTask = new CRobotTask();
+ pTask->setContext(pSrcSlot->getContext());
+ pTask->setRobotTransferParam(++taskSeqNo, 1, pSrcSlot->getPosition(),
+ pTarSlot->getPosition(), pSrcSlot->getNo(), pTarSlot->getNo());
+ }
+
+
+ return pTask;
+ }
+
+ CRobotTask* CMaster::createTransferTask_bakecooling_to_measurement(CEquipment* pSrcEq, CEquipment* pTarEq)
+ {
+ std::vector<int> slots = { 3, 4 };
+
+ CRobotTask* pTask = nullptr;
+ CSlot* pSrcSlot, * pTarSlot;
+ pTarSlot = pTarEq->getAvailableSlotForGlass(MaterialsType::G1);
+ pSrcSlot = pSrcEq->getProcessedSlot2(MaterialsType::G1, slots);
+
+ if (pSrcSlot != nullptr && nullptr != pTarSlot) {
+ pTask = new CRobotTask();
+ pTask->setContext(pSrcSlot->getContext());
+ pTask->setRobotTransferParam(++taskSeqNo, 1, pSrcSlot->getPosition(),
+ pTarSlot->getPosition(), pSrcSlot->getNo(), pTarSlot->getNo());
+ }
+
+
+ return pTask;
+ }
+
}
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index 7eeffad..9d00447 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -86,8 +86,9 @@
void setState(MASTERSTATE state);
CRobotTask* createTransferTask(CEquipment* pSrcEq, CEquipment* pTarEq,
MaterialsType primaryType = MaterialsType::G1, MaterialsType secondaryType = MaterialsType::G2);
- CRobotTask* createTransferTask_bonder_to_bakecooling(CEquipment* pSrcEq, CEquipment* pTarEq,
- MaterialsType primaryType = MaterialsType::G1, MaterialsType secondaryType = MaterialsType::G2);
+ CRobotTask* createTransferTask_bonder_to_bakecooling(CEquipment* pSrcEq, CEquipment* pTarEq);
+ CRobotTask* createTransferTask_bake_to_cooling(CEquipment* pSrcEq);
+ CRobotTask* createTransferTask_bakecooling_to_measurement(CEquipment* pSrcEq, CEquipment* pTarEq);
private:
CRITICAL_SECTION m_criticalSection;
diff --git a/SourceCode/Bond/Servo/CMeasurement.cpp b/SourceCode/Bond/Servo/CMeasurement.cpp
index 4821891..3531b18 100644
--- a/SourceCode/Bond/Servo/CMeasurement.cpp
+++ b/SourceCode/Bond/Servo/CMeasurement.cpp
@@ -45,6 +45,10 @@
m_slot[0].setPosition(m_nID);
m_slot[0].setNo(1);
m_slot[0].setName("Slot 1");
+ m_slot[1].enable();
+ m_slot[1].setPosition(m_nID);
+ m_slot[1].setNo(2);
+ m_slot[1].setName("Slot 2");
}
void CMeasurement::onTimer(UINT nTimerid)
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index d2a356e..b16eae2 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -264,6 +264,34 @@
}
else if (nCmd == ID_EQSGRAPHITEM_TEST4) {
SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
+ if (pEquipment != nullptr) {
+ pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_INLINE, TRUE);
+ pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_TROUBLE, FALSE);
+ pEquipment->setLinkSignal(0, SIGNAL_INTERLOCK, TRUE);
+ pEquipment->setLinkSignal(0, SIGNAL_SEND_ABLE, TRUE);
+ }
+
+ if (pEquipment != nullptr && (pEquipment->getID() == EQ_ID_Bonder1
+ || pEquipment->getID() == EQ_ID_Bonder2)) {
+ SERVO::CGlass* pGlass = pEquipment->getAnyGlass();
+ if (pGlass != nullptr) {
+ SERVO::CProcessData pd;
+ pd.setGlassId(pGlass->getID().c_str());
+ pEquipment->onProcessData(&pd);
+ }
+ }
+ }
+ else if (nCmd == ID_EQSGRAPHITEM_TEST5) {
+ SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
+ if (pEquipment != nullptr) {
+ pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_INLINE, TRUE);
+ pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_TROUBLE, TRUE);
+ pEquipment->setLinkSignal(0, SIGNAL_INTERLOCK, TRUE);
+ pEquipment->setLinkSignal(0, SIGNAL_SEND_ABLE, FALSE);
+ }
+ }
+ else if (nCmd == ID_EQSGRAPHITEM_TEST6) {
+ SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
// 娴嬭瘯涓嬪彂Cim Message
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;
diff --git a/SourceCode/Bond/Servo/CSlot.cpp b/SourceCode/Bond/Servo/CSlot.cpp
index 958d5c6..94299a1 100644
--- a/SourceCode/Bond/Servo/CSlot.cpp
+++ b/SourceCode/Bond/Servo/CSlot.cpp
@@ -122,23 +122,12 @@
void CSlot::serialize(CArchive& ar)
{
if (ar.IsStoring()) {
- ar << m_nPosition;
- ar << m_nNo;
- ar << (int)m_materialsType;
- WriteString(ar, m_strName);
ar << (__int64)m_pContext;
- ar << m_bEnable;
ar << m_bLock;
}
else {
- int i32;
__int64 i64;
- ar >> m_nPosition;
- ar >> m_nNo;
- ar >> i32; m_materialsType = (MaterialsType)i32;
- ReadString(ar, m_strName);
ar >> i64; m_pTempContext = (CContext*)i64;
- ar >> m_bEnable;
ar >> m_bLock;
}
}
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 30793da..e39f62d 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -248,7 +248,7 @@
int nRecordId = 0;
TransferManager::getInstance().addTransferRecord(data, nRecordId);
- notifyPtr(RX_CODE_EQ_ROBOT_TASK, pTask);
+ notifyPtrAndInt(RX_CODE_EQ_ROBOT_TASK, pTask, nullptr, code);
LOGI("<CModel>onRobotTaskEvent: 任务记录已保存,RecordID=%d", nRecordId);
};
m_master.setListener(masterListener);
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index a333b5f..2f13140 100644
--- a/SourceCode/Bond/Servo/Servo.rc
+++ b/SourceCode/Bond/Servo/Servo.rc
Binary files differ
diff --git a/SourceCode/Bond/Servo/ServoCommo.h b/SourceCode/Bond/Servo/ServoCommo.h
index acfd20a..e80ba90 100644
--- a/SourceCode/Bond/Servo/ServoCommo.h
+++ b/SourceCode/Bond/Servo/ServoCommo.h
@@ -5,6 +5,8 @@
#define BLOCK_BUFFER_MAX 1024
#define ALIVE_TIMEOUT 15
#define VCR_MAX 1
+#define PATH_MAX 8
+#define SIGNAL_MAX 8
#define ARM_ALL 99
enum class PortType {
diff --git a/SourceCode/Bond/Servo/ServoDlg.cpp b/SourceCode/Bond/Servo/ServoDlg.cpp
index 17306f8..80117a5 100644
--- a/SourceCode/Bond/Servo/ServoDlg.cpp
+++ b/SourceCode/Bond/Servo/ServoDlg.cpp
@@ -188,21 +188,26 @@
}
}
else if (RX_CODE_EQ_ROBOT_TASK == code) {
- SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask();
- if (m_pRobotTaskDlg != nullptr) {
- m_pRobotTaskDlg->SetRobotTask(pTask);
- }
- if (pTask == nullptr) {
- m_pMyStatusbar->setCurTaskBtnText("无");
- }
- else {
- SERVO::CEquipment* pEq1, * pEq2;
- pEq1 = theApp.m_model.getMaster().getEquipment(pTask->getSrcPosition());
- pEq2 = theApp.m_model.getMaster().getEquipment(pTask->getTarPosition());
- if (pEq1 != nullptr && pEq2 != nullptr) {
- CString strText;
- strText.Format(_T("%s --> %s"), pEq1->getName().c_str(), pEq2->getName().c_str());
- m_pMyStatusbar->setCurTaskBtnText((LPTSTR)(LPCTSTR)strText);
+ int exCode;
+ if (pAny->getIntValue("exCode", exCode)) {
+ if (exCode == ROBOT_EVENT_CREATE) {
+ SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask();
+ ASSERT(pTask);
+ if (m_pRobotTaskDlg) {
+ m_pRobotTaskDlg->SetRobotTask(pTask);
+ }
+
+ SERVO::CEquipment* pEq1, * pEq2;
+ pEq1 = theApp.m_model.getMaster().getEquipment(pTask->getSrcPosition());
+ pEq2 = theApp.m_model.getMaster().getEquipment(pTask->getTarPosition());
+ if (pEq1 != nullptr && pEq2 != nullptr) {
+ CString strText;
+ strText.Format(_T("%s --> %s"), pEq1->getName().c_str(), pEq2->getName().c_str());
+ m_pMyStatusbar->setCurTaskBtnText((LPTSTR)(LPCTSTR)strText);
+ }
+ }
+ else if (exCode == ROBOT_EVENT_FINISH) {
+ m_pMyStatusbar->setCurTaskBtnText("无");
}
}
}
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index 4a13461..1827348 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
Binary files differ
diff --git a/SourceCode/Bond/x64/Debug/EqsGraph.ini b/SourceCode/Bond/x64/Debug/EqsGraph.ini
index 9b63e87..3860bf9 100644
--- a/SourceCode/Bond/x64/Debug/EqsGraph.ini
+++ b/SourceCode/Bond/x64/Debug/EqsGraph.ini
@@ -39,7 +39,7 @@
Top=63
[Arm Tray2]
Left=467
-Top=166
+Top=167
[Fliper(G2)]
Left=238
Top=251
diff --git a/SourceCode/Bond/x64/Debug/Master.dat b/SourceCode/Bond/x64/Debug/Master.dat
deleted file mode 100644
index 697ea90..0000000
--- a/SourceCode/Bond/x64/Debug/Master.dat
+++ /dev/null
Binary files differ
--
Gitblit v1.9.3