From f6cd6b95c9aa2ad17b199c32553c0b5e06b60bea Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期四, 08 一月 2026 16:06:29 +0800
Subject: [PATCH] 1.部分实现状态变量设置

---
 SourceCode/Bond/Servo/CMaster.cpp |  897 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 584 insertions(+), 313 deletions(-)

diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index 037d0f5..0ab057f 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -1,4 +1,4 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
 #include "Common.h"
 #include "CMaster.h"
 #include <future>
@@ -6,6 +6,7 @@
 #include "RecipeManager.h"
 #include <fstream>
 #include "SerializeUtil.h"
+#include "CServoUtilsTool.h"
 
 
 namespace SERVO {
@@ -76,7 +77,7 @@
 
 	CMaster::~CMaster()
 	{
-		// 释放Job相关
+		// 閲婃斁Job鐩稿叧
 		for (auto item : m_processJobs) {
 			delete item;
 		}
@@ -126,36 +127,36 @@
 
 	int CMaster::init()
 	{
-		LOGI("<Master>正在初始化...");
+		LOGI("<Master>姝e湪鍒濆鍖�...");
 
 
 		// 	cclink
 		if (m_cclink.Connect(CC_LINK_IE_CONTROL_CHANNEL(1)) != 0) {
-			LOGE("连接CC-Link失败.");
+			LOGE("杩炴帴CC-Link澶辫触.");
 		}
 		else {
-			LOGI("连接CC-Link成功.");
+			LOGI("杩炴帴CC-Link鎴愬姛.");
 			BoardVersion version{};
 			int nRet = m_cclink.GetBoardVersion(version);
 			if (nRet == 0) {
-				LOGD("版本信息:%s.", version.toString().c_str());
+				LOGD("鐗堟湰淇℃伅锛�%s.", version.toString().c_str());
 			}
 			else {
-				LOGE("获取CC-Link版本信息失败.");
+				LOGE("鑾峰彇CC-Link鐗堟湰淇℃伅澶辫触.");
 			}
 
 			BoardStatus status;
 			nRet = m_cclink.GetBoardStatus(status);
 			if (nRet == 0) {
-				LOGD("状态:%s.", status.toString().c_str());
+				LOGD("鐘舵�侊細%s.", status.toString().c_str());
 			}
 			else {
-				LOGE("获取CC-Link状态失败.");
+				LOGE("鑾峰彇CC-Link鐘舵�佸け璐�.");
 			}
 		}
 
 
-		// 初始化添加各子设备
+		// 鍒濆鍖栨坊鍔犲悇瀛愯澶�
 		CLoadPort* pPort1, * pPort2, * pPort3, * pPort4;
 		CBonder* pBonder1, * pBonder2;
 		CEFEM* pEfem;
@@ -218,27 +219,34 @@
 
 
 
-		// 读缓存数据
+		// 璇荤紦瀛樻暟鎹�
 		readCache();
 		loadState();
+		if (m_listener.onControlJobChanged) {
+			m_listener.onControlJobChanged(this);
+		}
 
 
-		// 定时器
+		// 瀹氭椂鍣�
 		g_pMaster = this;
 		SetTimer(NULL, 1, 250, (TIMERPROC)MasterTimerProc);
 
 
-		// 调度线程
+		// 璋冨害绾跨▼
 		m_hDispatchThreadHandle = (HANDLE)_beginthreadex(NULL, 0, SERVO::DispatchThreadFunction, this,
 			0, &m_nDispatchThreadAddr);
 
 
-		// 监控bit线程
+		// 鐩戞帶bit绾跨▼
 		m_hReadBitsThreadHandle = (HANDLE)_beginthreadex(NULL, 0, SERVO::ReadBitsThreadFunction, this,
 			0, &m_nReadBitsThreadAddr);
 
 
-		LOGI("<Master>初始化完成.");
+		// 鏇茬嚎鏈嶅姟
+		CreateDAQBridgeServer();
+
+
+		LOGI("<Master>鍒濆鍖栧畬鎴�.");
 		return 0;
 	}
 
@@ -249,7 +257,7 @@
 		::WaitForSingleObject(m_hEventReadBitsThreadExit[1], INFINITE);
 		::WaitForSingleObject(m_hEventDispatchThreadExit[1], INFINITE);
 
-		LOGI("<Master>正在结束程序.");
+		LOGI("<Master>姝e湪缁撴潫绋嬪簭.");
 		for (auto item : m_listEquipment) {
 			item->term();
 		}
@@ -321,7 +329,7 @@
 
 	int CMaster::stop(int nErCode/* = ER_CODE_NOERROR*/)
 	{
-		// 运行时间为累加结果,本次停止时刷新;
+		// 杩愯鏃堕棿涓虹疮鍔犵粨鏋滐紝鏈鍋滄鏃跺埛鏂帮紱
 		lock();
 		if (m_state != MASTERSTATE::RUNNING && m_state != MASTERSTATE::RUNNING_CONTINUOUS_TRANSFER
 			&& m_state != MASTERSTATE::RUNNING_BATCH) {
@@ -332,12 +340,12 @@
 		unlock();
 
 
-		// 更新状态
+		// 鏇存柊鐘舵��
 		m_nLastError = nErCode;
 		setState(MASTERSTATE::STOPPING);
 
 
-		// ControlJob暂停
+		// ControlJob鏆傚仠
 		lock();
 		if (m_pControlJob != nullptr) {
 			m_pControlJob->pause();
@@ -372,14 +380,14 @@
 
 	unsigned CMaster::DispatchProc()
 	{
-		// 优先考虑的类型和次要类型
-		// 一种情况,如果不分主次,一直搬G1, 等到Bonder1和Bonder2都放了G1, Aligner也放了G1,
-		// Bonder1和Bonder2需要的G2就过不来了
-		// 最基本的实现,可以G2和G2轮流搬送,但最好根据Bonder的需求来决定
+		// 浼樺厛鑰冭檻鐨勭被鍨嬪拰娆¤绫诲瀷
+		// 涓�绉嶆儏鍐碉紝濡傛灉涓嶅垎涓绘锛屼竴鐩存惉G1, 绛夊埌Bonder1鍜孊onder2閮芥斁浜咷1, Aligner涔熸斁浜咷1,
+		// Bonder1鍜孊onder2闇�瑕佺殑G2灏辫繃涓嶆潵浜�
+		// 鏈�鍩烘湰鐨勫疄鐜帮紝鍙互G2鍜孏2杞祦鎼�侊紝浣嗘渶濂芥牴鎹瓸onder鐨勯渶姹傛潵鍐冲畾
 		MaterialsType primaryType, secondaryType;
 
 
-		// 各种机器
+		// 鍚勭鏈哄櫒
 		CLoadPort* pLoadPorts[4];
 		CEFEM* pEFEM = (CEFEM*)getEquipment(EQ_ID_EFEM);
 		pLoadPorts[0] = (CLoadPort*)getEquipment(EQ_ID_LOADPORT1);
@@ -408,7 +416,7 @@
 		ASSERT(pMeasurement);
 
 		while (1) {
-			// 待退出信号或时间到
+			// 寰呴��鍑轰俊鍙锋垨鏃堕棿鍒�
 			HANDLE hEvents[] = { m_hEventDispatchThreadExit[0], m_hDispatchEvent };
 			int nRet = WaitForMultipleObjects(2, hEvents, FALSE, 500);
 			if (nRet == WAIT_OBJECT_0) {
@@ -416,11 +424,11 @@
 			}
 			
 
-			// 如果状态为STARTING,开始工作并切换到RUNNING状态
+			// 濡傛灉鐘舵�佷负STARTING锛屽紑濮嬪伐浣滃苟鍒囨崲鍒癛UNNING鐘舵��
 			lock();
 			if (m_state == MASTERSTATE::STARTING) {
-				// 发送indexerOperationModeChange到各个机台,成功后切换到RUNNING状态
-				// 否则切换到MSERROR状态
+				// 鍙戦�乮ndexerOperationModeChange鍒板悇涓満鍙帮紝鎴愬姛鍚庡垏鎹㈠埌RUNNING鐘舵��
+				// 鍚﹀垯鍒囨崲鍒癕SERROR鐘舵��
 				int nRet;
 				CEquipment* pEq[6] = { pEFEM, pBonder1, pBonder2, pBakeCooling, 
 					pVacuumBake, pMeasurement};
@@ -435,9 +443,9 @@
 						TRACE("a0001\n", writeCode, retCode);
 					});
 				if (nRet != 0) {
-					LOGE("<Master>EFEM切换Start状态失败");
+					LOGE("<Master>EFEM鍒囨崲Start鐘舵�佸け璐�");
 					m_nLastError = ER_CODE_OPERATION_MODE_FAIL;
-					m_strLastError = "EFEM切换Start状态失败.";
+					m_strLastError = "EFEM鍒囨崲Start鐘舵�佸け璐�.";
 					goto WAIT;
 				}
 				futures.push_back(promises[0].get_future());
@@ -449,9 +457,9 @@
 						TRACE("a0002\n");
 					});
 				if (nRet != 0) {
-					LOGE("<Master>Bonder1切换Start状态失败");
+					LOGE("<Master>Bonder1鍒囨崲Start鐘舵�佸け璐�");
 					m_nLastError = ER_CODE_BONDER_OPERATION_MODE_FAIL;
-					m_strLastError = "Bonder1切换Start状态失败.";
+					m_strLastError = "Bonder1鍒囨崲Start鐘舵�佸け璐�.";
 					goto WAIT;
 				}
 				futures.push_back(promises[1].get_future());
@@ -463,9 +471,9 @@
 						TRACE("a0003\n");
 					});
 				if (nRet != 0) {
-					LOGE("<Master>Bonder2切换Start状态失败");
+					LOGE("<Master>Bonder2鍒囨崲Start鐘舵�佸け璐�");
 					m_nLastError = ER_CODE_BONDER_OPERATION_MODE_FAIL;
-					m_strLastError = "Bonder2切换Start状态失败.";
+					m_strLastError = "Bonder2鍒囨崲Start鐘舵�佸け璐�.";
 					goto WAIT;
 				}
 				futures.push_back(promises[2].get_future());
@@ -477,9 +485,9 @@
 						TRACE("a0004\n");
 					});
 				if (nRet != 0) {
-					LOGE("<Master>BakeCooling切换Start状态失败");
+					LOGE("<Master>BakeCooling鍒囨崲Start鐘舵�佸け璐�");
 					m_nLastError = ER_CODE_OPERATION_MODE_FAIL;
-					m_strLastError = "BakeCooling切换Start状态失败.";
+					m_strLastError = "BakeCooling鍒囨崲Start鐘舵�佸け璐�.";
 					goto WAIT;
 				}
 				futures.push_back(promises[3].get_future());
