From 9c9100b078e9ac4ee7ed61500b4d7c7a74207549 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 08 一月 2026 10:32:44 +0800
Subject: [PATCH] 1.继续完善模拟测试等

---
 SourceCode/Bond/EAPSimulator/CHsmsActive.cpp |   92 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 87 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp b/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
index 7969e15..5b98173 100644
--- a/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
+++ b/SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
@@ -1,9 +1,9 @@
-#include "pch.h"
+锘�#include "pch.h"
 #include "CHsmsActive.h"
 #include "Log.h"
 
 
-static unsigned int DATAID = 1;
+static unsigned short DATAID = 1;
 
 CHsmsActive::CHsmsActive()
 {
@@ -64,7 +64,7 @@
 		HEADER* pHeader = pMessage->getHeader();
 		int nStream = (pHeader->stream & 0x7F);
 
-		TRACE("收到消息 S%dF%d================\n", pHeader->stream & 0x7F, pHeader->function);
+		TRACE("鏀跺埌娑堟伅 S%dF%d================\n", pHeader->stream & 0x7F, pHeader->function);
 		TRACE("Body:%s\n", pMessage->toString());
 		LOGI("onRecvDataMessage(%s).", pMessage->toString());
 
@@ -349,12 +349,50 @@
 	return hsmsCarrierActionRequest(DATAID, "CarrierRelease", pszCarrierId, PTN);
 }
 
+int CHsmsActive::hsmsProceedWithSlotMap(unsigned int DATAID,
+	const char* pszCarrierId,
+	unsigned char PTN,
+	const char* pszLotId,
+	const std::vector<std::string>& panelIds,
+	const std::vector<unsigned char>& slotMap)
+{
+	IMessage* pMessage = nullptr;
+	int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 3 | REPLY, 17, ++m_nSystemByte);
+	if (nRet != 0 || pMessage == nullptr) {
+		return nRet;
+	}
+
+	pMessage->getBody()->addU4Item(DATAID, "DATAID");
+	pMessage->getBody()->addItem("ProceedWithSlotMap", "CARRIERACTION");
+	pMessage->getBody()->addItem(pszCarrierId, "CARRIERID");
+	pMessage->getBody()->addU1Item(PTN, "PTN");
+
+	// Extended params (currently not parsed by Servo side): { LOTID, PANELID_LIST, SLOTMAP_LIST }
+	ISECS2Item* pParams = pMessage->getBody()->addItem(); // L
+	pParams->addItem(pszLotId != nullptr ? pszLotId : "", "LOTID");
+
+	ISECS2Item* pPanelList = pParams->addItem(); // L
+	for (const auto& id : panelIds) {
+		pPanelList->addItem(id.c_str(), "PANELID");
+	}
+
+	ISECS2Item* pSlotMapList = pParams->addItem(); // L
+	for (auto v : slotMap) {
+		pSlotMapList->addU1Item(v, "SLOTSTATE");
+	}
+
+	m_pActive->sendMessage(pMessage);
+	HSMS_Destroy1Message(pMessage);
+
+	return 0;
+}
+
 int CHsmsActive::hsmsPRJobMultiCreate(std::vector<SERVO::CProcessJob*>& pjs)
 {
 	IMessage* pMessage = nullptr;
 	int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 16 | REPLY, 15, ++m_nSystemByte);
 	char szMF[32] = {14};
-	pMessage->getBody()->addU4Item(++DATAID, "DATAID");
+	pMessage->getBody()->addU2Item(++DATAID, "DATAID");
 	auto itemPjs = pMessage->getBody()->addItem();
 	for (auto pj : pjs) {
 		auto itemPj = itemPjs->addItem();
@@ -385,12 +423,56 @@
 	return 0;
 }
 
+int CHsmsActive::hsmsCreateControlJob(const char* pszControlJobId, std::vector<std::string>& processJobIds)
+{
+	char szBuffer[256];
+	sprintf_s(szBuffer, 256, "ControlJob:%s>", pszControlJobId);
+
+	IMessage* pMessage = nullptr;
+	int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 14 | REPLY, 9, ++m_nSystemByte);
+	pMessage->getBody()->addItem(szBuffer, "OBJSPEC");
+	pMessage->getBody()->addItem("ControlJob", "OBJTYPE");
+	auto itemAttrs = pMessage->getBody()->addItem();
+
+	{
+		auto itemAttr = itemAttrs->addItem();
+		itemAttr->addItem("Priority", "ATTRID");
+		itemAttr->addU1Item(8, "ATTRDATA");
+	}
+
+	{
+		auto itemAttr = itemAttrs->addItem();
+		itemAttr->addItem("weight", "ATTRID");
+		itemAttr->addF4Item(60.5, "ATTRDATA");
+	}
+
+	{
+		auto itemAttr = itemAttrs->addItem();
+		itemAttr->addItem("tel", "ATTRID");
+		itemAttr->addItem("15919875007", "ATTRDATA");
+	}
+
+	{
+		auto itemAttr = itemAttrs->addItem();
+		itemAttr->addItem("PRJOBLIST", "ATTRID");
+		auto itemProcessJobs = itemAttr->addItem();
+		for (auto& item : processJobIds) {
+			itemProcessJobs->addItem(item.c_str(), "");
+		}
+	}
+
+	m_pActive->sendMessage(pMessage);
+	HSMS_Destroy1Message(pMessage);
+
+	return 0;
+}
+
 int CHsmsActive::replyAck0(IMessage* pMessage)
 {
 	return 0;
 }
 
-// 通用的reply ack函数
+// 閫氱敤鐨剅eply ack鍑芥暟
 void CHsmsActive::replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName)
 {
 	IMessage* pMessage = NULL;

--
Gitblit v1.9.3