From 3426d4e0ee09c61ce379cfd1fe9a6e82de346d90 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 29 四月 2025 10:58:51 +0800
Subject: [PATCH] 1.增加CEqCurrentRecipeChangeStep

---
 SourceCode/Bond/Servo/CEFEM.cpp |   81 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 78 insertions(+), 3 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEFEM.cpp b/SourceCode/Bond/Servo/CEFEM.cpp
index 665aa25..635b445 100644
--- a/SourceCode/Bond/Servo/CEFEM.cpp
+++ b/SourceCode/Bond/Servo/CEFEM.cpp
@@ -1,10 +1,14 @@
 #include "stdafx.h"
 #include "CEFEM.h"
 
-namespace SERVO {
-	CEFEM::CEFEM()
-	{
 
+namespace SERVO {
+	CEFEM::CEFEM() : CEquipment()
+	{
+		m_pPort[0] = nullptr;
+		m_pPort[1] = nullptr;
+		m_pPort[2] = nullptr;
+		m_pPort[3] = nullptr;
 	}
 
 	CEFEM::~CEFEM()
@@ -18,6 +22,13 @@
 		return pszName;
 	}
 
+	void CEFEM::setPort(unsigned int index, CLoadPort* pPort)
+	{
+		if (index < 4) {
+			m_pPort[index] = pPort;
+		}
+	}
+
 	void CEFEM::init()
 	{
 		CEquipment::init();
@@ -28,6 +39,39 @@
 		CEquipment::term();
 	}
 
+	// 必须要实现的虚函数,在此初始化Pin列表
+	void CEFEM::initPins()
+	{
+		// 加入Pin初始化代码
+		LOGI("<CEFEM>initPins");
+	}
+
+	int CEFEM::onStepEvent(CStep* pStep, int code)
+	{
+		int nRet = CEquipment::onStepEvent(pStep, code);
+		if (nRet > 0) return nRet;
+
+		if (code == STEP_EVENT_READDATA) {
+			if (isCassetteTransferStateStep(pStep)) {
+				SERVO::CEqCassetteTransferStateStep* pEqCassetteStep = (SERVO::CEqCassetteTransferStateStep*)pStep;
+				int id = pEqCassetteStep->getID();
+				if (id == STEP_ID_PORT1_CASSETTIE_EMPTY) {
+
+				}
+/*
+	#define STEP_ID_PORT1_CASSETTIE_LOAD_READY		0x420
+	#define STEP_ID_PORT1_CASSETTIE_LOADED			0x428
+	#define STEP_ID_PORT1_CASSETTIE_INUSE			0x430
+	#define STEP_ID_PORT1_CASSETTIE_UNLOAD_READY	0x438
+	#define STEP_ID_PORT1_CASSETTIE_BLOCKED			0x440
+*/
+			}
+		}
+
+
+		return 0;
+	}
+
 	void CEFEM::onTimer(UINT nTimerid)
 	{
 		CEquipment::onTimer(nTimerid);
@@ -37,4 +81,35 @@
 	{
 		CEquipment::serialize(ar);
 	}
+
+	void CEFEM::getAttributeVector(CAttributeVector& attrubutes)
+	{
+		__super::getAttributeVector(attrubutes);
+	}
+
+	int CEFEM::recvIntent(CPin* pPin, CIntent* pIntent)
+	{
+		return __super::recvIntent(pPin, pIntent);
+	}
+
+	BOOL CEFEM::glassWillArrive(CGlass* pGlass)
+	{
+		BOOL bRet = __super::glassWillArrive(pGlass);
+		if (!bRet) {
+			return FALSE;
+		}
+
+		return m_glassList.empty();
+	}
+
+	void CEFEM::onReceiveLBData(const char* pszData, size_t size)
+	{
+		__super::onReceiveLBData(pszData, size);
+
+		for (unsigned int i = 0; i < 4; i++) {
+			if (m_pPort[i] != nullptr) {
+				m_pPort[i]->onReceiveLBData(pszData, size);
+			}
+		}
+	}
 }

--
Gitblit v1.9.3