@@ -491,9 +499,9 @@
 						TRACE("a0005\n");
 					});
 				if (nRet != 0) {
-					LOGE("<Master>VacuumBake切换Start状态失败");
+					LOGE("<Master>VacuumBake鍒囨崲Start鐘舵�佸け璐�");
 					m_nLastError = ER_CODE_OPERATION_MODE_FAIL;
-					m_strLastError = "VacuumBake切换Start状态失败.";
+					m_strLastError = "VacuumBake鍒囨崲Start鐘舵�佸け璐�.";
 					goto WAIT;
 				}
 				futures.push_back(promises[4].get_future());
@@ -505,9 +513,9 @@
 						TRACE("a0006\n");
 					});
 				if (nRet != 0) {
-					LOGE("<Master>Measurement切换Start状态失败");
+					LOGE("<Master>Measurement鍒囨崲Start鐘舵�佸け璐�");
 					m_nLastError = ER_CODE_OPERATION_MODE_FAIL;
-					m_strLastError = "Measurement切换Start状态失败.";
+					m_strLastError = "Measurement鍒囨崲Start鐘舵�佸け璐�.";
 					goto WAIT;
 				}
 				futures.push_back(promises[5].get_future());
@@ -515,16 +523,16 @@
 
 WAIT:
 				for (auto& f : futures) {
-					f.wait();  // 阻塞等待对应设备完成
+					f.wait();  // 闃诲绛夊緟瀵瑰簲璁惧瀹屾垚
 				}
 				for (int i = 0; i < 6; i++) {
 					if (!bIomcOk[i]) {
 						bIomcOk[6] = FALSE;
-						LOGE("<Master>%s切换Start状态失败", pEq[i]->getName().c_str());
+						LOGE("<Master>%s鍒囨崲Start鐘舵�佸け璐�", pEq[i]->getName().c_str());
 					}
 				}
 				
-				// 检查看是否都已经切换到START状态
+				// 妫�鏌ョ湅鏄惁閮藉凡缁忓垏鎹㈠埌START鐘舵��
 				if (!bIomcOk[6]) {
 					unlock();
 					setState(MASTERSTATE::MSERROR);
@@ -543,10 +551,10 @@
 			}
 
 
-			// 处理完成当前事务后,切换到停止或就绪状态
+			// 澶勭悊瀹屾垚褰撳墠浜嬪姟鍚庯紝鍒囨崲鍒板仠姝㈡垨灏辩华鐘舵��
 			else if (m_state == MASTERSTATE::STOPPING) {
 				unlock();
-				LOGI("<Master>开始切换各设备到 Stop 模式...");
+				LOGI("<Master>寮�濮嬪垏鎹㈠悇璁惧鍒� Stop 妯″紡...");
 
 				std::vector<std::promise<void>> promises(6);
 				std::vector<std::future<void>> futures;
@@ -564,23 +572,23 @@
 							TRACE("s000%d: ret=%d\n", i + 1, retCode);
 						});
 					if (nRet != 0) {
-						LOGE("<Master>%s切换Stop状态发送失败", pEq[i]->getName().c_str());
+						LOGE("<Master>%s鍒囨崲Stop鐘舵�佸彂閫佸け璐�", pEq[i]->getName().c_str());
 						m_nLastError = ER_CODE_OPERATION_MODE_FAIL;
-						m_strLastError = pEq[i]->getName() + "切换Stop状态发送失败.";
+						m_strLastError = pEq[i]->getName() + "鍒囨崲Stop鐘舵�佸彂閫佸け璐�.";
 						bIomcOk[i] = FALSE;
-						promises[i].set_value(); // 避免 wait 阻塞
+						promises[i].set_value(); // 閬垮厤 wait 闃诲
 					}
 					futures.push_back(promises[i].get_future());
 				}
 
 				for (auto& f : futures) {
-					f.wait();  // 等待所有完成
+					f.wait();  // 绛夊緟鎵�鏈夊畬鎴�
 				}
 
 				for (int i = 0; i < 6; ++i) {
 					if (!bIomcOk[i]) {
 						bIomcOk[6] = FALSE;
-						LOGE("<Master>%s切换Stop状态失败", pEq[i]->getName().c_str());
+						LOGE("<Master>%s鍒囨崲Stop鐘舵�佸け璐�", pEq[i]->getName().c_str());
 					}
 				}
 
@@ -589,7 +597,7 @@
 					continue;
 				}
 
-				LOGI("<Master>所有设备成功切换到 Stop 模式");
+				LOGI("<Master>鎵�鏈夎澶囨垚鍔熷垏鎹㈠埌 Stop 妯″紡");
 				if(m_nLastError == ER_CODE_NOERROR)
 					setState(MASTERSTATE::READY);
 				else
@@ -599,9 +607,9 @@
 			}
 
 
-			// 调度逻辑处理
+			// 璋冨害閫昏緫澶勭悊
 			else if (m_state == MASTERSTATE::RUNNING) {
-				// 检测判断robot状态
+				// 妫�娴嬪垽鏂璻obot鐘舵��
 				RMDATA& rmd = pEFEM->getRobotMonitoringData();
 				if (rmd.status != ROBOT_STATUS::Idle && rmd.status != ROBOT_STATUS::Run) {
 					unlock();
@@ -613,13 +621,13 @@
 						m_pActiveRobotTask->place();
 					}
 					unlock();
-					// 检测到当前有正在下午的任务,确保当前任务完成或中止后继续
-					// LOGI("检测到当前有正在下午的任务,确保当前任务完成或中止后继续...");
+					// 妫�娴嬪埌褰撳墠鏈夋鍦ㄤ笅鍗堢殑浠诲姟锛岀‘淇濆綋鍓嶄换鍔″畬鎴愭垨涓鍚庣户缁�
+					// LOGI("妫�娴嬪埌褰撳墠鏈夋鍦ㄤ笅鍗堢殑浠诲姟锛岀‘淇濆綋鍓嶄换鍔″畬鎴愭垨涓鍚庣户缁�...");
 					continue;
 				}
 
 
