From 7c35ff8d9a626f69a8a8b7de3d73dc9d73de9dd7 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期六, 13 九月 2025 10:51:32 +0800
Subject: [PATCH] 1. 解决读取报警文件错误的问题,提高兼容性(可能文件是在MacOS编辑的,导致换行符不一样)

---
 SourceCode/Bond/Servo/CEquipment.h |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.h b/SourceCode/Bond/Servo/CEquipment.h
index 27a448e..a469408 100644
--- a/SourceCode/Bond/Servo/CEquipment.h
+++ b/SourceCode/Bond/Servo/CEquipment.h
@@ -35,6 +35,8 @@
 #include "CProcessData.h"
 #include "CPortStatusReport.h"
 #include "CSlot.h"
+#include "CParam.h"
+#include "CSVData.h"
 
 
 namespace SERVO {
@@ -56,6 +58,7 @@
 	typedef std::function<void(void* pEiuipment, PROCESS_STATE state)> ONPROCESSSTATE;
 	typedef std::function<void(void* pEiuipment, short scanMap, short downMap)> ONMAPMISMATCH;
 	typedef std::function<void(void* pEiuipment, short status, __int64 data)> ONPORTSTATUSCHANGED;
+	
 	typedef struct _EquipmentListener
 	{
 		ONALIVE				onAlive;
@@ -68,7 +71,8 @@
 		ONPROCESSSTATE		onProcessStateChanged;
 		ONMAPMISMATCH		onMapMismatch;
 		ONPORTSTATUSCHANGED	onPortStatusChanged;
-
+		ONVCREVENTREPORT	onSVDataReport;
+		ONVCREVENTREPORT	onPanelDataReport;
 	} EquipmentListener;
 
 
@@ -122,6 +126,8 @@
 		std::vector<CPin*>& CEquipment::getInputPins();
 		std::vector<CPin*>& CEquipment::getOutputPins();
 		CRecipeList* getRecipeList(int unitNo);
+		bool saveRecipeList(int unitNo, std::string& strFilepath);
+		bool readRecipeList(int unitNo, std::string& strFilepath);
 		virtual int recvIntent(CPin* pPin, CIntent* pIntent);
 		virtual int fetchedOutJob(int port, CJobDataB* pJobDataB);
 		virtual int storedJob(int port, CJobDataB* pJobDataB, short putSlot);
@@ -155,7 +161,7 @@
 		int setDispatchingMode(DISPATCHING_MODE mode, ONWRITED onWritedBlock = nullptr);
 		int indexerOperationModeChange(IDNEXER_OPERATION_MODE mode, ONWRITEDRET onWritedRetBlock);
 		void printDebugString001();
-
+		std::vector<SERVO::CSVData>& getSVDatas();
 
 		// 请求主配方列表
 		// unitNo: 0:local; Others:unit No
@@ -165,7 +171,13 @@
 		// masterRecipeId: 主配方id
 		// localRecipeId: 本地配方id
 		// unitNo: 0:local; Others:unit No
-		int recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo);
+		int recipeParameterRequest(short masterRecipeId, short localRecipeId, short unitNo, ONSYNCINGSTATECHANGED block);
+
+		// 解析配方参数列表
+		virtual int parsingParams(const char* pszData, size_t size, std::vector<CParam>& params) { return 0;  };
+		virtual int parsingParams(const char* pszData, size_t size, std::string& strOut);
+		virtual int parsingProcessData(const char* pszData, size_t size, std::vector<CParam>& params) { return 0; };
+		virtual int parsingSVData(const char* pszData, size_t size, std::vector<CParam>& params) { return 0; };
 
 		// 获取指定的Slot
 		CSlot* getSlot(int index);
@@ -195,6 +207,7 @@
 		CGlass* getGlassWithCassette(int cassetteSequenceNo, int jobSequenceNo);
 		CGlass* getAnyGlass();
 		CGlass* getGlass(const char* pszGlassId);
+		int getAllGlass(std::vector<CGlass*>& glasses);
 		CJobDataS* getJobDataSWithCassette(int cassetteSequenceNo, int jobSequenceNo);
 
 		// 验证玻璃和槽是否匹配
@@ -202,6 +215,7 @@
 
 		// 是否有玻璃
 		BOOL hasGlass();
+		BOOL slotHasGlass(int slotIndex = 0);
 
 		// 指定槽位是否可以放置玻璃
 		BOOL canPlaceGlassInSlot(const short slotIndex);
@@ -253,6 +267,12 @@
 		int decodeJobProcessEndReport(CStep* pStep, const char* pszData, size_t size);
 		BOOL compareJobData(CJobDataB* pJobDataB, CJobDataS* pJobDataS);
 		void setProcessState(PROCESS_STATE state);
+		float toFloat(const char* pszAddr);
+
+	protected:
+		// 部分优化/简化代码、暂实现部分,到时平铺开
+		void addFacDataReportStep(int dataDev, int writeSignalDev, int port);
+
 
 	protected:
 		BOOL m_bEnable;
@@ -287,9 +307,13 @@
 		CRecipesManager m_recipesManager;
 		CSlot m_slot[SLOT_MAX];
 		PROCESS_STATE m_processState;
+		std::vector<SERVO::CSVData> m_svDatas;
 
 	private:
 		CEquipment* m_pArm;
+
+	public:
+		int m_nTestFlag;
 	};
 }
 

--
Gitblit v1.9.3