From 2ebccf831b56d30089924f2eefa2d790e2b8f3fc Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期四, 07 八月 2025 09:20:21 +0800
Subject: [PATCH] 1.为CVariable增加值的设置和获取 2.当发生Port状态改变为InUse时,此时也刚好获取到CarrierID,上报S6F11_CarrierID_Readed
---
SourceCode/Bond/Servo/HsmsPassive.h | 9 ++
SourceCode/Bond/Servo/CVariable.h | 5 +
SourceCode/Bond/Servo/HsmsPassive.cpp | 66 ++++++++++++++++++++--
SourceCode/Bond/Servo/Model.cpp | 7 ++
SourceCode/Bond/Servo/CCollectionEvent.cpp | 8 ++
SourceCode/Bond/Servo/CLoadPort.cpp | 14 ++--
SourceCode/Bond/x64/Debug/VariableList.txt | 1
SourceCode/Bond/Servo/CPortStatusReport.cpp | 5 +
SourceCode/Bond/Servo/CCollectionEvent.h | 4 +
SourceCode/Bond/x64/Debug/CollectionEventList.txt | 1
SourceCode/Bond/Servo/CPortStatusReport.h | 1
SourceCode/Bond/Servo/CVariable.cpp | 38 ++++++++++++
SourceCode/Bond/x64/Debug/ReportList.txt | 2
Document/Panel Bonder八零联合 SecsTest CheckList_v3.0.xlsx | 0
14 files changed, 145 insertions(+), 16 deletions(-)
diff --git "a/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx" "b/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
index ec6ca66..e062180 100644
--- "a/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
+++ "b/Document/Panel Bonder\345\205\253\351\233\266\350\201\224\345\220\210 SecsTest CheckList_v3.0.xlsx"
Binary files differ
diff --git a/SourceCode/Bond/Servo/CCollectionEvent.cpp b/SourceCode/Bond/Servo/CCollectionEvent.cpp
index a0b7773..ce5d1a2 100644
--- a/SourceCode/Bond/Servo/CCollectionEvent.cpp
+++ b/SourceCode/Bond/Servo/CCollectionEvent.cpp
@@ -59,7 +59,7 @@
}
}
- unsigned int CCollectionEvent::getPortID()
+ unsigned int CCollectionEvent::getFirstPortID()
{
if (m_reports.empty()) return -1;
return m_reports.front()->getReportId();
@@ -90,6 +90,12 @@
return nullptr;
}
+ CReport* CCollectionEvent::getFirstReport()
+ {
+ if (m_reports.empty()) return nullptr;
+ return m_reports.front();
+ }
+
std::vector<CReport*>& CCollectionEvent::getReports()
{
return m_reports;
diff --git a/SourceCode/Bond/Servo/CCollectionEvent.h b/SourceCode/Bond/Servo/CCollectionEvent.h
index bfad5fb..a0b023d 100644
--- a/SourceCode/Bond/Servo/CCollectionEvent.h
+++ b/SourceCode/Bond/Servo/CCollectionEvent.h
@@ -23,7 +23,9 @@
/* 如果一个CEID只有一个Report的场景,调用此函数设置或取消 */
void setReport(CReport* pReport);
- unsigned int getPortID();
+ unsigned int getFirstPortID();
+ CReport* getFirstReport();
+
private:
unsigned int m_nCEID;
std::string m_strName;
diff --git a/SourceCode/Bond/Servo/CLoadPort.cpp b/SourceCode/Bond/Servo/CLoadPort.cpp
index 29b9050..d3550f0 100644
--- a/SourceCode/Bond/Servo/CLoadPort.cpp
+++ b/SourceCode/Bond/Servo/CLoadPort.cpp
@@ -355,12 +355,13 @@
if (m_nIndex == 0) {
static int ii = 0;
ii++;
- if (ii == 20) {
+ if (ii == 50) {
char szBuffer[64] = {0};
CStep* pStep = getStepWithName(STEP_EQ_PORT1_INUSE);
CPortStatusReport portStatusReport;
- portStatusReport.setPortStatus(PORT_UNLOAD_READY);
+ portStatusReport.setPortStatus(PORT_INUSE);
portStatusReport.setJobExistenceSlot(0xf);
+ portStatusReport.setCassetteId("CID1984113");
int nRet = portStatusReport.serialize(szBuffer, 64);
decodePortStatusReport(pStep, szBuffer, 64);
}
@@ -913,13 +914,12 @@
else {
// 抛出到应用层做选择要加工的片子
generateGlassList(getScanCassetteMap());
- if (m_listener.onPortStatusChanged != nullptr) {
- m_listener.onPortStatusChanged(this, portStatusReport.getPortStatus(),
- getScanCassetteMap());
- }
}
}
-
+ if (m_listener.onPortStatusChanged != nullptr) {
+ m_listener.onPortStatusChanged(this, portStatusReport.getPortStatus(),
+ getScanCassetteMap());
+ }
// 缓存Attribute,用于调试时显示信息
diff --git a/SourceCode/Bond/Servo/CPortStatusReport.cpp b/SourceCode/Bond/Servo/CPortStatusReport.cpp
index 89cf223..0d6fa95 100644
--- a/SourceCode/Bond/Servo/CPortStatusReport.cpp
+++ b/SourceCode/Bond/Servo/CPortStatusReport.cpp
@@ -249,6 +249,11 @@
m_nJobExistenceSlot[0] = map;
}
+ void CPortStatusReport::setCassetteId(const char* pszId)
+ {
+ m_strCassetteID = pszId;
+ }
+
void CPortStatusReport::WriteString(CArchive& ar, std::string& string)
{
CString strTemp = string.c_str();
diff --git a/SourceCode/Bond/Servo/CPortStatusReport.h b/SourceCode/Bond/Servo/CPortStatusReport.h
index 727a7d9..fb73f36 100644
--- a/SourceCode/Bond/Servo/CPortStatusReport.h
+++ b/SourceCode/Bond/Servo/CPortStatusReport.h
@@ -31,6 +31,7 @@
bool isJobExistenceSlot();
short getJobExistenceSlot();
void setJobExistenceSlot(short map);
+ void setCassetteId(const char* pszId);
private:
void WriteString(CArchive& ar, std::string& string);
diff --git a/SourceCode/Bond/Servo/CVariable.cpp b/SourceCode/Bond/Servo/CVariable.cpp
index 21ddb44..e9c5d83 100644
--- a/SourceCode/Bond/Servo/CVariable.cpp
+++ b/SourceCode/Bond/Servo/CVariable.cpp
@@ -7,6 +7,7 @@
{
m_nVarialbeId = 0;
m_format = SVFromat::U1;
+ m_nValue = 0;
}
CVariable::CVariable(const char* pszId, const char* pszName, const char* pszFormat, const char* pszRemark)
@@ -87,4 +88,41 @@
{
return m_strRemark;
}
+
+ void CVariable::setValue(__int64 value)
+ {
+ if (m_format == SVFromat::U1 || m_format == SVFromat::U2 || m_format == SVFromat::I2) {
+ m_nValue = value;
+ }
+ }
+
+ void CVariable::setValue(const char* pszValue)
+ {
+ std::string strTemp = pszValue;
+ if (m_format == SVFromat::A20) {
+ if (strTemp.length() > 20) {
+ strTemp = strTemp.substr(0, 20);
+ }
+ }
+ else if (m_format == SVFromat::A50) {
+ if (strTemp.length() > 50) {
+ strTemp = strTemp.substr(0, 50);
+ }
+ }
+
+ m_strValue = strTemp;
+ }
+
+ std::string CVariable::getValue()
+ {
+ std::string strRet;
+ if (m_format == SVFromat::U1 || m_format == SVFromat::U2 || m_format == SVFromat::I2) {
+ strRet = std::to_string(m_nValue);
+ }
+ else if(m_format == SVFromat::A20 || m_format == SVFromat::A50) {
+ strRet = m_strValue;
+ }
+
+ return strRet;
+ }
}
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/CVariable.h b/SourceCode/Bond/Servo/CVariable.h
index 7bac823..beeadd2 100644
--- a/SourceCode/Bond/Servo/CVariable.h
+++ b/SourceCode/Bond/Servo/CVariable.h
@@ -26,12 +26,17 @@
std::string& getName();
SVFromat getFormat();
std::string& getRemark();
+ void setValue(__int64 value);
+ void setValue(const char* pszValue);
+ std::string getValue();
private:
unsigned int m_nVarialbeId;
std::string m_strName;
SVFromat m_format;
std::string m_strRemark;
+ __int64 m_nValue;
+ std::string m_strValue;
};
}
diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 76bb93a..7a80fd5 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -256,12 +256,39 @@
return nullptr;
}
+SERVO::CVariable* CHsmsPassive::getVariable(const char* pszName)
+{
+ for (auto item : m_variabels) {
+ if (item->getName().compare(pszName) == 0) {
+ return item;
+ }
+ }
+
+ return nullptr;
+}
+
void CHsmsPassive::clearAllVariabel()
{
for (auto item : m_variabels) {
delete item;
}
m_variabels.clear();
+}
+
+void CHsmsPassive::setVariableValue(const char* pszName, __int64 value)
+{
+ auto v = getVariable(pszName);
+ if (v != nullptr) {
+ v->setValue(value);
+ }
+}
+
+void CHsmsPassive::setVariableValue(const char* pszName, const char* value)
+{
+ auto v = getVariable(pszName);
+ if (v != nullptr) {
+ v->setValue(value);
+ }
}
int CHsmsPassive::loadReports(const char* pszFilepath)
@@ -1095,7 +1122,7 @@
// 妫�楠岀粨鏋滄槸鍚︽纭�
for (auto item : m_collectionEvents) {
- LOGE("=== ceid:%d, prtid:%d", item->getEventId(), item->getPortID());
+ LOGE("=== ceid:%d, prtid:%d", item->getEventId(), item->getFirstPortID());
}
MYREPLY:
@@ -1450,15 +1477,19 @@
}
// S6F11
-int CHsmsPassive::requestEventReportSend(unsigned int DATAID, unsigned int CEID, const std::vector<std::string>& values)
+static unsigned int DATAID = 1;
+int CHsmsPassive::requestEventReportSend(unsigned int CEID)
{
SERVO::CCollectionEvent* pEvent = getEvent(CEID);
if (pEvent == nullptr) {
return ER_NO_EVENT;
}
- if (pEvent == nullptr) {
+
+ SERVO::CReport* pReport = pEvent->getFirstReport();
+ if (pReport == nullptr) {
return ER_UNLINK_EVENT_REPORT;
}
+
Lock();
CHsmsAction* pAction = new CHsmsAction(ACTION_EVENT_REPORT, TRUE, m_nActionTimeout);
@@ -1466,14 +1497,16 @@
HSMS_Create1Message(pMessage, m_nSessionId, 6 | REPLY, 11, ++m_nSystemByte);
ASSERT(pMessage);
ISECS2Item* pItem = pMessage->getBody();
- pItem->addU4Item(DATAID, "DATAID");
+ pItem->addU4Item(++DATAID, "DATAID");
pItem->addU4Item(CEID, "CEID");
ISECS2Item* pItemList1 = pItem->addItem();
ISECS2Item* pItemList2 = pItemList1->addItem();
- pItemList2->addU4Item(pEvent->getPortID(), "RPTID");
+ pItemList2->addU4Item(pReport->getReportId(), "RPTID");
ISECS2Item* pItemList3 = pItemList2->addItem();
+
+ auto values = pReport->getVariables();
for (auto item : values) {
- pItemList3->addItem(item.c_str(), "V");
+ pItemList3->addItem(item->getValue().c_str(), "V");
}
pAction->setSendMessage(pMessage);
if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
@@ -1488,5 +1521,26 @@
return ER_NOERROR;
}
+int CHsmsPassive::requestEventReportSend(const char* pszEventName)
+{
+ SERVO::CCollectionEvent* pEvent = nullptr;
+ for (auto e : m_collectionEvents) {
+ if (e->getName().compare(pszEventName) == 0) {
+ pEvent = e;
+ break;
+ }
+ }
+ if (pEvent == nullptr) {
+ return ER_NO_EVENT;
+ }
+ return requestEventReportSend(pEvent->getEventId());
+}
+
+int CHsmsPassive::requestEventReportSend_CarrierID_Readed()
+{
+ return requestEventReportSend("CarrierID_Readed");
+}
+
+
diff --git a/SourceCode/Bond/Servo/HsmsPassive.h b/SourceCode/Bond/Servo/HsmsPassive.h
index a08350e..f542cf7 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.h
+++ b/SourceCode/Bond/Servo/HsmsPassive.h
@@ -136,6 +136,11 @@
// 取得指定Variable
SERVO::CVariable* getVariable(int variableId);
+ SERVO::CVariable* getVariable(const char* pszName);
+
+ // 设置变量值
+ void setVariableValue(const char* pszName, __int64 value);
+ void setVariableValue(const char* pszName, const char* value);
// 从文件中加载CReport列表
int loadReports(const char* pszFilepath);
@@ -173,7 +178,9 @@
/* request开头的函数为主动发送数据的函数 */
int requestAreYouThere();
int requestAlarmReport(int ALCD, int ALID, const char* ALTX);
- int requestEventReportSend(unsigned int DATAID, unsigned int CEID, const std::vector<std::string>& values);
+ int requestEventReportSend(unsigned int CEID);
+ int requestEventReportSend(const char* pszEventName);
+ int requestEventReportSend_CarrierID_Readed();
private:
void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
diff --git a/SourceCode/Bond/Servo/Model.cpp b/SourceCode/Bond/Servo/Model.cpp
index 6cc7531..a65aa90 100644
--- a/SourceCode/Bond/Servo/Model.cpp
+++ b/SourceCode/Bond/Servo/Model.cpp
@@ -353,6 +353,13 @@
};
masterListener.onLoadPortStatusChanged = [&] (void* pMaster, SERVO::CEquipment* pEquipment, short status, __int64 data) {
LOGE("<CModel>onLoadPortStatusChanged. status = %d", status);
+ if (status == PORT_INUSE) {
+ SERVO::CLoadPort* pLoadPort = dynamic_cast<SERVO::CLoadPort*>(pEquipment);
+ if (pLoadPort != nullptr) {
+ m_hsmsPassive.setVariableValue("CarrierID", pLoadPort->getCassetteId().c_str());
+ }
+ m_hsmsPassive.requestEventReportSend_CarrierID_Readed();
+ }
notifyPtr(RX_CODE_LOADPORT_STATUS_CHANGED, pEquipment);
};
m_master.setListener(masterListener);
diff --git a/SourceCode/Bond/x64/Debug/CollectionEventList.txt b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
index 48df026..8732aaf 100644
--- a/SourceCode/Bond/x64/Debug/CollectionEventList.txt
+++ b/SourceCode/Bond/x64/Debug/CollectionEventList.txt
@@ -37,3 +37,4 @@
31032,CJobResume,,(31000)
40000,E90_SPSM_NoState_To_NeedsProcessing,,(40000)
40001,E90_SPSM_InProcess_To_ProcessCompleted,,(40000)
+50000,CarrierID_Readed,,(50000)
diff --git a/SourceCode/Bond/x64/Debug/ReportList.txt b/SourceCode/Bond/x64/Debug/ReportList.txt
index f614e93..fe7fc97 100644
--- a/SourceCode/Bond/x64/Debug/ReportList.txt
+++ b/SourceCode/Bond/x64/Debug/ReportList.txt
@@ -15,3 +15,5 @@
30000,(1,30000,30001)
31000,(1,31000,31001)
40000,(1,10203,20000)
+50000,(5000)
+
diff --git a/SourceCode/Bond/x64/Debug/VariableList.txt b/SourceCode/Bond/x64/Debug/VariableList.txt
index 5bb7d38..1a93f88 100644
--- a/SourceCode/Bond/x64/Debug/VariableList.txt
+++ b/SourceCode/Bond/x64/Debug/VariableList.txt
@@ -35,3 +35,4 @@
2023,OCREnable,U2,"OCR使能:O:开启 1:屏蔽"
2024,CCDEnable,U2,"CCD使能:O:开启 1:屏蔽"
2025,FFUParameter,U2,FFU设定值
+5000,CarrierID,A20,卡匣ID
--
Gitblit v1.9.3