-				// Bonder1、Bonder2、Fliper、VacuumBake、Aligner,统计G2和G1的数量, 配对组数, 多出的类型
+				// Bonder1銆丅onder2銆丗liper銆乂acuumBake銆丄ligner锛岀粺璁2鍜孏1鐨勬暟閲�, 閰嶅缁勬暟, 澶氬嚭鐨勭被鍨�
 				int nG2Count = 0, nG1Count = 0, nGlassGroup, nExtraType;
 				if (pBonder1->slotHasGlass(0)) {
 					nG2Count++;
@@ -686,7 +694,7 @@
 
 
 				// Measurement NG -> LoadPort
-				// NG回原位
+				// NG鍥炲師浣�
 				if (!rmd.armState[1]) {
 					m_pActiveRobotTask = createTransferTask_restore(pMeasurement, pLoadPorts);
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
@@ -700,7 +708,7 @@
 				}
 
 				
-				// BakeCooling内部
+				// BakeCooling鍐呴儴
 				// Bake -> Cooling
 				if (!rmd.armState[0]) {
 					m_pActiveRobotTask = createTransferTask_bake_to_cooling(pBakeCooling);
@@ -814,9 +822,9 @@
 				continue;
 			}
 
-			// 批处理模式,最终以此为准,但先保留之前的单片模式
+			// 鎵瑰鐞嗘ā寮忥紝鏈�缁堜互姝や负鍑嗭紝浣嗗厛淇濈暀涔嬪墠鐨勫崟鐗囨ā寮�
 			else if (m_state == MASTERSTATE::RUNNING_BATCH) {
-				// 1) 控制作业生命周期保障
+				// 1) 鎺у埗浣滀笟鐢熷懡鍛ㄦ湡淇濋殰
 				if (m_pControlJob == nullptr) { unlock(); continue; }
 				CJState cjst = m_pControlJob->state();
 				if (cjst == CJState::Completed || cjst == CJState::Aborted || cjst == CJState::Failed) {
@@ -824,20 +832,20 @@
 					continue;
 				}
 				if (cjst == CJState::NoState) {
-					LOGI("<Master>ControlJob已经进入列队");
+					LOGI("<Master>ControlJob宸茬粡杩涘叆鍒楅槦");
 					m_pControlJob->queue();
 				}
 				if (m_pControlJob->state() == CJState::Queued) {
-					LOGI("<Master>ControlJob已经启动");
+					LOGI("<Master>ControlJob宸茬粡鍚姩");
 					m_pControlJob->start();
 					if (m_listener.onCjStart) m_listener.onCjStart(this, m_pControlJob);
 				}
 				if (m_pControlJob->state() == CJState::Paused) {
-					LOGI("<Master>ControlJob已经恢复运行");
+					LOGI("<Master>ControlJob宸茬粡鎭㈠杩愯");
 					m_pControlJob->resume();
 				}
 
-				// 2) 若当前无 PJ,则选择一个并上报
+				// 2) 鑻ュ綋鍓嶆棤 PJ锛屽垯閫夋嫨涓�涓苟涓婃姤
 				if (m_inProcesJobs.empty()) {
 					if (auto pj = acquireNextProcessJob()) {
 						m_inProcesJobs.push_back(pj);
@@ -845,35 +853,35 @@
 					}
 				}
 				if (m_inProcesJobs.empty()) {
-					LOGE("<Master>选择当前ProcessJob失败!");
+					LOGE("<Master>閫夋嫨褰撳墠ProcessJob澶辫触锛�");
 					unlock();
 					continue;
 				}
 
-				// 3) 若队列无 Glass,拉取到等待队列
+				// 3) 鑻ラ槦鍒楁棤 Glass锛屾媺鍙栧埌绛夊緟闃熷垪
 				if (m_queueGlasses.empty()) {
 					int nCount = acquireGlassToQueue();
 					if (nCount > 0) {
-						LOGI("<Master>已加入 %d 块Glass到工艺列队!", nCount);
+						LOGI("<Master>宸插姞鍏� %d 鍧桮lass鍒板伐鑹哄垪闃燂紒", nCount);
 					}
 				}
 
-				// 4) 机器人状态
+				// 4) 鏈哄櫒浜虹姸鎬�
 				RMDATA& rmd = pEFEM->getRobotMonitoringData();
 				if (rmd.status != ROBOT_STATUS::Idle && rmd.status != ROBOT_STATUS::Run) {
 					unlock(); continue;
 				}
 
-				// 5) 正在执行的 RobotTask 先让它跑完一拍
+				// 5) 姝e湪鎵ц鐨� RobotTask 鍏堣瀹冭窇瀹屼竴鎷�
 				if (m_pActiveRobotTask != nullptr) {
 					if (m_pActiveRobotTask->isPicked()) {
 						m_pActiveRobotTask->place();
 					}
-					unlock(); // 等当前任务完成或中止后继续
+					unlock(); // 绛夊綋鍓嶄换鍔″畬鎴愭垨涓鍚庣户缁�
 					continue;
 				}
 
-				// 6) ——关键:全局统计 G1/G2 与组数门限(与单片分支对齐)——
+				// 6) 鈥斺�斿叧閿細鍏ㄥ眬缁熻 G1/G2 涓庣粍鏁伴棬闄愶紙涓庡崟鐗囧垎鏀榻愶級鈥斺��
 				auto countG1G2 = [&]() {
 					int g1 = 0, g2 = 0;
 					if (pBonder1->slotHasGlass(0)) g2++;
@@ -895,20 +903,20 @@
 				int nGlassGroup = min(g1Count, g2Count);
 				int nExtraType = (g1Count == g2Count ? 0 : (g1Count > g2Count ? 1 : 2));
 
-				// primary/secondary 统一定义(secondary 默认 G0)
+				// primary/secondary 缁熶竴瀹氫箟锛坰econdary 榛樿 G0锛�
 				MaterialsType primaryType = MaterialsType::G1;
 				MaterialsType secondaryType = MaterialsType::G0;
-				if (nExtraType == 0) primaryType = MaterialsType::G2; // 与单片分支一致
+				if (nExtraType == 0) primaryType = MaterialsType::G2; // 涓庡崟鐗囧垎鏀竴鑷�
 				else                 primaryType = MaterialsType::G1;
 
-				// 组数门限:≥2 组时不再从 LP 上片,避免堆积(与单片一致)
+				// 缁勬暟闂ㄩ檺锛氣墺2 缁勬椂涓嶅啀浠� LP 涓婄墖锛岄伩鍏嶅爢绉紙涓庡崟鐗囦竴鑷达級
 				bool blockLoadFromLP = (nGlassGroup >= 2);
 
-				// 7) Measurement -> LoadPort(固定:G1 优先回 LP)
+				// 7) Measurement -> LoadPort锛堝浐瀹氾細G1 浼樺厛鍥� LP锛�
 				if (rmd.armState[0] || rmd.armState[1]) {
 					LOGD("Arm1 %s, Arm2 %s.",
-						rmd.armState[0] ? _T("不可用") : _T("可用"),
-						rmd.armState[1] ? _T("不可用") : _T("可用"));
+						rmd.armState[0] ? _T("涓嶅彲鐢�") : _T("鍙敤"),
+						rmd.armState[1] ? _T("涓嶅彲鐢�") : _T("鍙敤"));
 				}
 				for (int s = 0; s < 4; s++) {
 					PortType pt = pLoadPorts[s]->getPortType();
@@ -923,7 +931,7 @@
 				BATCH_PORT_PUT:
 				CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 
-				// 8) Measurement NG -> LoadPort(原位回退)
+				// 8) Measurement NG -> LoadPort锛堝師浣嶅洖閫�锛�
 				if (!rmd.armState[1]) {
 					m_pActiveRobotTask = createTransferTask_restore(pMeasurement, pLoadPorts);
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
@@ -935,7 +943,7 @@
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
 
-				// 10) BakeCooling 内部(Bake -> Cooling)
+				// 10) BakeCooling 鍐呴儴锛圔ake -> Cooling锛�
 				if (!rmd.armState[0]) {
 					m_pActiveRobotTask = createTransferTask_bake_to_cooling(pBakeCooling);
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
@@ -951,7 +959,7 @@
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
 
-				// 12) Fliper(G2) -> Bonder(前置:VacuumBake 有 processed G1;输出 G2 到 Bonder slot0)
+				// 12) Fliper(G2) -> Bonder锛堝墠缃細VacuumBake 鏈� processed G1锛涜緭鍑� G2 鍒� Bonder slot0锛�
 				if (auto pSrcSlot = pVacuumBake->getProcessedSlot(MaterialsType::G1)) {
 					if (!rmd.armState[1] && pBonder1->canPlaceGlassInSlot(0)) {
 						m_pActiveRobotTask = createTransferTask(pFliper, pBonder1, MaterialsType::G2, MaterialsType::G0, 2);
@@ -963,7 +971,7 @@
 					}
 				}
 
-				// 13) VacuumBake(G1) -> Bonder(槽级判定:slot0(G2) 已有且 slot1(G1) 为空)
+				// 13) VacuumBake(G1) -> Bonder锛堟Ы绾у垽瀹氾細slot0(G2) 宸叉湁涓� slot1(G1) 涓虹┖锛�
 				if (!rmd.armState[0] && pBonder1->slotHasGlass(0) && !pBonder1->slotHasGlass(1)) {
 					m_pActiveRobotTask = createTransferTask(pVacuumBake, pBonder1, MaterialsType::G1, MaterialsType::G0);
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
@@ -973,7 +981,7 @@
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
 
-				// 14) Aligner -> Fliper(G2) 以及 -> VacuumBake(G1)(固定映射)
+				// 14) Aligner -> Fliper(G2) 浠ュ強 -> VacuumBake(G1)锛堝浐瀹氭槧灏勶級
 				if (!rmd.armState[1]) {
 					m_pActiveRobotTask = createTransferTask(pAligner, pFliper, MaterialsType::G2, MaterialsType::G0);
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
@@ -983,13 +991,13 @@
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
 
-				// 15) Aligner -> LoadPort(restore)
+				// 15) Aligner -> LoadPort锛坮estore锛�
 				if (!rmd.armState[1]) {
 					m_pActiveRobotTask = createTransferTask_restore(pAligner, pLoadPorts);
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
 
-				// 16) LoadPort -> Aligner(受组数门限控制;统一 buddy/状态时序)
+				// 16) LoadPort -> Aligner锛堝彈缁勬暟闂ㄩ檺鎺у埗锛涚粺涓� buddy/鐘舵�佹椂搴忥級
 				if (blockLoadFromLP) { unlock(); continue; }
 
 				for (int s = 0; s < 4; s++) {
@@ -1006,17 +1014,17 @@
 								continue;
 							}
 
-							// 统一:queue -> start -> setContext -> move queue→inProcess -> onPanelStart
+							// 缁熶竴锛歲ueue -> start -> setContext -> move queue鈫抜nProcess -> onPanelStart
 							pGlass->queue();
 							pGlass->start();
 							pEFEM->setContext(pGlass);
 
 							bool bMoved = glassFromQueueToInPorcess(pGlass);
 							if (bMoved) {
-								LOGI("<Master>Glass(%s)从等待列队到工艺列队转移成功.", pGlass->getID().c_str());
+								LOGI("<Master>Glass(%s)浠庣瓑寰呭垪闃熷埌宸ヨ壓鍒楅槦杞Щ鎴愬姛.", pGlass->getID().c_str());
 							}
 							else {
-								LOGE("<Master>Glass(%s)从等待列队到工艺列队转移失败.", pGlass->getID().c_str());
+								LOGE("<Master>Glass(%s)浠庣瓑寰呭垪闃熷埌宸ヨ壓鍒楅槦杞Щ澶辫触.", pGlass->getID().c_str());
 							}
 
 							if (m_listener.onPanelStart) m_listener.onPanelStart(this, pGlass);
@@ -1033,9 +1041,9 @@
 			}
 
 
-			// 千传模式调度逻辑
+			// 鍗冧紶妯″紡璋冨害閫昏緫
 			else if (m_state == MASTERSTATE::RUNNING_CONTINUOUS_TRANSFER) {
-				// 检测判断robot状态
+				// 妫�娴嬪垽鏂璻obot鐘舵��
 				RMDATA& rmd = pEFEM->getRobotMonitoringData();
 				if (rmd.status != ROBOT_STATUS::Idle && rmd.status != ROBOT_STATUS::Run) {
 					unlock();
@@ -1047,8 +1055,8 @@
 						m_pActiveRobotTask->place();
 					}
 					unlock();
-					// 检测到当前有正在下午的任务,确保当前任务完成或中止后继续
-					// LOGI("检测到当前有正在下午的任务,确保当前任务完成或中止后继续...");
+					// 妫�娴嬪埌褰撳墠鏈夋鍦ㄤ笅鍗堢殑浠诲姟锛岀‘淇濆綋鍓嶄换鍔″畬鎴愭垨涓鍚庣户缁�
+					// LOGI("妫�娴嬪埌褰撳墠鏈夋鍦ㄤ笅鍗堢殑浠诲姟锛岀‘淇濆綋鍓嶄换鍔″畬鎴愭垨涓鍚庣户缁�...");
 					continue;
 				}
 
@@ -1084,20 +1092,20 @@
 						3, pMeasurement, 0);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_BakeCooling_Measurement;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling -> Measurement)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(BakeCooling -> Measurement)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
 
 				
-				// BakeCooling内部
+				// BakeCooling鍐呴儴
 				if ((m_nContinuousTransferStep == CTStep_Unknow || m_nContinuousTransferStep == CTStep_BakeCooling_BakeCooling2)
 					&& !rmd.armState[0]) {
 					m_pActiveRobotTask = createTransferTask_continuous_transfer(pBakeCooling,
 						2, pBakeCooling, 3);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_BakeCooling_BakeCooling3;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling-2 -> BakeCooling-3)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(BakeCooling-2 -> BakeCooling-3)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1107,7 +1115,7 @@
 						1, pBakeCooling, 2);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_BakeCooling_BakeCooling2;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling-1 -> BakeCooling-2)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(BakeCooling-1 -> BakeCooling-2)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1117,7 +1125,7 @@
 						0, pBakeCooling, 1);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_BakeCooling_BakeCooling1;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(BakeCooling-0 -> BakeCooling-1)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(BakeCooling-0 -> BakeCooling-1)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1129,7 +1137,7 @@
 						1, pBakeCooling, 0);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_VacuumBake_BakeCooling;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(VacuumBake(G1) -> BakeCooling)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(VacuumBake(G1) -> BakeCooling)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1141,7 +1149,7 @@
 						0, pVacuumBake, 1);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_VacuumBake_VacuumBake;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(VacuumBake(G1-0) -> VacuumBake(G1-1))...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(VacuumBake(G1-0) -> VacuumBake(G1-1))...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1153,7 +1161,7 @@
 						1, pVacuumBake, 0);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_Bonder2_VacuumBake;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Bonder2 -> VacuumBake(G1))...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(Bonder2 -> VacuumBake(G1))...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1165,7 +1173,7 @@
 						1, pBonder2, 1);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_Bonder1_Bonder2;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Bonder1 -> Bonder2)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(Bonder1 -> Bonder2)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1177,7 +1185,7 @@
 						0, pBonder1, 1);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_Fliper_Bonder1;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Fliper(G2) -> Bonder1)...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(Fliper(G2) -> Bonder1)...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1189,7 +1197,7 @@
 						0, pFliper, 0);
 					if (m_pActiveRobotTask != nullptr) {
 						m_nContinuousTransferStep = CTStep_Aligner_Fliper;
-						LOGI("<ContinuousTransfer>千传测试,开始搬送任务(Aligner -> Fliper(G2))...");
+						LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(Aligner -> Fliper(G2))...");
 					}
 					CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 				}
