From 5b6e648814aa829706cb94e6c44766ee9a6d9f12 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 28 五月 2025 11:06:47 +0800
Subject: [PATCH] 1.机器槽位信息设计(CSlot)

---
 SourceCode/Bond/Servo/CEquipment.h |   85 +++++++-----------------------------------
 1 files changed, 15 insertions(+), 70 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 81b7bc0..7bdc2b8 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -1,5 +1,6 @@
 #pragma once
 #include "Log.h"
+#include "ServoCommo.h"
 #include "CCLinkIEControl.h"
 #include "CSample.h"
 #include "CPin.h"
@@ -32,12 +33,12 @@
 #include "CJobDataC.h"
 #include "CJobDataS.h"
 #include "CProcessData.h"
+#include "CPortStatusReport.h"
+#include "CSlot.h"
 
 
 namespace SERVO {
-#define BLOCK_BUFFER_MAX			1024
-#define ALIVE_TIMEOUT				15
-#define VCR_MAX						1
+#define SLOT_MAX		12
 
 	typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE;
 	typedef std::function<void(void* pEiuipment, int code)> ONDATACHANGED;
@@ -52,78 +53,12 @@
 		ONVCREVENTREPORT	onVcrEventReport;
 	} EquipmentListener;
 
-	// Memory Block 结构体定义
-	typedef struct _MemoryBlock {
-		unsigned int type;
-		unsigned int start;
-		unsigned int end;
-		unsigned int size;
-		char buffer[BLOCK_BUFFER_MAX];
-	} MemoryBlock;
-
-	// ALIVE
-	typedef struct _ALIVE {
-		BOOL flag;
-		int count;
-		BOOL alive;
-	} ALIVE;
-
-	enum DISPATCHING_MODE {
-		EAS = 1,
-		Local = 2
-	};
-
-	enum IDNEXER_OPERATION_MODE {
-		Normal = 1,
-		Clear_Out = 2,
-		Cold_Run = 2,
-		Start = 10,
-		Stop = 11,
-		Pause = 12,
-		Resume = 13,
-		Abort = 14,
-		Cancel = 15,
-	};
-
-	enum RCMD {
-		Robot_home = 1,
-		Transfer, 
-		Move,
-		Get,
-		Put,
-		One_Action_Exchange,
-		Two_Action_Exchange,
-		Command_Clear,
-		Batch_get,
-		Batch_put
-	};
-
-	enum VCR_Reply_Code {
-		OK = 1,
-		NG,
-		Job_Data_Request,
-		VCR_Mismatch
-	};
-
-	// Robot cmd param
-#define ROBOT_CMD_PARAM_SIZE		16			/* 防止以后修改ROBOT_CMD_PARAM为不是4的整数倍 */
-	typedef struct _ROBOT_CMD_PARAM {
-		short sequenceNo;
-		short rcmd;
-		short armNo;
-		short getPosition;
-		short putPosition;
-		short getSlotNo;
-		short putSlotNo;
-		short subCmd;
-	} ROBOT_CMD_PARAM;
 
 	class CEquipment
 	{
 	public:
 		CEquipment();
 		virtual ~CEquipment();
-
 
 	public:
 		virtual const char* getClassName() = 0;
@@ -156,6 +91,7 @@
 		virtual void term();
 		virtual void initPins() = 0;
 		virtual void initSteps();
+		virtual void initSlots() = 0;
 		virtual void onTimer(UINT nTimerid);
 		virtual void serialize(CArchive& ar);
 		virtual void onReceiveLBData(const char* pszData, size_t size);
@@ -212,9 +148,17 @@
 		// unitNo: 0:local; Others:unit No
 		int recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo);
 
+		// 获取一个可用的槽位
+		CSlot* getAvailableSlot();
+
+		// 获取一个指定物料类型(G1,G2,G1&G2)的空槽位
+		CSlot* getEmptySlot(MaterialsType type);
+
+		// 获取一个指定物料类型(G1,G2,G1&G2)的非空槽位
+		CSlot* getNonEmptySlot(MaterialsType type);
+
 	public:
 		BOOL isGlassListEmpty();
-
 
 	// 以下为从CC-Link读取到的Bit标志位检测函数
 	public:
@@ -276,6 +220,7 @@
 		std::map<unsigned int, CStep*> m_mapStep;
 		int m_nBaseAlarmId;
 		CRecipesManager m_recipesManager;
+		CSlot m_slot[SLOT_MAX];
 
 	private:
 		CEquipment* m_pArm;

--
Gitblit v1.9.3