From bc7f1c4e028e69be51079b59dae4ae5c4d43f5bb Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 31 一月 2026 21:54:56 +0800
Subject: [PATCH] 1.状态指示图,目前灰色表示掉线,绿色表示在线。增加Slot的小点表示有没有料,及加工状态 。 2.增加图示

---
 SourceCode/Bond/Servo/CControlJobManagerDlg.cpp |  106 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 62 insertions(+), 44 deletions(-)

diff --git a/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp b/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp
index 037b595..78036f4 100644
--- a/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp
+++ b/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp
@@ -78,6 +78,9 @@
 			if (contextType == 1) {
 				UpProcessJobId((PJWarp*)pContext);
 			}
+			else if (contextType == 2) {
+				UpControlJobId((SERVO::CControlJob*)pContext);
+			}
 		}
 	};
 
@@ -307,7 +310,8 @@
 			SERVO::CControlJob* cj = (SERVO::CControlJob*)m_tree.GetItemData(hSel);
 			ASSERT(m_pages.size() == 3);
 			if (0 == ShowPage(2)) {
-
+				SERVO::CControlJob* pControlJob = (SERVO::CControlJob*)m_tree.GetItemData(hSel);
+				m_pages[2]->SetContext(pControlJob, 2);
 			}
 		}
 		else if (m_tree.GetParentItem(hParent) == nullptr) {
@@ -403,6 +407,20 @@
 		}
 
 		hRoot = m_tree.GetNextSiblingItem(hRoot);
+	}
+}
+
+void CControlJobManagerDlg::UpControlJobId(SERVO::CControlJob* pControlJob)
+{
+	// 鏇存柊鏍戞帶浠�
+	// 閬嶅巻鏍硅妭鐐�
+	HTREEITEM hRoot = m_tree.GetRootItem();
+	if (hRoot != nullptr) {
+		DWORD_PTR data = m_tree.GetItemData(hRoot);
+		if ((void*)data == pControlJob) {
+			m_tree.SetItemText(hRoot, pControlJob->id().c_str());
+			return; // 鎵惧埌灏辫繑鍥�
+		}
 	}
 }
 
@@ -516,15 +534,6 @@
 	m_pControlJob->setPJs(pjs);
 	m_pControlJob->clearIssues();
 	int nRet = master.setProcessJobs(pjs);
-
-	// 娌℃湁闂鐨刾j瑕侀噴鏀�
-	for (auto pj : pjs) {
-		if (!pj->issues().empty()) {
-			delete pj;
-		}
-	}
-	pjs.clear();
-
 	if (nRet <= 0) {
 		std::string msg("鍚屾Process Job澶辫触!");
 		for (auto pj : pjs) {
@@ -541,11 +550,20 @@
 					msg.append("\n");
 				}
 			}
+			delete pj;
 		}
+		pjs.clear();
 		AfxMessageBox(msg.c_str());
-
 		return;
 	}
+
+	// 缁х画閲婃斁鏈夐棶棰樼殑 ProcessJob
+	for (auto pj : pjs) {
+		if (!pj->issues().empty()) {
+			delete pj;
+		}
+	}
+	pjs.clear();
 
 	nRet = master.setControlJob(*m_pControlJob);
 	if (nRet != 0) {
@@ -574,55 +592,55 @@
 		SERVO::CLoadPort* pLoadPort = pPorts[m_pjWarps[p].port];
 		for (int i = 0; i < SLOT_MAX; ++i) {
 			SERVO::CSlot* pSlot = pLoadPort->getSlot(i);
-			if (!pSlot) {
-				continue;
-			}
-			
+			if (!pSlot) continue;
+
+			SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
+			if (pGlass == nullptr) continue;
+
+			SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
+			if (pJobDataS == nullptr) continue;
+
+
 			// 璁剧疆 Panel ID 鍜屽嬀閫夋
 			SERVO::CProcessJob* pj = (SERVO::CProcessJob*)m_pjWarps[p].pj;
 			int nRecipeID = RecipeManager::getInstance().getIdByPPID(pj->recipeSpec());
 			RecipeInfo stRecipeInfo = RecipeManager::getInstance().getRecipeByPPID(pj->recipeSpec());
 			std::vector<DeviceRecipe> vecRecipeInfo = stRecipeInfo.vecDeviceList;
-			SERVO::CGlass* pGlass = dynamic_cast<SERVO::CGlass*>(pSlot->getContext());
-			SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
-			if (pGlass != nullptr && pJobDataS != nullptr) {
-				pGlass->setScheduledForProcessing(m_pjWarps[p].checkSlot[i]);
-				pGlass->setType(static_cast<SERVO::MaterialsType>(m_pjWarps[p].material[i]));
 
-				SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
-				pJobDataS->setLotId(pj->getLotId().c_str());
+			pGlass->setScheduledForProcessing(m_pjWarps[p].checkSlot[i]);
+			pGlass->setType(static_cast<SERVO::MaterialsType>(m_pjWarps[p].material[i]));
+
+			pJobDataS->setLotId(pj->getLotId().c_str());
 				pJobDataS->setProductId(pj->getProductId().c_str());
 				pJobDataS->setOperationId(pj->getOperationId().c_str());
 				pJobDataS->setMaterialsType(m_pjWarps[p].material[i]);
 				pJobDataS->setMasterRecipe(nRecipeID);
 
-				for (const auto& info : vecRecipeInfo) {
-					const std::string& name = info.strDeviceName;
-					short nRecipeID = (short)info.nRecipeID;
+			for (const auto& info : vecRecipeInfo) {
+				const std::string& name = info.strDeviceName;
+				short nRecipeID = (short)info.nRecipeID;
 				
-					if (name == EQ_NAME_EFEM) {
-						pJobDataS->setDeviceRecipeId(0, nRecipeID);
-					}
-					else if (name == EQ_NAME_BONDER1) {
-						pJobDataS->setDeviceRecipeId(1, nRecipeID);
-					}
-					else if (name == EQ_NAME_BONDER2) {
-						pJobDataS->setDeviceRecipeId(2, nRecipeID);
-					}
-					else if (name == EQ_NAME_BAKE_COOLING) {
-						pJobDataS->setDeviceRecipeId(3, nRecipeID);
-					}
-					else if (name == EQ_NAME_VACUUMBAKE) {
-						pJobDataS->setDeviceRecipeId(4, nRecipeID);
-					}
-					else if (name == EQ_NAME_MEASUREMENT) {
-						pJobDataS->setDeviceRecipeId(5, nRecipeID);
-					}
+				if (name == EQ_NAME_EFEM) {
+					pJobDataS->setDeviceRecipeId(0, nRecipeID);
+				}
+				else if (name == EQ_NAME_BONDER1) {
+					pJobDataS->setDeviceRecipeId(1, nRecipeID);
+				}
+				else if (name == EQ_NAME_BONDER2) {
+					pJobDataS->setDeviceRecipeId(2, nRecipeID);
+				}
+				else if (name == EQ_NAME_BAKE_COOLING) {
+					pJobDataS->setDeviceRecipeId(3, nRecipeID);
+				}
+				else if (name == EQ_NAME_VACUUMBAKE) {
+					pJobDataS->setDeviceRecipeId(4, nRecipeID);
+				}
+				else if (name == EQ_NAME_MEASUREMENT) {
+					pJobDataS->setDeviceRecipeId(5, nRecipeID);
 				}
 			}
 		}
 	}
-
 
 	// process start
 	for (int p = 0; p < 4; p++) {

--
Gitblit v1.9.3