@@ -1208,7 +1216,7 @@
 								m_nContinuousTransferStep = CTStep_LoadPort_Aligner;
 								m_nContinuousWorkingPort = p;
 								m_nContinuousWorkingSlot = slot;
-								LOGI("<ContinuousTransfer>千传测试,开始搬送任务(LoadPort -> Aligner)...");
+								LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬫惉閫佷换鍔�(LoadPort -> Aligner)...");
 								pEFEM->setContext(m_pActiveRobotTask->getContext());
 								goto CT_PORT_GET;
 							}
@@ -1219,7 +1227,7 @@
 			CT_PORT_GET:
 				if (m_pActiveRobotTask != nullptr) {
 					m_nContinuousTransferStep = CTStep_begin;
-					LOGI("<ContinuousTransfer>千传测试,开始第 %d 轮", m_nContinuousTransferCount + 1);
+					LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛屽紑濮嬬 %d 杞�", m_nContinuousTransferCount + 1);
 				}
 				CHECK_RUN_ACTIVE_ROBOT_TASK(m_pActiveRobotTask);
 
@@ -1236,13 +1244,13 @@
 
 
 		// _endthreadex(0);
-		TRACE("CMaster::DispatchProc 线程退出\n");
+		TRACE("CMaster::DispatchProc 绾跨▼閫�鍑篭n");
 		return 0;
 	}
 
 	unsigned CMaster::ReadBitsProc()
 	{
-		// 标志位清0复位		
+		// 鏍囧織浣嶆竻0澶嶄綅		
 		{
 			StationIdentifier station;
 			station.nNetNo = 0;
@@ -1253,13 +1261,13 @@
 
 
 		while (1) {
-			// 待退出信号或时间到
+			// 寰呴��鍑轰俊鍙锋垨鏃堕棿鍒�
 			int nRet = ::WaitForSingleObject(m_hEventReadBitsThreadExit[0], 1000);
 			if (nRet == WAIT_OBJECT_0) {
 				break;
 			}
 
-			// 读标志位
+			// 璇绘爣蹇椾綅
 			for (auto item : m_listEquipment) {
 				const StationIdentifier& station = item->getStation();
 				MemoryBlock& block = item->getReadBitBlock();
@@ -1277,7 +1285,7 @@
 
 
 		// _endthreadex(0);
-		TRACE("CMaster::ReadBitsProc 线程退出\n");
+		TRACE("CMaster::ReadBitsProc 绾跨▼閫�鍑篭n");
 		return 0;
 	}
 
@@ -1312,10 +1320,10 @@
 		listener.onPreFethedOutJob = [&](void* pEquipment, int port, CJobDataB* pJobDataB) -> BOOL {
 			CEquipment* p = (CEquipment*)pEquipment;
 
-			// 可能要加这一句
+			// 鍙兘瑕佸姞杩欎竴鍙�
 			Sleep(750);
 
-			// 取片,更新当前搬送任务
+			// 鍙栫墖锛屾洿鏂板綋鍓嶆惉閫佷换鍔�
 			BOOL bOk = FALSE;
 			lock();
 			if (m_pActiveRobotTask != nullptr) {
@@ -1330,7 +1338,7 @@
 							&& pJobDataS->getCassetteSequenceNo() == pJobDataB->getCassetteSequenceNo()
 							&& pJobDataS->getJobSequenceNo() == pJobDataB->getJobSequenceNo()) {
 							bOk = TRUE;
-							LOGD("<CMaster>onPreFethedOutJob, 已校验数据一致性.");
+							LOGD("<CMaster>onPreFethedOutJob, 宸叉牎楠屾暟鎹竴鑷存��.");
 						}
 						LOGD("<CMaster>onPreFethedOutJob 0004.");
 						if (pJobDataS != nullptr) {
@@ -1350,7 +1358,7 @@
 			unlock();
 
 			if (!bOk) {
-				LOGE("<CMaster>onPreFethedOutJob, 数据校验失败.");
+				LOGE("<CMaster>onPreFethedOutJob, 鏁版嵁鏍¢獙澶辫触.");
 			}
 
 			return bOk;
@@ -1359,14 +1367,14 @@
 		listener.onPreStoredJob = [&](void* pEquipment, int port, CJobDataB* pJobDataB, short& slot) -> BOOL {
 			CEquipment* p = (CEquipment*)pEquipment;
 
-			// 可能要加这一句
+			// 鍙兘瑕佸姞杩欎竴鍙�
 			Sleep(750);
 
-			// 放片,更新当前搬送任务
+			// 鏀剧墖锛屾洿鏂板綋鍓嶆惉閫佷换鍔�
 			BOOL bOk = FALSE;
 			lock();
 			if (m_pActiveRobotTask != nullptr) {
-				// 是否已经进入手臂(即取片完成),进入下一步,放片
+				// 鏄惁宸茬粡杩涘叆鎵嬭噦(鍗冲彇鐗囧畬鎴�),杩涘叆涓嬩竴姝ワ紝鏀剧墖
 				if (m_pActiveRobotTask->isPicking() && 
 					((m_pActiveRobotTask->getArmNo() == 1 && p->getID() == EQ_ID_ARM_TRAY1)
 					|| (m_pActiveRobotTask->getArmNo() == 2 && p->getID() == EQ_ID_ARM_TRAY2))
@@ -1375,32 +1383,32 @@
 					bOk = TRUE;
 				}
 
-				// 是否放片完成
+				// 鏄惁鏀剧墖瀹屾垚
 				else if (m_pActiveRobotTask->isPlacing() &&
 					m_pActiveRobotTask->getTarPosition() == p->getID()) {
 					CGlass* pGlass = p->getGlassFromSlot(m_pActiveRobotTask->getTarSlot());
 					if (pGlass == nullptr) {
 						bOk = TRUE;
 						slot = m_pActiveRobotTask->getTarSlot();
-						LOGI("<CMaster>onPreStoredJob, 已校验数据一致性.");
+						LOGI("<CMaster>onPreStoredJob, 宸叉牎楠屾暟鎹竴鑷存��.");
 					}
 				}
 
-				// 是否回撤
+				// 鏄惁鍥炴挙
 				else if (m_pActiveRobotTask->isRestoring() &&
 					m_pActiveRobotTask->getSrcPosition() == p->getID()) {
 					CGlass* pGlass = p->getGlassFromSlot(m_pActiveRobotTask->getSrcSlot());
 					if (pGlass == nullptr && m_pActiveRobotTask->getSrcSlot() == port) {
 						bOk = TRUE;
 						slot = m_pActiveRobotTask->getSrcSlot();
-						LOGI("<CMaster>onPreStoredJob, 已校验数据一致性.");
+						LOGI("<CMaster>onPreStoredJob, 宸叉牎楠屾暟鎹竴鑷存��.");
 					}
 				}
 			}
 			unlock();
 
 			if (!bOk) {
-				LOGE("<CMaster>onPreStoredJob, 数据校验失败.");
+				LOGE("<CMaster>onPreStoredJob, 鏁版嵁鏍¢獙澶辫触.");
 			}
 
 			return bOk;
@@ -1413,11 +1421,11 @@
 				m_listener.onEqDataChanged(this, p, 0);
 			}
 
-			// 取放片,更新当前搬送任务
+			// 鍙栨斁鐗囷紝鏇存柊褰撳墠鎼�佷换鍔�
 			if (code == EDCC_FETCHOUT_JOB) {
 				lock();
 				if (m_pActiveRobotTask != nullptr && m_pActiveRobotTask->getSrcPosition() == p->getID()) {
-					LOGI("开始取片...");
+					LOGI("寮�濮嬪彇鐗�...");
 				}
 				unlock();
 			}
@@ -1428,7 +1436,7 @@
 					&& ((m_pActiveRobotTask->getArmNo() == 1 && p->getID() == EQ_ID_ARM_TRAY1)
 						|| (m_pActiveRobotTask->getArmNo() == 2 && p->getID() == EQ_ID_ARM_TRAY2))
 					) {
-					LOGI("取片完成.");
+					LOGI("鍙栫墖瀹屾垚.");
 					m_pActiveRobotTask->fetchOut();
 					m_pActiveRobotTask->picked();
 				}
@@ -1442,17 +1450,17 @@
 					if (m_state == MASTERSTATE::RUNNING_CONTINUOUS_TRANSFER) {
 						if (m_nContinuousTransferStep == CTStep_end) {
 							m_nContinuousTransferCount++;
-							LOGI("<ContinuousTransfer>千传测试,第 %d 轮结束", m_nContinuousTransferCount);
+							LOGI("<ContinuousTransfer>鍗冧紶娴嬭瘯锛岀 %d 杞粨鏉�", m_nContinuousTransferCount);
 							if (m_listener.onCTRoundEnd != nullptr) {
 								m_listener.onCTRoundEnd(this, m_nContinuousTransferCount);
 							}
 						}
 					}
 
-					LOGI("放片完成...");
-					// 完成此条搬送任务,但要把数据和消息上抛应用层
+					LOGI("鏀剧墖瀹屾垚...");
+					// 瀹屾垚姝ゆ潯鎼�佷换鍔★紝浣嗚鎶婃暟鎹拰娑堟伅涓婃姏搴旂敤灞�
 
-					// 如果是搬送回从AOI搬送回Port, 则glass工艺完成
+					// 濡傛灉鏄惉閫佸洖浠嶢OI鎼�佸洖Port, 鍒檊lass宸ヨ壓瀹屾垚
 					if (m_pActiveRobotTask->getSrcPosition() == EQ_ID_MEASUREMENT) {
 						CGlass* pGlass = (CGlass*)m_pActiveRobotTask->getContext();
 						pGlass->complete();
@@ -1461,32 +1469,33 @@
 						this->saveState();
 						bool bMoved = glassFromInPorcessToComplete(pGlass);
 						if (bMoved) {
-							LOGI("<Master>Glass(%s)从工艺列队到完成列队转移成功.",
+							LOGI("<Master>Glass(%s)浠庡伐鑹哄垪闃熷埌瀹屾垚鍒楅槦杞Щ鎴愬姛.",
 								pGlass->getID().c_str());
 						}
 						else {
-							LOGE("<Master>Glass(%s)从工艺列队到完成列队转移失败.",
+							LOGE("<Master>Glass(%s)浠庡伐鑹哄垪闃熷埌瀹屾垚鍒楅槦杞Щ澶辫触.",
 								pGlass->getID().c_str());
 						}
 						if (m_listener.onPanelEnd != nullptr) {
 							m_listener.onPanelEnd(this, pGlass);
 						}
 
-						// 检查PJ是否已经完成
+						// 妫�鏌J鏄惁宸茬粡瀹屾垚
 						CProcessJob* pJob = getGlassProcessJob((CGlass*)m_pActiveRobotTask->getContext());
 						if (pJob != nullptr && checkAndUpdatePjComplete(pJob)) {
 							this->saveState();
-							LOGE("<Master>ProcessJob(%s)完成.",
+							LOGE("<Master>ProcessJob(%s)瀹屾垚.",
 								pJob->id().c_str());
+							processJobFromInPorcessToComplete(pJob);
 							if (m_listener.onPjEnd != nullptr) {
 								m_listener.onPjEnd(this, pJob);
 							}
 
-							// 检查CJ是否已经完成
+							// 妫�鏌J鏄惁宸茬粡瀹屾垚
 							ASSERT(m_pControlJob);
 							if (checkAndUpdateCjComplete(m_pControlJob)) {
 								this->saveState();
-								LOGE("<Master>ControlJob(%s)完成.",
+								LOGE("<Master>ControlJob(%s)瀹屾垚.",
 									m_pControlJob->id().c_str());
 								if (m_listener.onCjEnd != nullptr) {
 									m_listener.onCjEnd(this, pJob);
@@ -1515,8 +1524,8 @@
 					&& m_pActiveRobotTask->getSrcPosition() == p->getID()) {
 					m_pActiveRobotTask->stored();
 					m_pActiveRobotTask->restored();
-					LOGI("回撤完成...");
-					// 完成此条搬送任务,但要把数据和消息上抛应用层
+					LOGI("鍥炴挙瀹屾垚...");
+					// 瀹屾垚姝ゆ潯鎼�佷换鍔★紝浣嗚鎶婃暟鎹拰娑堟伅涓婃姏搴旂敤灞�
 					unlock();
 
 
@@ -1538,20 +1547,26 @@
 			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));
+				}
+			}
+
+			if (m_listener.onProcessStateChanged != nullptr) {
+				m_listener.onProcessStateChanged(this, (CEquipment*)pEquipment, slotNo, state);
 			}
 		};
 		listener.onMapMismatch = [&](void* pEquipment, short scanMap, short downMap) {
-			LOGE("<Master-%s>Port InUse, map(%d!=%d)不一致,请检查。",
+			LOGE("<Master-%s>Port InUse, map(%d!=%d)涓嶄竴鑷达紝璇锋鏌ャ��",
 				((CEquipment*)pEquipment)->getName().c_str(), scanMap, downMap);
 		};
 		listener.onPortStatusChanged = [&](void* pEquipment, short status, __int64 data) {
-			LOGE("<Master-%s>onPortStatusChanged。status=%d, data=%lld", ((CEquipment*)pEquipment)->getName().c_str(), status);
+			LOGE("<Master-%s>onPortStatusChanged銆俿tatus=%d, data=%lld", ((CEquipment*)pEquipment)->getName().c_str(), status);
 			if (status == PORT_INUSE && m_pControlJob != nullptr) {
 				CLoadPort* pPort = (CLoadPort*)pEquipment;
 				auto pjs = m_pControlJob->getPjs();
@@ -1623,60 +1638,136 @@
 			((CEquipment*)pEquipment)->parsingSVData((const char*)rawData.data(), rawData.size(), params);
 		
 
-			// 以下加入到曲线数据中
+			// 浠ヤ笅鍔犲叆鍒版洸绾挎暟鎹腑
+			LOGD("<Master>onSVDataReport 001");
+
 			const int64_t ts = now_ms_epoch();
 			int eqid = ((CEquipment*)pEquipment)->getID();
 			if (eqid == EQ_ID_Bonder1 || eqid == EQ_ID_Bonder2) {
-				m_pCollector->buffersPush(eqid, 1, ts, params.at(1).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 2, ts, params.at(2).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 3, ts, params.at(3).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 4, ts, params.at(4).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 5, ts, params.at(5).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 6, ts, params.at(6).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 7, ts, params.at(7).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 8, ts, params.at(8).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 9, ts, params.at(9).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 10, ts, params.at(10).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 11, ts, params.at(11).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 12, ts, params.at(12).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 13, ts, params.at(13).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 14, ts, params.at(14).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 15, ts, params.at(15).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 16, ts, params.at(16).getDoubleValue());
+				LOGD("<Master>onSVDataReport 002A");
+				// 瀹氫箟 Bonder 鐨勭壒瀹氭槧灏�
+				std::vector<std::pair<int, int>> bonderMapping = {
+					{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7},
+					{8, 8}, {9, 9}, {10, 10}, {11, 11}, {12, 12}, {13, 13}, {14, 14}, {15, 15}, {16, 16}
+				};
+
+				CGlass* pGlass = ((CEquipment*)pEquipment)->getGlassFromSlot(2);
+				auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+				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(SlotToMid(eqid, 2), channel, ts, params.at(paramIndex).getDoubleValue());
+						if(pGlass != nullptr)
+							pGlass->addSVData(eqid, bonderTypes[channel - 1], ts, params.at(paramIndex).getDoubleValue());
+					}
+				}
 			}
 			else if (eqid == EQ_ID_VACUUMBAKE) {
-				m_pCollector->buffersPush(eqid, 1, ts, params.at(1).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 2, ts, params.at(2).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 3, ts, params.at(3).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 4, ts, params.at(4).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 5, ts, params.at(5).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 6, ts, params.at(6).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 7, ts, params.at(7).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 8, ts, params.at(10).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 9, ts, params.at(11).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 10, ts, params.at(12).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 11, ts, params.at(13).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 12, ts, params.at(14).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 13, ts, params.at(15).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 14, ts, params.at(16).getDoubleValue());
+				LOGD("<Master>onSVDataReport 002");
+				// 瀹氫箟 VACUUMBAKE 鐨勭壒瀹氭槧灏�
+				std::vector<std::pair<int, int>> vacuumMapping = {
+					{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7},
+					{10, 8}, {11, 9}, {12, 10}, {13, 11}, {14, 12}, {15, 13}, {16, 14}
+				};
+
+				CGlass* pGlass1 = ((CEquipment*)pEquipment)->getGlassFromSlot(1);
+				CGlass* pGlass2 = ((CEquipment*)pEquipment)->getGlassFromSlot(2);
+				auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+				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()) {
+						auto& param = params.at(paramIndex);
+						double value = param.getDoubleValue();
+						const std::string& dataType = vacuumbakeTypes[channel - 1];
+						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() && slotTag == 'A')
+							pGlass1->addSVData(eqid, dataType, ts, value);
+						if (pGlass2 != nullptr && !dataType.empty() && slotTag == 'B')
+							pGlass2->addSVData(eqid, dataType, ts, value);
+					}
+				}
 			}
 			else if (eqid == EQ_ID_BAKE_COOLING) {
-				m_pCollector->buffersPush(eqid, 1, ts, params.at(1).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 2, ts, params.at(2).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 3, ts, params.at(3).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 4, ts, params.at(4).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 5, ts, params.at(5).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 6, ts, params.at(6).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 7, ts, params.at(11).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 8, ts, params.at(12).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 9, ts, params.at(13).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 10, ts, params.at(14).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 11, ts, params.at(15).getDoubleValue());
-				m_pCollector->buffersPush(eqid, 12, ts, params.at(16).getDoubleValue());
+				LOGD("<Master>onSVDataReport 002B");
+				// 瀹氫箟 BAKE_COOLING 鐨勭壒瀹氭槧灏�
+				std::vector<std::pair<int, int>> coolingMapping = {
+					{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6},
+					{11, 7}, {12, 8}, {13, 9}, {14, 10}, {15, 11}, {16, 12}
+				};
+
+				CGlass* pGlass1 = ((CEquipment*)pEquipment)->getGlassFromSlot(1); // A Bake
+				CGlass* pGlass2 = ((CEquipment*)pEquipment)->getGlassFromSlot(2); // A Cool
+				CGlass* pGlass3 = ((CEquipment*)pEquipment)->getGlassFromSlot(3); // B Bake
+				CGlass* pGlass4 = ((CEquipment*)pEquipment)->getGlassFromSlot(4); // B Cool
+				auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+				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)
+						glass->addSVData(eqid, type, ts, val);
+				};
+				for (const auto& mapping : coolingMapping) {
+					int paramIndex = mapping.first;
+					int channel = mapping.second;
+
+					if (paramIndex < params.size() && channel - 1 < coolingTypes.size()) {
+						auto& param = params.at(paramIndex);
+						double value = param.getDoubleValue();
+						const std::string& dataType = coolingTypes[channel - 1];
+						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()) {
+							switch (slotTag) {
+							case 'A':
+								if (paramIsBake)
+									addToGlass(pGlass1, dataType, value);
+								else if (paramIsCooling)
+									addToGlass(pGlass2, dataType, value);
+								break;
+							case 'B':
+								if (paramIsBake)
+									addToGlass(pGlass3, dataType, value);
+								else if (paramIsCooling)
+									addToGlass(pGlass4, dataType, value);
+								break;
+							default:
+								break;
+							}
+						}
+					}
+				}
 			}
 
 
-			// 以下是输出测试
+			// 浠ヤ笅鏄緭鍑烘祴璇�
 			std::string strOut;
 			char szBuffer[256];
 			for (auto p : params) {
@@ -1697,14 +1788,14 @@
 			CEquipment* pEq = (CEquipment*)pEquipment;
 			CGlass* pGlass = (CGlass*)pContext;
 
-			// 如果AOI检测失败,要停机
+			// 濡傛灉AOI妫�娴嬪け璐ワ紝瑕佸仠鏈�
 			if (pEq->getID() == EQ_ID_MEASUREMENT) {
 				LOGD("<CMaster-%s>onPanelDataReport 01", ((CEquipment*)pEquipment)->getName().c_str());
 				if (pGlass->getAOIInspResult() == InspResult::Fail) {
 					LOGD("<CMaster-%s>onPanelDataReport 02", ((CEquipment*)pEquipment)->getName().c_str());
 					if (stop() == 0) {
 						m_nLastError = ER_CODE_AOI_NG;
-						m_strLastError = "AOI检测未通过.";
+						m_strLastError = "AOI妫�娴嬫湭閫氳繃.";
 					}
 				}
 			}
@@ -1741,7 +1832,7 @@
 	}
 
 	/*
-	 * 添加LoadPort1
+	 * 娣诲姞LoadPort1
 	 * index -- 0~3
 	 */
 	CLoadPort* CMaster::addLoadPort(int index)
@@ -1761,7 +1852,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“%s”.", pEquipment->getName().c_str());
+		LOGE("宸叉坊鍔犫��%s鈥�.", pEquipment->getName().c_str());
 
 
 		return pEquipment;
@@ -1780,7 +1871,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“Fliper”.");
+		LOGE("宸叉坊鍔犫�淔liper鈥�.");
 		return pEquipment;
 	}
 
@@ -1797,7 +1888,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“VacuumBake”.");
+		LOGE("宸叉坊鍔犫�淰acuumBake鈥�.");
 
 		return pEquipment;
 	}
