From bea6407b376a4e426f0b120bae569fba6ab867db Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 08 十一月 2025 17:55:47 +0800
Subject: [PATCH] 1.CMaster.cpp 第 1644/1667/1691 行在记录 SV 曲线时通过 getGlassFromSlot(0) 取玻璃,而各设备的 initSlots() 都是从 1 开始编号(例如 CBonder.cpp (line 408)、CVacuumBake.cpp (line 415) 等)。槽位 0 永远不存在,所以 pGlass 始终是 nullptr,pGlass->addSVData(...) 的分支从未执行。结果 SERVO::CGlass::m_svDatas 里没有任何曲线数据,GlassJson::ToPrettyString 生成的 pretty 字符串也就没有 sv_datas,导出 CSV 时自然读不到曲线。 同一段代码还有一个潜在 Bug:虽然判断了 channel - 1 < bonderTypes.size(),但真正索引却用的是 bonderTypes[channel]。索引偏移会导致数据类型错位,最后一个通道甚至可能越界。即使修正了槽位,这里也需要同步改成 bonderTypes[channel - 1](另外两处 vacuumbakeTypes、coolingTypes 也一样)。

---
 SourceCode/Bond/Servo/CServoUtilsTool.cpp |  151 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 144 insertions(+), 7 deletions(-)

diff --git a/SourceCode/Bond/Servo/CServoUtilsTool.cpp b/SourceCode/Bond/Servo/CServoUtilsTool.cpp
index bfa0a43..c9d06f6 100644
--- a/SourceCode/Bond/Servo/CServoUtilsTool.cpp
+++ b/SourceCode/Bond/Servo/CServoUtilsTool.cpp
@@ -4,6 +4,32 @@
 
 
 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"
+		}},
+		{EQ_ID_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"
+		}},
+		{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"
+		}}
+	};
+
 	CServoUtilsTool::CServoUtilsTool()
 	{
 
@@ -12,6 +38,43 @@
 	CServoUtilsTool::~CServoUtilsTool()
 	{
 
+	}
+
+	std::string CServoUtilsTool::getEqName(int eqid)
+	{
+		switch (eqid)
+		{
+		case EQ_ID_LOADPORT1:
+			return "Port1";
+		case EQ_ID_LOADPORT2:
+			return "Port2";
+		case EQ_ID_LOADPORT3:
+			return "Port3";
+		case EQ_ID_LOADPORT4:
+			return "Port4";
+		case EQ_ID_ALIGNER:
+			return "Aligner";
+		case EQ_ID_FLIPER:
+			return "Fliper";
+		case EQ_ID_VACUUMBAKE:
+			return "VacuumBake";
+		case EQ_ID_Bonder1:
+			return "Bonder1";
+		case EQ_ID_Bonder2:
+			return "Bonder2";
+		case EQ_ID_BAKE_COOLING:
+			return "BakeCooling";
+		case EQ_ID_MEASUREMENT:
+			return "AOI";
+		case EQ_ID_ARM_TRAY1:
+			return "ArmTray1";
+		case EQ_ID_ARM_TRAY2:
+			return "ArmTray2";
+		default:
+			break;
+		}
+
+		return "";
 	}
 
 	std::string CServoUtilsTool::getEqUnitName(int eqid, int unit)
@@ -39,11 +102,6 @@
 			if (unit == 1) return "烘烤B腔";
 		}
 
-		if (eqid == EQ_ID_VACUUMBAKE) {
-			if (unit == 0) return "烘烤A腔";
-			if (unit == 1) return "烘烤B腔";
-		}
-
 		if (eqid == EQ_ID_Bonder1) {
 			return "Bonder1";
 		}
@@ -56,12 +114,86 @@
 
 			if (unit == 0) return "后烘烤A腔";
 			if (unit == 1) return "冷却A";
-			if (unit == 0) return "后烘烤B腔";
-			if (unit == 1) return "冷却B";
+			if (unit == 2) return "后烘烤B腔";
+			if (unit == 3) return "冷却B";
 		}
 
 		if (eqid == EQ_ID_MEASUREMENT) {
 			return "AOI";
+		}
+
+
+		if (eqid == EQ_ID_ARM_TRAY1) {
+			return "ARM1";
+		}
+
+		if (eqid == EQ_ID_ARM_TRAY2) {
+			return "ARM2";
+		}
+
+		return "";
+	}
+
+	std::string CServoUtilsTool::getEqUnitName(int eqid, int unit, int slot)
+	{
+		char szBuffer[256];
+		if (eqid == EQ_ID_LOADPORT1
+			|| eqid == EQ_ID_LOADPORT2
+			|| eqid == EQ_ID_LOADPORT3
+			|| eqid == EQ_ID_LOADPORT4
+			) {
+			sprintf_s(szBuffer, 256, "Port%d(Slot%d)", eqid - EQ_ID_LOADPORT1 + 1, slot);
+			return std::string(szBuffer);
+		}
+
+		if (eqid == EQ_ID_ALIGNER) {
+			return "Aligner";
+		}
+
+		if (eqid == EQ_ID_FLIPER) {
+			return "Fliper";
+		}
+
+		if (eqid == EQ_ID_VACUUMBAKE) {
+			if (unit == 0) {
+				sprintf_s(szBuffer, 256, "烘烤A腔(Slot%d)", slot);
+				return std::string(szBuffer);
+			}
+			if (unit == 1) {
+				sprintf_s(szBuffer, 256, "烘烤B腔(Slot%d)", slot);
+				return std::string(szBuffer);
+			}
+		}
+
+		if (eqid == EQ_ID_Bonder1) {
+			sprintf_s(szBuffer, 256, "Bonder1(Slot%d)", slot);
+			return std::string(szBuffer);
+		}
+
+		if (eqid == EQ_ID_Bonder2) {
+			sprintf_s(szBuffer, 256, "Bonder2(Slot%d)", slot);
+			return std::string(szBuffer);
+		}
+
+		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 (eqid == EQ_ID_MEASUREMENT) {
+			return "AOI";
+		}
+
+
+		if (eqid == EQ_ID_ARM_TRAY1) {
+			return "ARM1";
+		}
+
+		if (eqid == EQ_ID_ARM_TRAY2) {
+			return "ARM2";
 		}
 
 		return "";
@@ -129,4 +261,9 @@
 			break;
 		}
 	}
+
+	std::unordered_map<int, std::vector<std::string>>& CServoUtilsTool::getEqDataTypes()
+	{
+		return EQ_DATA_TYPES;
+	}
 }

--
Gitblit v1.9.3