From e8a27bb203fe2aff70390a5eca002d7438da9b0f Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 22 十月 2025 14:24:34 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
SourceCode/Bond/Servo/CLoadPort.cpp | 61 ++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index f603990..ebd1690 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -44,7 +44,7 @@
void CLoadPort::initPins()
{
// 加入Pin初始化代码
- LOGI("<CLoadPort>initPins");
+ LOGD("<CLoadPort>initPins");
addPin(SERVO::PinType::INPUT, _T("In"));
addPin(SERVO::PinType::OUTPUT, _T("Out"));
}
@@ -353,7 +353,7 @@
// 从配置读出的enable,初始化时写给efem
static int i_enable[4] = { 0 };
- if ((++i_enable[m_nIndex]) == 10 + m_nIndex) {
+ if ((++i_enable[m_nIndex]) == 20 + m_nIndex) {
eablePort(m_bEnable, [&](int code) -> int {
LOGI("<LoadPort-%d>eablePort:code=%d", m_nIndex, code);
return 0;
@@ -369,11 +369,25 @@
ii++;
if (ii == 50) {
char szBuffer[64] = {0};
- CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE);
+ CStep* pStep = getStepWithName(STEP_EQ_PORT1_BLOCKED);
CPortStatusReport portStatusReport;
- portStatusReport.setPortStatus(PORT_INUSE);
+ portStatusReport.setPortStatus(PORT_BLOCKED);
portStatusReport.setJobExistenceSlot(0xf);
- portStatusReport.setCassetteId("CID1984113");
+ portStatusReport.setCassetteId("CID1001");
+ int nRet = portStatusReport.serialize(szBuffer, 64);
+ decodePortStatusReport(pStep, szBuffer, 64);
+ }
+ }
+ if (m_nIndex == 1) {
+ static int ii = 0;
+ ii++;
+ if (ii == 55) {
+ char szBuffer[64] = { 0 };
+ CStep* pStep = getStepWithName(STEP_EQ_PORT2_BLOCKED);
+ CPortStatusReport portStatusReport;
+ portStatusReport.setPortStatus(PORT_BLOCKED);
+ portStatusReport.setJobExistenceSlot(0xff );
+ portStatusReport.setCassetteId("CID1004");
int nRet = portStatusReport.serialize(szBuffer, 64);
decodePortStatusReport(pStep, szBuffer, 64);
}
@@ -390,7 +404,6 @@
m_portStatusReport.serialize(ar);
}
else {
- int temp;
ar >> m_nIndex;
m_portStatusReport.serialize(ar);
}
@@ -476,9 +489,25 @@
return (m_nIndex + 1) * 1000 + m_nNextCassetteSequenceNo;
}
+ int CLoadPort::getPortCassetteSnSeed()
+ {
+ return m_nNextCassetteSequenceNo;
+ }
+
+ void CLoadPort::setPortCassetteSnSeed(int seed)
+ {
+ m_nNextCassetteSequenceNo = seed;
+ if (m_nNextCassetteSequenceNo >= 1000) {
+ m_nNextCassetteSequenceNo = 0;
+ }
+ }
+
void CLoadPort::setIndex(unsigned int index)
{
m_nIndex = index;
+
+ std::string id = "Port" + std::to_string(index + 1);
+ m_portStatusReport.setCassetteId(id.c_str());
}
unsigned int CLoadPort::getIndex()
@@ -969,7 +998,7 @@
LOGI("<CLoadPort-%d>设置Port type成功.", m_nIndex);
}
else {
- LOGI("<CLoadPort-%d>设置Port type失败,code:%d", m_nIndex, code);
+ LOGE("<CLoadPort-%d>设置Port type失败,code:%d", m_nIndex, code);
}
if (onWritedBlock != nullptr) {
return onWritedBlock(code);
@@ -999,7 +1028,7 @@
LOGI("<CLoadPort-%d>%s Port成功.", m_nIndex, bEnable ? _T("启用") : _T("禁用"));
}
else {
- LOGI("<CLoadPort-%d>%s Port失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code);
+ LOGE("<CLoadPort-%d>%s Port失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code);
}
if (onWritedBlock != nullptr) {
return onWritedBlock(code);
@@ -1028,7 +1057,7 @@
LOGI("<CLoadPort-%d>设置Port mode成功.", m_nIndex);
}
else {
- LOGI("<CLoadPort-%d>设置Port mode失败,code:%d", m_nIndex, code);
+ LOGE("<CLoadPort-%d>设置Port mode失败,code:%d", m_nIndex, code);
}
if (onWritedBlock != nullptr) {
return onWritedBlock(code);
@@ -1057,7 +1086,7 @@
LOGI("<CLoadPort-%d>设置Cassette Type成功.", m_nIndex);
}
else {
- LOGI("<CLoadPort-%d>设置Cassette Type失败,code:%d", m_nIndex, code);
+ LOGE("<CLoadPort-%d>设置Cassette Type失败,code:%d", m_nIndex, code);
}
if (onWritedBlock != nullptr) {
return onWritedBlock(code);
@@ -1086,7 +1115,7 @@
LOGI("<CLoadPort-%d>设置Transfer mode成功.", m_nIndex + 1);
}
else {
- LOGI("<CLoadPort-%d>设置Transfer mode失败,code:%d", m_nIndex + 1, code);
+ LOGE("<CLoadPort-%d>设置Transfer mode失败,code:%d", m_nIndex + 1, code);
}
if (onWritedBlock != nullptr) {
return onWritedBlock(code);
@@ -1115,7 +1144,7 @@
LOGI("<CLoadPort-%d>%s Auto Change成功.", m_nIndex, bEnable ? _T("启用") : _T("禁用"));
}
else {
- LOGI("<CLoadPort-%d>%s Auto Change失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code);
+ LOGE("<CLoadPort-%d>%s Auto Change失败,code:%d", m_nIndex, bEnable ? _T("启用") : _T("禁用"), code);
}
if (onWritedBlock != nullptr) {
return onWritedBlock(code);
@@ -1195,7 +1224,7 @@
CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
pGlass->setOriginPort(m_nIndex, i);
- pGlass->addPath(m_nID, 0);
+ pGlass->addPath(m_nID, 0, i + 1);
pGlass->processEnd(m_nID, 0);
pGlass->setID(szBuffer);
pGlass->setType(type);
@@ -1223,7 +1252,7 @@
char szBuffer[64];
for (int i = 0; i < SLOT_MAX; i++) {
if (!m_slot[i].isEnable()) continue;
- if (!(map >> i) & 1) continue;
+ if (((map >> i) & 1) == 0) continue;
CJobDataS js;
js.setCassetteSequenceNo(getNextCassetteSequenceNo());
@@ -1235,7 +1264,7 @@
CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
pGlass->setOriginPort(m_nIndex, i);
pGlass->setScheduledForProcessing(i % 2 == 1);
- pGlass->addPath(m_nID, 0);
+ pGlass->addPath(m_nID, 0, i + 1);
pGlass->processEnd(m_nID, 0);
pGlass->setID(szBuffer);
pGlass->setType(m_cassetteType);
@@ -1275,7 +1304,7 @@
CGlass* pGlass = theApp.m_model.m_glassPool.allocaGlass();
pGlass->setOriginPort(m_nIndex, nSlotIndex);
- pGlass->addPath(m_nID, 0);
+ pGlass->addPath(m_nID, 0, slot.nSlotID);
pGlass->processEnd(m_nID, 0);
pGlass->setID(szBuffer);
pGlass->setType(static_cast<SERVO::MaterialsType>(config.nMaterialType));
--
Gitblit v1.9.3