From abeaf384ca65153fa9c66f8953cd0f68ad5f9f9f Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 11 十一月 2025 11:23:42 +0800
Subject: [PATCH] 1.曲线图前烘拆分为AB腔。 2.曲线图后烘拆分为AB腔。

---
 SourceCode/Bond/Servo/CServoUtilsTool.h   |    9 ++
 SourceCode/Bond/Servo/CServoUtilsTool.cpp |   69 +++++++++--------
 SourceCode/Bond/Servo/CMaster.cpp         |  115 ++++++++++++++++++++--------
 SourceCode/Bond/Servo/CMaster.h           |    1 
 4 files changed, 129 insertions(+), 65 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index eb4a392..610ec95 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -1543,12 +1543,14 @@
 			LOGI("<Master>onProcessStateChanged<%d>", (int)state);
 			if (state == PROCESS_STATE::Processing) {
 				if (pGlass != nullptr) {
-					m_pCollector->batchStart(eqid,
+					m_pCollector->batchStart(SlotToMid(eqid, slotNo),
 						pGlass->getID().c_str(), 10 * 60 * 1000ULL);
 				}
 			}
 			else if (state == PROCESS_STATE::Complete) {
-				m_pCollector->batchStop(eqid);
+				if (pGlass != nullptr) {
+					m_pCollector->batchStop(SlotToMid(eqid, slotNo));
+				}
 			}
 		};
 		listener.onMapMismatch = [&](void* pEquipment, short scanMap, short downMap) {
@@ -1643,14 +1645,14 @@
 
 				CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(2);
 				auto& dataTypes = CServoUtilsTool::getEqDataTypes();
-				auto& bonderTypes = dataTypes[eqid];
+				auto& bonderTypes = dataTypes[SlotToMid(eqid, 2)];
 				for (const auto& mapping : bonderMapping) {
 					int paramIndex = mapping.first;
 					int channel = mapping.second;
 
 					if (paramIndex < params.size() && channel - 1 < bonderTypes.size()) {
 						if(m_pCollector != nullptr)
-							m_pCollector->buffersPush(eqid, channel, ts, params.at(paramIndex).getDoubleValue());
+							m_pCollector->buffersPush(SlotToMid(eqid, 2), channel, ts, params.at(paramIndex).getDoubleValue());
 						if(pGlass != nullptr)
 							pGlass->addSVData(eqid, bonderTypes[channel - 1], ts, params.at(paramIndex).getDoubleValue());
 					}
@@ -1667,21 +1669,30 @@
 				CGlass* pGlass1 = ((CEquipment*)pEquipment)->getGlassFromSlot(1);
 				CGlass* pGlass2 = ((CEquipment*)pEquipment)->getGlassFromSlot(2);
 				auto& dataTypes = CServoUtilsTool::getEqDataTypes();
-				auto& vacuumbakeTypes = dataTypes[eqid];
+				auto& vacuumbakeTypes = dataTypes[SlotToMid(eqid, 1)];
 				LOGD("<Master>onSVDataReport 003 : %d", vacuumMapping.size());
 				for (const auto& mapping : vacuumMapping) {
 					int paramIndex = mapping.first;
 					int channel = mapping.second;
 
 					if (paramIndex < params.size() && channel - 1 < vacuumbakeTypes.size()) {
-						double value = params.at(paramIndex).getDoubleValue();
+						auto& param = params.at(paramIndex);
+						double value = param.getDoubleValue();
 						const std::string& dataType = vacuumbakeTypes[channel - 1];
-						if (m_pCollector != nullptr)
-							m_pCollector->buffersPush(eqid, channel, ts, value);
+						const std::string& paramName = param.getName();
+						const char slotTag = !paramName.empty() ? paramName[0] : '\0';
+
+						if (m_pCollector != nullptr) {
+							if (slotTag == 'A')
+								m_pCollector->buffersPush(SlotToMid(eqid, 1), channel, ts, value);
+							else if (slotTag == 'B')
+								m_pCollector->buffersPush(SlotToMid(eqid, 2), channel, ts, value);
+						}
+
 						// 鏍规嵁鑵斾綋鍓嶇紑鍐欏叆瀵瑰簲 Slot 鐨勭幓鐠�
-						if (pGlass1 != nullptr && !dataType.empty() && dataType[0] == 'A')
+						if (pGlass1 != nullptr && !dataType.empty() && slotTag == 'A')
 							pGlass1->addSVData(eqid, dataType, ts, value);
-						if (pGlass2 != nullptr && !dataType.empty() && dataType[0] == 'B')
+						if (pGlass2 != nullptr && !dataType.empty() && slotTag == 'B')
 							pGlass2->addSVData(eqid, dataType, ts, value);
 					}
 				}
@@ -1699,7 +1710,7 @@
 				CGlass* pGlass3 = ((CEquipment*)pEquipment)->getGlassFromSlot(3); // B Bake
 				CGlass* pGlass4 = ((CEquipment*)pEquipment)->getGlassFromSlot(4); // B Cool
 				auto& dataTypes = CServoUtilsTool::getEqDataTypes();
-				auto& coolingTypes = dataTypes[eqid];
+				auto& coolingTypes = dataTypes[SlotToMid(eqid, 1)];
 				LOGD("<Master>onSVDataReport 003B : %d", coolingMapping.size());
 				auto addToGlass = [&](CGlass* glass, const std::string& type, double val) {
 					if (glass != nullptr)
@@ -1710,24 +1721,33 @@
 					int channel = mapping.second;
 
 					if (paramIndex < params.size() && channel - 1 < coolingTypes.size()) {
-						double value = params.at(paramIndex).getDoubleValue();
+						auto& param = params.at(paramIndex);
+						double value = param.getDoubleValue();
 						const std::string& dataType = coolingTypes[channel - 1];
-						if (m_pCollector != nullptr)
-							m_pCollector->buffersPush(eqid, channel, ts, value);
+						const std::string& paramName = param.getName();
+						const char slotTag = !paramName.empty() ? paramName[0] : '\0';
+						const bool paramIsBake = paramName.find("鐑樼儰") != std::string::npos;
+						const bool paramIsCooling = paramName.find("鍐峰嵈") != std::string::npos;
+
+						if (m_pCollector != nullptr && paramIsBake) {
+							if (slotTag == 'A')
+								m_pCollector->buffersPush(SlotToMid(eqid, 1), channel, ts, value);
+							else if (slotTag == 'B')
+								m_pCollector->buffersPush(SlotToMid(eqid, 3), channel, ts, value);
+						}
+
 						if (!dataType.empty()) {
-							const bool isBake = dataType.find("鐑樼儰") != std::string::npos;
-							const bool isCooling = dataType.find("鍐峰嵈") != std::string::npos;
-							switch (dataType[0]) {
+							switch (slotTag) {
 							case 'A':
-								if (isBake)
+								if (paramIsBake)
 									addToGlass(pGlass1, dataType, value);
-								else if (isCooling)
+								else if (paramIsCooling)
 									addToGlass(pGlass2, dataType, value);
 								break;
 							case 'B':
-								if (isBake)
+								if (paramIsBake)
 									addToGlass(pGlass3, dataType, value);
-								else if (isCooling)
+								else if (paramIsCooling)
 									addToGlass(pGlass4, dataType, value);
 								break;
 							default:
@@ -3174,29 +3194,60 @@
 
 			// 1) 娉ㄥ唽鏈哄彴锛堟帹鑽愶細鍏堟敞鍐� id + 鏈哄櫒鍚嶇О锛�
 			RetentionPolicy defP; defP.mode = RetainMode::ByCount; defP.maxSamples = 200;
-			m_pCollector->registryAddMachine(EQ_ID_Bonder1, "Bonder1", defP);
-			m_pCollector->registryAddMachine(EQ_ID_Bonder2, "Bonder2", defP);
-			m_pCollector->registryAddMachine(EQ_ID_VACUUMBAKE, "鍓嶇儤鐑�", defP);
-			m_pCollector->registryAddMachine(EQ_ID_BAKE_COOLING, "鐑樼儰鍐峰嵈", defP);
+			m_pCollector->registryAddMachine(MID_Bonder1, "Bonder1", defP);
+			m_pCollector->registryAddMachine(MID_Bonder2, "Bonder2", defP);
+			m_pCollector->registryAddMachine(MID_VacuumBakeA, "鍓嶇儤-A", defP);
+			m_pCollector->registryAddMachine(MID_VacuumBakeB, "鍓嶇儤-B", defP);
+			m_pCollector->registryAddMachine(MID_BakeCoolingA, "鍚庣儤-A", defP);
+			m_pCollector->registryAddMachine(MID_BakeCoolingB, "鍚庣儤-B", defP);
 
 
 			// 2) 涓洪�氶亾璁剧疆鈥滄洸绾垮悕绉扳��
 			auto& dataTypes = CServoUtilsTool::getEqDataTypes();
-			auto& bonderTypes = dataTypes[EQ_ID_Bonder1];
+			auto& bonderTypes = dataTypes[MID_Bonder1];
 			for (size_t i = 0; i < bonderTypes.size(); ++i) {
-				m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, i + 1, bonderTypes[i].c_str());
-				m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, i + 1, bonderTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_Bonder1, i + 1, bonderTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_Bonder2, i + 1, bonderTypes[i].c_str());
 			}
 
-			auto& vacuumbakeTypes = dataTypes[EQ_ID_VACUUMBAKE];
+			auto& vacuumbakeTypes = dataTypes[MID_VacuumBakeA];
 			for (size_t i = 0; i < vacuumbakeTypes.size(); ++i) {
-				m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, i + 1, vacuumbakeTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_VacuumBakeA, i + 1, vacuumbakeTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_VacuumBakeB, i + 1, vacuumbakeTypes[i].c_str());
 			}
 
-			auto& coolingTypes = dataTypes[EQ_ID_BAKE_COOLING];
+			auto& coolingTypes = dataTypes[MID_BakeCoolingA];
 			for (size_t i = 0; i < coolingTypes.size(); ++i) {
-				m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, i + 1, coolingTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_BakeCoolingA, i + 1, coolingTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_BakeCoolingB, i + 1, coolingTypes[i].c_str());
 			}
 		}
 	}
+
+	uint32_t CMaster::SlotToMid(int eqid, int slot)
+	{
+		if (eqid == EQ_ID_Bonder1) {
+			return MID_Bonder1;
+		}
+
+		if (eqid == EQ_ID_Bonder2) {
+			return MID_Bonder2;
+		}
+
+		if (eqid == EQ_ID_VACUUMBAKE) {
+			if(slot == 1)
+				return MID_VacuumBakeA;
+			if (slot == 2)
+				return MID_VacuumBakeB;
+		}
+
+		if (eqid == EQ_ID_BAKE_COOLING) {
+			if (slot == 1)
+				return MID_BakeCoolingA;
+			if (slot == 3)
+				return MID_BakeCoolingB;
+		}
+
+		return 0;
+	}
 }
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index e2844bd..29d413c 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -139,6 +139,7 @@
         int getPortCassetteSnSeed(int port);
         void setPortCassetteSnSeed(int port, int seed);
         CGlass* getGlass(int scrPort, int scrSlot);
