From 9ad04a15d7f9438cf3e5f1b69b8d458ae767bdf5 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期六, 26 四月 2025 18:06:39 +0800
Subject: [PATCH] 1.CReadStep增加写入返回值或数据的功能;

---
 SourceCode/Bond/Servo/CEquipment.h |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index a740c89..b041c86 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -15,6 +15,10 @@
 #include "CEqVCREnableStep.h"
 #include "CEqPortChangeStep.h"
 #include "CEqReadIntStep.h"
+#include "CEqCassetteTransferStateStep.h"
+#include "CEqCassetteCtrlCmdStep.h"
+#include "CEqJobEventStep.h"
+#include "CEqVcrEventStep.h"
 #include <vector>
 #include <map>
 #include <list>
@@ -28,11 +32,15 @@
 
 	typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE;
 	typedef std::function<void(void* pEiuipment, int code)> ONDATACHANGED;
+	typedef std::function<void(void* pEiuipment, int state, int alarmId, int unitId, int level)> ONALARM;
+	typedef std::function<void(void* pEiuipment, void* pReport)> ONVCREVENTREPORT;
 	typedef struct _EquipmentListener
 	{
 		ONALIVE				onAlive;
 		ONALIVE				onCimStateChanged;
+		ONALARM				onAlarm;
 		ONDATACHANGED		onDataChanged;
+		ONVCREVENTREPORT	onVcrEventReport;
 	} EquipmentListener;
 
 	// Memory Block 结构体定义
@@ -88,6 +96,7 @@
 		virtual void onTimer(UINT nTimerid);
 		virtual void serialize(CArchive& ar);
 		virtual void onReceiveLBData(const char* pszData, size_t size);
+		virtual int onStepEvent(CStep* pStep, int code);
 		virtual CPin* addPin(PinType type, char* pszName);
 		CPin* getPin(char* pszName);
 		std::vector<CPin*>& CEquipment::getInputPins();
@@ -99,6 +108,15 @@
 		void getGlassList(std::list<CGlass*>& list);
 		CGlass* getFrontGlass();
 		BOOL removeClass(CGlass* pGlass);
+		bool isAlarmStep(SERVO::CStep* pStep);
+		bool isVcrEventStep(SERVO::CStep* pStep);
+		bool isCassetteTransferStateStep(SERVO::CStep* pStep);
+		bool isCimMessageConfirmStep(SERVO::CStep* pStep);
+		int setEqMode(short mode);
+		int setCimMode(BOOL bOn);
+		int setCimMessage(const char* pszMessage, short id, short nTouchPanelNo);
+		int clearCimMessage(short id, short nTouchPanelNo);
+		int setDateTime(short year, short month, short day, short hour, short minute, short second);
 
 	// 以下为从CC-Link读取到的Bit标志位检测函数
 	public:
@@ -114,8 +132,6 @@
 	private:
 		BOOL isBitOn(const char* pszData, size_t size, int index);
 		inline BOOL equalBool(BOOL b1, BOOL b2);
-		void checkReadStepSignal(unsigned int addr, const char* pszData, size_t size);
-		void checkWriteStepSignal(unsigned int addr, const char* pszData, size_t size);
 
 	protected:
 		inline void Lock() { EnterCriticalSection(&m_criticalSection); }
@@ -137,7 +153,7 @@
 
 
 		// 以下为从CC-Link读取到的Bit标志位
-	private:
+	protected:
 		ALIVE m_alive;
 		BOOL m_bCimState;			// ON/OFF
 		BOOL m_bUpstreamInline;
@@ -146,7 +162,7 @@
 		BOOL m_bAutoRecipeChange;
 		BOOL m_bVCREnable[VCR_MAX];
 
-	private:
+	protected:
 		CCCLinkIEControl* m_pCclink;
 		std::map<unsigned int, CStep*> m_mapStep;
 		int m_nBaseAlarmId;

--
Gitblit v1.9.3