@@ -1815,7 +1906,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“Aligner”.");
+		LOGE("宸叉坊鍔犫�淎ligner鈥�.");
 
 		return pEquipment;
 	}
@@ -1833,7 +1924,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“EFEM(ROBOT)”.");
+		LOGE("宸叉坊鍔犫�淓FEM(ROBOT)鈥�.");
 
 		return pEquipment;
 	}
@@ -1849,7 +1940,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“ARM”.");
+		LOGE("宸叉坊鍔犫�淎RM鈥�.");
 
 		return pEquipment;
 	}
@@ -1865,12 +1956,12 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“%s”.", pEquipment->getName().c_str());
+		LOGE("宸叉坊鍔犫��%s鈥�.", pEquipment->getName().c_str());
 
 		return pEquipment;
 	}
 
-	/* 添加bonder1 或 bonder2 
+	/* 娣诲姞bonder1 鎴� bonder2 
 	 * index -- 0, bonder1
 	 * index -- 1, bonder2
 	 */
@@ -1889,7 +1980,7 @@
 
 
 		pEquipment->init();
-		LOGE("已添加“%s”.", pEquipment->getName().c_str());
+		LOGE("宸叉坊鍔犫��%s鈥�.", pEquipment->getName().c_str());
 
 
 		return pEquipment;