+        uint32_t SlotToMid(int eqid, int slot);
 
     private:
         inline void lock() { EnterCriticalSection(&m_criticalSection); }
diff --git a/SourceCode/Bond/Servo/CServoUtilsTool.cpp b/SourceCode/Bond/Servo/CServoUtilsTool.cpp
index c9d06f6..94bb8f7 100644
--- a/SourceCode/Bond/Servo/CServoUtilsTool.cpp
+++ b/SourceCode/Bond/Servo/CServoUtilsTool.cpp
@@ -1,32 +1,37 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
 #include "CServoUtilsTool.h"
 #include "Common.h"
 
 
 namespace SERVO {
 	static std::unordered_map<int, std::vector<std::string>> EQ_DATA_TYPES = {
-		{EQ_ID_Bonder1, {
-			"气囊压力", "上腔压力", "管道真空规值", "腔体真空规值",
-			"上腔温度1", "上腔温度2", "上腔温度3", "上腔温度4",
-			"上腔温度5", "上腔温度6", "下腔温度1", "下腔温度2",
-			"下腔温度3", "下腔温度4", "下腔温度5", "下腔温度6"
+		{MID_Bonder1, {
+			"姘斿泭鍘嬪姏", "涓婅厰鍘嬪姏", "绠¢亾鐪熺┖瑙勫��", "鑵斾綋鐪熺┖瑙勫��",
+			"涓婅厰娓╁害1", "涓婅厰娓╁害2", "涓婅厰娓╁害3", "涓婅厰娓╁害4",
+			"涓婅厰娓╁害5", "涓婅厰娓╁害6", "涓嬭厰娓╁害1", "涓嬭厰娓╁害2",
+			"涓嬭厰娓╁害3", "涓嬭厰娓╁害4", "涓嬭厰娓╁害5", "涓嬭厰娓╁害6"
 		}},
-		{EQ_ID_Bonder2, {
-			"气囊压力", "上腔压力", "管道真空规值", "腔体真空规值",
-			"上腔温度1", "上腔温度2", "上腔温度3", "上腔温度4",
-			"上腔温度5", "上腔温度6", "下腔温度1", "下腔温度2",
-			"下腔温度3", "下腔温度4", "下腔温度5", "下腔温度6"
+		{MID_Bonder2, {
+			"姘斿泭鍘嬪姏", "涓婅厰鍘嬪姏", "绠¢亾鐪熺┖瑙勫��", "鑵斾綋鐪熺┖瑙勫��",
+			"涓婅厰娓╁害1", "涓婅厰娓╁害2", "涓婅厰娓╁害3", "涓婅厰娓╁害4",
+			"涓婅厰娓╁害5", "涓婅厰娓╁害6", "涓嬭厰娓╁害1", "涓嬭厰娓╁害2",
+			"涓嬭厰娓╁害3", "涓嬭厰娓╁害4", "涓嬭厰娓╁害5", "涓嬭厰娓╁害6"
 		}},
-		{EQ_ID_VACUUMBAKE, {
-			"A腔真空规值", "A腔温控1", "A腔温控2", "A腔温控4",
-			"A腔温控5", "A腔温控6", "A腔温控7", "B腔真空规值",
-			"B腔温控1", "B腔温控2", "B腔温控4", "B腔温控5",
-			"B腔温控6", "B腔温控7"
+		{MID_VacuumBakeA, {
+			"鐪熺┖瑙勫��", "娓╂帶1", "娓╂帶2", "娓╂帶4",
+			"娓╂帶5", "娓╂帶6", "娓╂帶7"
 		}},
-		{EQ_ID_BAKE_COOLING, {
-			"A烘烤温控1", "A烘烤温控2", "A烘烤温控4", "A烘烤温控5",
-			"A烘烤温控6", "A烘烤温控7", "B烘烤温控1", "B烘烤温控2",
-			"B烘烤温控4", "B烘烤温控5", "B烘烤温控6", "B烘烤温控7"
+		{MID_VacuumBakeB, {
+			"鐪熺┖瑙勫��", "娓╂帶1", "娓╂帶2", "娓╂帶4",
+			"娓╂帶5", "娓╂帶6", "娓╂帶7"
+		}},
+		{MID_BakeCoolingA, {
+			"鐑樼儰娓╂帶1", "鐑樼儰娓╂帶2", "鐑樼儰娓╂帶4", "鐑樼儰娓╂帶5",
+			"鐑樼儰娓╂帶6", "鐑樼儰娓╂帶7"
+		}},
+		{MID_BakeCoolingB, {
+			"鐑樼儰娓╂帶1", "鐑樼儰娓╂帶2", "鐑樼儰娓╂帶4", "鐑樼儰娓╂帶5",
+			"鐑樼儰娓╂帶6", "鐑樼儰娓╂帶7"
 		}}
 	};
 
@@ -98,8 +103,8 @@
 		}
 
 		if (eqid == EQ_ID_VACUUMBAKE) {
-			if (unit == 0) return "烘烤A腔";
-			if (unit == 1) return "烘烤B腔";
+			if (unit == 0) return "鐑樼儰A鑵�";
+			if (unit == 1) return "鐑樼儰B鑵�";
 		}
 
 		if (eqid == EQ_ID_Bonder1) {
@@ -112,10 +117,10 @@
 
 		if (eqid == EQ_ID_BAKE_COOLING) {
 
-			if (unit == 0) return "后烘烤A腔";
-			if (unit == 1) return "冷却A";
-			if (unit == 2) return "后烘烤B腔";
-			if (unit == 3) return "冷却B";
+			if (unit == 0) return "鍚庣儤鐑鑵�";
+			if (unit == 1) return "鍐峰嵈A";
+			if (unit == 2) return "鍚庣儤鐑鑵�";
+			if (unit == 3) return "鍐峰嵈B";
 		}
 
 		if (eqid == EQ_ID_MEASUREMENT) {
@@ -156,11 +161,11 @@
 
 		if (eqid == EQ_ID_VACUUMBAKE) {
 			if (unit == 0) {
-				sprintf_s(szBuffer, 256, "烘烤A腔(Slot%d)", slot);
+				sprintf_s(szBuffer, 256, "鐑樼儰A鑵�(Slot%d)", slot);
 				return std::string(szBuffer);
 			}
 			if (unit == 1) {
-				sprintf_s(szBuffer, 256, "烘烤B腔(Slot%d)", slot);
+				sprintf_s(szBuffer, 256, "鐑樼儰B鑵�(Slot%d)", slot);
 				return std::string(szBuffer);
 			}
 		}
@@ -177,10 +182,10 @@
 
 		if (eqid == EQ_ID_BAKE_COOLING) {
 
-			if (slot == 0) return "后烘烤A腔";
-			if (slot == 1) return "冷却A";
-			if (slot == 2) return "后烘烤B腔";
-			if (slot == 3) return "冷却B";
+			if (slot == 0) return "鍚庣儤鐑鑵�";
+			if (slot == 1) return "鍐峰嵈A";
+			if (slot == 2) return "鍚庣儤鐑鑵�";
+			if (slot == 3) return "鍐峰嵈B";
 		}
 
 		if (eqid == EQ_ID_MEASUREMENT) {
diff --git a/SourceCode/Bond/Servo/CServoUtilsTool.h b/SourceCode/Bond/Servo/CServoUtilsTool.h
index 2945984..06b167c 100644
--- a/SourceCode/Bond/Servo/CServoUtilsTool.h
+++ b/SourceCode/Bond/Servo/CServoUtilsTool.h
@@ -1,9 +1,16 @@
-#pragma once
+锘�#pragma once
 #include "ServoCommo.h"
 #include "CGlass.h"
 
 
 namespace SERVO {
+	constexpr uint32_t MID_Bonder1 = 1001;
+	constexpr uint32_t MID_Bonder2 = 1002;
+	constexpr uint32_t MID_VacuumBakeA = 1003;
+	constexpr uint32_t MID_VacuumBakeB = 1004;
+	constexpr uint32_t MID_BakeCoolingA = 1005;
+	constexpr uint32_t MID_BakeCoolingB = 1006;
+
 	class CServoUtilsTool
 	{
 	public:

--
Gitblit v1.9.3