@@ -1907,7 +1998,7 @@
 		addToEquipmentList(pEquipment);
 
 		pEquipment->init();
-		LOGE("已添加“Aligner”.");
+		LOGE("宸叉坊鍔犫�淎ligner鈥�.");
 
 		return pEquipment;
 	}
@@ -1924,7 +2015,7 @@
 		addToEquipmentList(pEquipment);
 
 		pEquipment->init();
-		LOGE("已添加“Measurement”.");
+		LOGE("宸叉坊鍔犫�淢easurement鈥�.");
 
 		return pEquipment;
 	}
@@ -1939,7 +2030,7 @@
 		static int i = 0;
 		i++;
 
-		// 自动保存缓存
+		// 鑷姩淇濆瓨缂撳瓨
 		if (i % (4 * 2) == 0) {
 			if (m_bDataModify) {
 				saveCacheAndBackups();
@@ -1948,8 +2039,174 @@
 		}
 
 
+		// 妯℃嫙娴嬭瘯锛堟棤鏈哄櫒鑱旀満鏃剁敤浜庤仈璋� EAP锛�
+		// 璇诲彇 test.ini锛堝綋鍓嶇洰褰曟垨 exe 鍚岀洰褰曪級
+		{
+			struct SimCfg {
+				bool enabled{ false };
+				DWORD intervalMs{ 5000 };
+				int step{ 0 };
+			};
+			auto loadCfg = [&]() -> SimCfg {
+				SimCfg cfg;
 
-		// 模拟测试
+				// Try INI: current dir, then exe dir
+				char iniPath[MAX_PATH] = { 0 };
+				strcpy_s(iniPath, "test.ini");
+				auto readIni = [&](const char* path) -> bool {
+					const UINT en = GetPrivateProfileIntA("SimEap", "Enabled", 0, path);
+					if (en == 0) return false; // treat as missing/disabled
+					cfg.enabled = (en != 0);
+					cfg.intervalMs = (DWORD)GetPrivateProfileIntA("SimEap", "IntervalMs", 5000, path);
+					cfg.intervalMs = max(500u, cfg.intervalMs);
+					cfg.step = (int)GetPrivateProfileIntA("SimEap", "Step", 0, path);
+					return true;
+				};
+				if (!readIni(iniPath)) {
+					char exePath[MAX_PATH] = { 0 };
+					GetModuleFileNameA(NULL, exePath, MAX_PATH);
+					char* lastSlash = strrchr(exePath, '\\');
+					if (lastSlash != nullptr) {
+						*(lastSlash + 1) = '\0';
+						strcat_s(exePath, "test.ini");
+						readIni(exePath);
+					}
+				}
+				return cfg;
+			};
+
+			const SimCfg cfg = loadCfg();
+			if (cfg.enabled) {
+				static DWORD lastTick = 0;
+				static int lastExecutedStep = -1;
+				static bool inited = false;
+				static SERVO::CGlass simGlass;
+				static SERVO::CVcrEventReport simVcr;
+				static SERVO::CProcessJob simPj("PJ1001");
+				static SERVO::CControlJob simCj("CJ5007");
+
+				if (!inited) {
+					inited = true;
+					simGlass.setID("SIM_PANEL_001");
+					simVcr.getGlassId() = "SIM_PANEL_001";
+				}
+
+				DWORD now = GetTickCount();
+				if (lastTick == 0) lastTick = now;
+				if ((now - lastTick) < cfg.intervalMs) {
+					return;
+				}
+				lastTick = now;
+
+				// 鍗曟瑙﹀彂锛氭瘡涓� Step 鍙墽琛屼竴娆★紱浣犳墜鍔ㄤ慨鏀� ini 鐨� Step 鍊煎悗浼氬啀娆¤Е鍙�
+				const int step = cfg.step;
+				if (step <= 0 || step == lastExecutedStep) {
+					return;
+				}
+				lastExecutedStep = step;
+
+				// 鍙栦竴涓� LoadPort 浣滀负妯℃嫙鐩爣
+				SERVO::CLoadPort* pLpEq = (SERVO::CLoadPort*)getEquipment(EQ_ID_LOADPORT1);
+
+				auto fireLoadPortStatus = [&](short status) {
+					pLpEq->simulateSetCassetteId("Test-Cassette-001");
+					if (m_listener.onLoadPortStatusChanged != nullptr && pLpEq != nullptr) {
+						m_listener.onLoadPortStatusChanged(this, pLpEq, status, 0);
+					}
+				};
+				auto fireProcessState = [&](SERVO::CEquipment* pEq, int slotNo, SERVO::PROCESS_STATE st) {
+					if (m_listener.onProcessStateChanged != nullptr && pEq != nullptr) {
+						m_listener.onProcessStateChanged(this, pEq, slotNo, st);
+					}
+				};
+
+				LOGI("<Master>SIM_EAP single-step=%d", step);
+				switch (step) {
+					// ===== 涓氬姟娴佺▼姝ラ锛�1~23锛�=====
+				case 1: // E87_06 Material Arrived(TransferBlock) -> Port Blocked
+					fireLoadPortStatus(PORT_BLOCKED);
+					break;
+				case 2: // E87_03 CarrierID Readed -> Port InUse
+					fireLoadPortStatus(PORT_INUSE);
+					break;
+				case 3: // S1F3 Query CJ Space (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step3: wait host S1F3");
+					break;
+				case 4: // S16F21 Query PJ Space (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step4: wait host S16F21");
+					break;
+				case 5: // S7F19 Query PPID List (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step5: wait host S7F19");
+					break;
+				case 6: // S3F17 ProceedWithCarrier (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step6: wait host S3F17 ProceedWithCarrier");
+					break;
+				case 7: // E87_14 Check SlotMap (璁惧涓婃姤/杩涘叆 WFH) - 鐢� PORT_INUSE 鍐呴儴瑙﹀彂
+					fireLoadPortStatus(PORT_INUSE);
+					break;
+				case 8: // S3F17 ProceedWithSlotMap (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step8: wait host S3F17 ProceedWithSlotMap");
+					break;
+				case 9: // SlotMap Verify OK (鏈」鐩湪鏀跺埌 ProceedWithSlotMap 鍚庝笂鎶�) - wait host
+					LOGI("<Master>SIM_EAP step9: wait host ProceedWithSlotMap to trigger VerifyOK");
+					break;
+				case 10: // Create PJ (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step10: wait host S16F15 CreateMultiPJ");
+					break;
+				case 11: // PJ Queued锛堟湰椤圭洰鍦ㄥ垱寤� PJ 鍚庝笂鎶ワ級 - wait host
+					LOGI("<Master>SIM_EAP step11: wait host CreateMultiPJ to trigger PJ_Queued");
+					break;
+				case 12: // Create CJ (Host->EQ) - wait host
+					LOGI("<Master>SIM_EAP step12: wait host S14F9 CreateCJ");
+					break;
+				case 13: // CJ Start
+					if (m_listener.onCjStart != nullptr) m_listener.onCjStart(this, &simCj);
+					break;
+				case 14: // PJ Start
+					if (m_listener.onPjStart != nullptr) m_listener.onPjStart(this, &simPj);
+					break;
+				case 15: // OCR
+					if (m_listener.onEqVcrEventReport != nullptr && pLpEq != nullptr) {
+						m_listener.onEqVcrEventReport(this, pLpEq, &simVcr);
+					}
+					break;
+				case 16: // Panel Start
+					if (m_listener.onPanelStart != nullptr) m_listener.onPanelStart(this, &simGlass);
+					// 鍚屾椂瑙﹀彂涓�娆″瓙鏈哄彴寮�濮嬶紙绀轰緥锛欱onder1, slot 1锛�
+					fireProcessState(getEquipment(EQ_ID_Bonder1), 1, SERVO::PROCESS_STATE::Processing);
+					break;
+				case 17: // Panel End
+					// 鍚屾椂瑙﹀彂涓�娆″瓙鏈哄彴缁撴潫锛堢ず渚嬶細Bonder1, slot 1锛�
+					fireProcessState(getEquipment(EQ_ID_Bonder1), 1, SERVO::PROCESS_STATE::Complete);
+					if (m_listener.onPanelEnd != nullptr) m_listener.onPanelEnd(this, &simGlass);
+					break;
+				case 18: // PJ End
+					if (m_listener.onPjEnd != nullptr) m_listener.onPjEnd(this, &simPj);
+					break;
+				case 19: // CJ End
+					if (m_listener.onCjEnd != nullptr) m_listener.onCjEnd(this, &simCj);
+					break;
+				case 20: // Ready to Release (Port Unload Ready; with prev INUSE will also trigger ReadyToRelease)
+					fireLoadPortStatus(PORT_UNLOAD_READY);
+					break;
+				case 21: // CarrierRelease (Host->EQ) - optional / wait host
+					LOGI("<Master>SIM_EAP step21: wait host S3F17 CarrierRelease");
+					break;
+				case 22: // Ready to Unload
+					fireLoadPortStatus(PORT_UNLOAD_READY);
+					break;
+				case 23: // Material Removed (and ReadyToLoad)
+					fireLoadPortStatus(PORT_LOAD_READY);
+					fireLoadPortStatus(PORT_EMPTY); // will also raise LoadPortNotAssoc via Model
+					break;
+				default:
+					break;
+				}
+			}
+		}
+
+
+		// 妯℃嫙娴嬭瘯
 		/*
 		static int aaa = 0;
 		aaa++;
@@ -1960,7 +2217,7 @@
 				glassFromQueueToInPorcess(pGlass);
 				this->saveState();
 
-				// 这里上报Panel Start事件
+				// 杩欓噷涓婃姤Panel Start浜嬩欢
 				if (m_listener.onPanelStart != nullptr) {
 					m_listener.onPanelStart(this, pGlass);
 				}
@@ -1976,7 +2233,7 @@
 				glassFromInPorcessToComplete(pGlass);
 				this->saveState();
 
-				// 这里上报Panel End事件
+				// 杩欓噷涓婃姤Panel End浜嬩欢
 				if (m_listener.onPanelEnd != nullptr) {
 					m_listener.onPanelEnd(this, pGlass);
 				}
@@ -1985,17 +2242,17 @@
 				if (pJob != nullptr && checkAndUpdatePjComplete(pJob)) {
 					processJobFromInPorcessToComplete(pJob);
 					this->saveState();
-					LOGE("<Master>ProcessJob(%s)完成.",
+					LOGE("<Master>ProcessJob(%s)瀹屾垚.",
 						pJob->id().c_str());
 					if (m_listener.onPjEnd != nullptr) {
 						m_listener.onPjEnd(this, pJob);
 					}
 
-					// 检查CJ是否已经完成
+					// 妫�鏌J鏄惁宸茬粡瀹屾垚
 					ASSERT(m_pControlJob);
 					if (checkAndUpdateCjComplete(m_pControlJob)) {
 						this->saveState();
-						LOGE("<Master>ControlJob(%s)完成.",
+						LOGE("<Master>ControlJob(%s)瀹屾垚.",
 							m_pControlJob->id().c_str());
 						if (m_listener.onCjEnd != nullptr) {
 							m_listener.onCjEnd(this, pJob);
@@ -2024,63 +2281,63 @@
 
 		nRet = pLoadPort1->getPin("Out")->connectPin(pAligner->getPin("In1"));
 		if (nRet < 0) {
-			LOGE("连接LoadPort1-Fliper失败");
+			LOGE("杩炴帴LoadPort1-Fliper澶辫触");
 		}
 		nRet = pLoadPort2->getPin("Out")->connectPin(pAligner->getPin("In2"));
 		if (nRet < 0) {
-			LOGE("连接LoadPort1-Fliper失败");
+			LOGE("杩炴帴LoadPort1-Fliper澶辫触");
 		}
 
 		nRet = pAligner->getPin("Out1")->connectPin(pFliper->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接Aligner-Fliper失败");
+			LOGE("杩炴帴Aligner-Fliper澶辫触");
 		}
 		nRet = pAligner->getPin("Out2")->connectPin(pVacuumBake->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接Aligner-VacuumBake失败");
+			LOGE("杩炴帴Aligner-VacuumBake澶辫触");
 		}
 
 		nRet = pFliper->getPin("Out1")->connectPin(pBonder1->getPin("In1"));
 		if (nRet < 0) {
-			LOGE("连接Fliper-Bonder1失败");
+			LOGE("杩炴帴Fliper-Bonder1澶辫触");
 		}
 		nRet = pFliper->getPin("Out2")->connectPin(pBonder2->getPin("In1"));
 		if (nRet < 0) {
-			LOGE("连接Fliper-Bonder2失败");
+			LOGE("杩炴帴Fliper-Bonder2澶辫触");
 		}
 
 		nRet = pVacuumBake->getPin("Out1")->connectPin(pBonder1->getPin("In2"));
 		if (nRet < 0) {
-			LOGE("连接VacuumBake-Bonder1失败");
+			LOGE("杩炴帴VacuumBake-Bonder1澶辫触");
 		}
 		nRet = pVacuumBake->getPin("Out2")->connectPin(pBonder2->getPin("In2"));
 		if (nRet < 0) {
-			LOGE("连接VacuumBake-Bonder2失败");
+			LOGE("杩炴帴VacuumBake-Bonder2澶辫触");
 		}
 
 		nRet = pBonder1->getPin("Out")->connectPin(pBakeCooling->getPin("In1"));
 		if (nRet < 0) {
-			LOGE("连接Bonder1-BakeCooling失败");
+			LOGE("杩炴帴Bonder1-BakeCooling澶辫触");
 		}
 
 		nRet = pBonder2->getPin("Out")->connectPin(pBakeCooling->getPin("In2"));
 		if (nRet < 0) {
-			LOGE("连接Bonder2-BakeCooling失败");
+			LOGE("杩炴帴Bonder2-BakeCooling澶辫触");
 		}
 
 		nRet = pBakeCooling->getPin("Out")->connectPin(pMeasurement->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接BakeCooling-LoadPort3失败");
+			LOGE("杩炴帴BakeCooling-LoadPort3澶辫触");
 		}
 
 		nRet = pMeasurement->getPin("Out1")->connectPin(pLoadPort3->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接BakeCooling-LoadPort3失败");
+			LOGE("杩炴帴BakeCooling-LoadPort3澶辫触");
 		}
 
 		nRet = pMeasurement->getPin("Out2")->connectPin(pLoadPort4->getPin("In"));
 		if (nRet < 0) {
-			LOGE("连接BakeCooling-LoadPort4失败");
+			LOGE("杩炴帴BakeCooling-LoadPort4澶辫触");
 		}
 	}
 
@@ -2104,7 +2361,7 @@
 		saveCache();
 
 
-		// 创建备份目录
+		// 鍒涘缓澶囦唤鐩綍
 		CString strNewFile;
 		CString strFileDir = m_strFilepath.c_str();
 		int index = strFileDir.ReverseFind('\\');
@@ -2358,8 +2615,8 @@
 		}
 		unlock();
 
-		// 当前任务手动中止后,停止调度,需要操作员在解决问题后,重新启动
-		// 25年7月23日后修改为不停止任务
+		// 褰撳墠浠诲姟鎵嬪姩涓鍚庯紝鍋滄璋冨害锛岄渶瑕佹搷浣滃憳鍦ㄨВ鍐抽棶棰樺悗锛岄噸鏂板惎鍔�
+		// 25骞�7鏈�23鏃ュ悗淇敼涓轰笉鍋滄浠诲姟
 		// stop();
 
 		return 0;
@@ -2517,15 +2774,31 @@
 		}
 		m_processJobs = temp;
 
+		// 閲嶇疆鍚勭鍙� DownloadMap锛圚ost/鏈湴鍕鹃�夌殑鏈熸湜鍔犲伐妲戒綅锛�
+		for (int i = 0; i < 4; i++) {
+			auto* pPort = (CLoadPort*)getEquipment(EQ_ID_LOADPORT1 + i);
+			if (pPort != nullptr) {
+				pPort->setDownloadCassetteMap(0);
+			}
+		}
 
-		// 更新context
-		std::vector<uint8_t> newSlots;
-		std::vector<void*> newContexts;
+
+		// 鏇存柊context
 		for (auto pj : m_processJobs) {
 			for (auto& c : pj->carriers()) {
 				auto pPort = getPortWithCarrierId(c.carrierId);
 				if (pPort == nullptr) continue;
 
+				short downloadMap = 0;
+				for (auto s : c.slots) {
+					if (s >= 1 && s <= 8) {
+						downloadMap |= (short)(1 << (s - 1));
+					}
+				}
+				pPort->setDownloadCassetteMap((short)(pPort->getDownloadCassetteMap() | downloadMap));
+
+				std::vector<uint8_t> newSlots;
+				std::vector<void*> newContexts;
 				for (auto s : c.slots) {
 					auto pGlass = pPort->getGlassFromSlot(s);
 					if (pGlass == nullptr) continue;
@@ -2541,6 +2814,9 @@
 
 
 		this->saveState();
+		if (m_listener.onControlJobChanged) {
+			m_listener.onControlJobChanged(this);
+		}
 
 		return (int)m_processJobs.size();
 	}
@@ -2561,23 +2837,23 @@
 
 	int CMaster::setControlJob(CControlJob& controlJob)
 	{
-		// 回调:是否参创建ControlJob
+		// 鍥炶皟锛氭槸鍚﹀弬鍒涘缓ControlJob
 		auto canCreateCjFn = [&](uint32_t& cc, std::string& mm) -> bool {
 			if (m_pControlJob != nullptr) {
 				cc = 1100;
-				mm = "当前ControlJob未结批,不能创建新的ControlJob";
+				mm = "褰撳墠ControlJob鏈粨鎵癸紝涓嶈兘鍒涘缓鏂扮殑ControlJob";
 				return false;
 			}
 			return true;
 		};
 
 
-		// 回调:是否存在
+		// 鍥炶皟锛氭槸鍚﹀瓨鍦�
 		auto pjExists = [&](const std::string& id) -> bool {
 			return getProcessJob(id) != nullptr;
 		};
 
-		// 回调:是否可加入 CJ(这里定义:必须是 Queued)
+		// 鍥炶皟锛氭槸鍚﹀彲鍔犲叆 CJ锛堣繖閲屽畾涔夛細蹇呴』鏄� Queued锛�
 		auto pjJoinable = [&](const std::string& id) -> bool {
 			auto pj = getProcessJob(id);
 			if (pj == nullptr) return false;
@@ -2598,6 +2874,9 @@
 		}
 		m_pControlJob->setPJs(temps);
 		this->saveState();
+		if (m_listener.onControlJobChanged) {
+			m_listener.onControlJobChanged(this);
+		}
 
 
 		return 0;
@@ -2658,27 +2937,27 @@
 		std::ofstream ofs(m_strStatePath, std::ios::binary);
 		if (!ofs) return false;
 
-		// 文件头
+		// 鏂囦欢澶�
 		uint32_t magic = 0x4D415354; // 'MAST'
 		uint16_t version = 1;
 		ofs.write(reinterpret_cast<const char*>(&magic), sizeof(magic));
 		ofs.write(reinterpret_cast<const char*>(&version), sizeof(version));
 
-		// 保存 ControlJob
+		// 淇濆瓨 ControlJob
 		bool hasCJ = (m_pControlJob != nullptr);
 		ofs.write(reinterpret_cast<const char*>(&hasCJ), sizeof(hasCJ));
 		if (hasCJ) {
 			m_pControlJob->serialize(ofs);
 		}
 
-		// 保存 ProcessJob 列表
+		// 淇濆瓨 ProcessJob 鍒楄〃
 		uint32_t count = static_cast<uint32_t>(m_processJobs.size());
 		ofs.write(reinterpret_cast<const char*>(&count), sizeof(count));
 		for (const auto& job : m_processJobs) {
 			job->serialize(ofs);
 		}
 
-		// 以后可以在这里追加新字段
+		// 浠ュ悗鍙互鍦ㄨ繖閲岃拷鍔犳柊瀛楁
 		return true;
 	}
 
@@ -2687,14 +2966,14 @@
 		std::ifstream ifs(m_strStatePath, std::ios::binary);
 		if (!ifs) return false;
 
-		// 文件头
+		// 鏂囦欢澶�
 		uint32_t magic = 0;
 		uint16_t version = 0;
 		ifs.read(reinterpret_cast<char*>(&magic), sizeof(magic));
 		ifs.read(reinterpret_cast<char*>(&version), sizeof(version));
 
 		if (magic != 0x4D415354) {
-			// 文件不合法
+			// 鏂囦欢涓嶅悎娉�
 			return false;
 		}
 
@@ -2703,7 +2982,7 @@
 			m_pControlJob = nullptr;
 		}
 
-		// 读取 ControlJob
+		// 璇诲彇 ControlJob
 		bool hasCJ = false;
 		ifs.read(reinterpret_cast<char*>(&hasCJ), sizeof(hasCJ));
 		if (hasCJ) {
@@ -2714,7 +2993,7 @@
 			return false;
 		}
 
-		// 读取 ProcessJob 列表
+		// 璇诲彇 ProcessJob 鍒楄〃
 		uint32_t count = 0;
 		ifs.read(reinterpret_cast<char*>(&count), sizeof(count));
 		m_processJobs.clear();
@@ -2725,7 +3004,7 @@
 		}
 
 
-		// 找到CProcessJob指针加入列表中
+		// 鎵惧埌CProcessJob鎸囬拡鍔犲叆鍒楄〃涓�
 		std::vector<CProcessJob*> tempPjs;
 		auto ids = m_pControlJob->pjIds();
 		for (auto id : ids) {
@@ -2737,7 +3016,7 @@
 		m_pControlJob->setPJs(tempPjs);
 
 
-		// 更新contexts
+		// 鏇存柊contexts
 		auto pjs = m_pControlJob->getPjs();
 		for (auto pj : pjs) {
 			for (auto& c : pj->carriers()) {
@@ -2755,7 +3034,7 @@
 		}
 
 
-		// 如果版本升级,可在这里判断 version 来加载新字段
+		// 濡傛灉鐗堟湰鍗囩骇锛屽彲鍦ㄨ繖閲屽垽鏂� version 鏉ュ姞杞芥柊瀛楁
 
 
 		return true;
@@ -2783,7 +3062,7 @@
 	CGlass* CMaster::acquireNextGlass()
 	{
 		for (auto* pj : m_inProcesJobs) {
-			// 遍历 PJ 的 carriers 和 slots
+			// 閬嶅巻 PJ 鐨� carriers 鍜� slots
 			for (auto& cs : pj->carriers()) {
 				for (auto ctx : cs.contexts) {
 					CGlass* pGlass = (CGlass*)ctx;
@@ -2794,14 +3073,14 @@
 				}
 			}
 		}
-		return nullptr; // 没有可加工的 Glass
+		return nullptr; // 娌℃湁鍙姞宸ョ殑 Glass
 	}
 
 	int CMaster::acquireGlassToQueue()
 	{
 		int nCount = 0;
 		for (auto* pj : m_inProcesJobs) {
-			// 遍历 PJ 的 carriers 和 slots
+			// 閬嶅巻 PJ 鐨� carriers 鍜� slots
 			if (pj->carriers().empty()) continue;
 			for (auto& cs : pj->carriers()) {
 				for (auto ctx : cs.contexts) {
@@ -2921,7 +3200,7 @@
 
 
 
-		// 释放Job相关
+		// 閲婃斁Job鐩稿叧
 		for (auto item : m_processJobs) {
 			delete item;
 		}
@@ -2931,7 +3210,7 @@
 			m_pControlJob = nullptr;
 		}
 
-		// 注意要释放引用
+		// 娉ㄦ剰瑕侀噴鏀惧紩鐢�
 		m_inProcesJobs.clear();
 		m_completeProcessJobs.clear();
 		m_queueGlasses.clear();
@@ -2940,6 +3219,9 @@
 
 
 		saveState();
+		if (m_listener.onControlJobChanged) {
+			m_listener.onControlJobChanged(this);
+		}
 
 		return true;
 	}
@@ -2955,7 +3237,7 @@
 		m_pControlJob->abort(description);
 
 
-		// 释放Job相关
+		// 閲婃斁Job鐩稿叧
 		for (auto item : m_processJobs) {
 			delete item;
 		}
@@ -2965,7 +3247,7 @@
 			m_pControlJob = nullptr;
 		}
 
-		// 注意要释放引用
+		// 娉ㄦ剰瑕侀噴鏀惧紩鐢�
 		m_inProcesJobs.clear();
 		m_completeProcessJobs.clear();
 		m_queueGlasses.clear();
@@ -2974,6 +3256,9 @@
 
 
 		saveState();
+		if (m_listener.onControlJobChanged) {
+			m_listener.onControlJobChanged(this);
+		}
 
 		return true;
 	}
@@ -3022,7 +3307,7 @@
 	{
 		if (stop() == 0) {
 			m_nLastError = ER_CODE_AOI_NG;
-			m_strLastError = "AOI检测未通过.";
+			m_strLastError = "AOI妫�娴嬫湭閫氳繃.";
 		}
 	}
 
@@ -3096,7 +3381,7 @@
 
 		};
 
-		// 事件:有人连入/断开就上日志
+		// 浜嬩欢锛氭湁浜鸿繛鍏�/鏂紑灏变笂鏃ュ織
 		auto clieintEventCallback = [](const std::string& ip, uint16_t port, bool connected) {
 			LOGI("<DAQBridge>[Client %s] %s:%u", connected ? _T("JOIN") : _T("LEAVE"), ip.c_str(), port);
 		};
@@ -3109,76 +3394,62 @@
 			m_pCollector->createServer(8081);
 			m_pCollector->startLoop(10);
 
-			// 1) 注册机台(推荐:先注册 id + 机器名称)
+			// 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) 为通道设置“曲线名称”
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 1, "气囊压力");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 2, "上腔压力");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 3, "管道真空规值");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 4, "腔体真空规值");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 5, "上腔温度1");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 6, "上腔温度2");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 7, "上腔温度3");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 8, "上腔温度4");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 9, "上腔温度5");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 10, "上腔温度6");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 11, "下腔温度1");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 12, "下腔温度2");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 13, "下腔温度3");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 14, "下腔温度4");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 15, "下腔温度5");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder1, 16, "下腔温度6");
+			// 2) 涓洪�氶亾璁剧疆鈥滄洸绾垮悕绉扳��
+			auto& dataTypes = CServoUtilsTool::getEqDataTypes();
+			auto& bonderTypes = dataTypes[MID_Bonder1];
+			for (size_t i = 0; i < bonderTypes.size(); ++i) {
+				m_pCollector->buffersSetChannelName(MID_Bonder1, i + 1, bonderTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_Bonder2, i + 1, bonderTypes[i].c_str());
+			}
 
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 1, "气囊压力");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 2, "上腔压力");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 3, "管道真空规值");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 4, "腔体真空规值");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 5, "上腔温度1");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 6, "上腔温度2");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 7, "上腔温度3");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 8, "上腔温度4");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 9, "上腔温度5");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 10, "上腔温度6");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 11, "下腔温度1");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 12, "下腔温度2");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 13, "下腔温度3");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 14, "下腔温度4");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 15, "下腔温度5");
-			m_pCollector->buffersSetChannelName(EQ_ID_Bonder2, 16, "下腔温度6");
+			auto& vacuumbakeTypes = dataTypes[MID_VacuumBakeA];
+			for (size_t i = 0; i < vacuumbakeTypes.size(); ++i) {
+				m_pCollector->buffersSetChannelName(MID_VacuumBakeA, i + 1, vacuumbakeTypes[i].c_str());
+				m_pCollector->buffersSetChannelName(MID_VacuumBakeB, i + 1, vacuumbakeTypes[i].c_str());
+			}
 
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 1, "A腔真空规值");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 2, "A腔温控1");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 3, "A腔温控2");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 4, "A腔温控4");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 5, "A腔温控5");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 6, "A腔温控6");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 7, "A腔温控7");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 8, "B腔真空规值");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 9, "B腔温控1");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 10, "B腔温控2");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 11, "B腔温控4");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 12, "B腔温控5");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 13, "B腔温控6");
-			m_pCollector->buffersSetChannelName(EQ_ID_VACUUMBAKE, 14, "B腔温控7");
-
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 1, "A烘烤温控1");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 2, "A烘烤温控2");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 3, "A烘烤温控4");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 4, "A烘烤温控5");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 5, "A烘烤温控6");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 6, "A烘烤温控7");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 7, "B烘烤温控1");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 8, "B烘烤温控2");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 9, "B烘烤温控4");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 10, "B烘烤温控5");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 11, "B烘烤温控6");
-			m_pCollector->buffersSetChannelName(EQ_ID_BAKE_COOLING, 12, "B烘烤温控7");
+			auto& coolingTypes = dataTypes[MID_BakeCoolingA];
+			for (size_t i = 0; i < coolingTypes.size(); ++i) {
+				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;
+	}
 }

--
Gitblit v1.9.3