From 31aa10eaae103c30e02d7dc6c71ff4e50de361b3 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期一, 12 五月 2025 15:28:32 +0800
Subject: [PATCH] 1. 修改报警的显示模式(包括日志,需要后期修复) 2. 添加Release模式编译

---
 SourceCode/Bond/Servo/CPageGraph2.cpp |  141 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 124 insertions(+), 17 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index 00e7b4c..ffc169d 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -5,6 +5,11 @@
 #include "Servo.h"
 #include "CPageGraph2.h"
 #include "afxdialogex.h"
+#include "CHMPropertyDlg.h"
+#include "CEquipmentPage1.h"
+#include "CEquipmentPage2.h"
+#include "CPagePortProperty.h"
+#include "CPageCassetteCtrlCmd.h"
 
 
 // CPageGraph2 瀵硅瘽妗�
@@ -54,11 +59,6 @@
 		ASSERT(pPin1->pData);
 		ASSERT(pPin2->pData);
 
-		//int nRet = ((IPin*)pPin1->pData)->checkConnectPin((IPin*)pPin2->pData);
-		//if (nRet >= 0) {
-		//	return true;
-		//}
-
 		return false;
 	};
 	listener.onConnectPin = [](PIN* pPin1, PIN* pPin2) -> bool {
@@ -67,35 +67,49 @@
 		ASSERT(pPin1->pData);
 		ASSERT(pPin2->pData);
 
-		//int nRet = ((IPin*)pPin1->pData)->connectPin((IPin*)pPin2->pData);
-		//if (nRet >= 0) {
-		//	return true;
-		//}
-
 		return false;
 	};
 	listener.onDisconnectPin = [](PIN* pPin) -> bool {
 		ASSERT(pPin);
 		ASSERT(pPin->pData);
 
-		//int nRet = ((IPin*)pPin->pData)->disconnect();
-		//if (nRet >= 0) {
-		//	return true;
-		//}
-
 		return false;
 	};
 	listener.onDeleteEqItem = [&](EQITEM* pItem) -> bool {
 		ASSERT(pItem);
 		ASSERT(pItem->pData);
-		return true;
-		// return _filterManager.unload((CFilter*)pFilter->pData) >= 0;
+		return false;
 	};
 	listener.onEqItemPosChanged = [&](EQITEM* pItem, int x, int y) -> void {
 		ASSERT(pItem);
 	};
 	listener.onDblckEqItem = [&](EQITEM* pItem) -> bool {
 		ASSERT(pItem);
+		SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
+
+		CHMPropertyDlg dlg(pEquipment->getName().c_str(), 600, 680);
+
+		if (_strcmpi(pEquipment->getClassName(), "CLoadPort") == 0) {
+			CPagePortProperty* pPage1 = new CPagePortProperty();
+			pPage1->setLoadPort((SERVO::CLoadPort*)pEquipment);
+			pPage1->Create(IDD_PAGE_PORT_PROPERTY);
+			dlg.addPage(pPage1, "灞炴��");
+		}
+
+		CEquipmentPage2* pPage2 = new CEquipmentPage2();
+		pPage2->setEquipment(pEquipment);
+		pPage2->Create(IDD_PAGE_EQUIPMENT2);
+		dlg.addPage(pPage2, "Glass");
+
+		if (pEquipment->getID() == EQ_ID_LOADPORT1
+			|| pEquipment->getID() == EQ_ID_LOADPORT2) {
+			CPageCassetteCtrlCmd* pPage = new CPageCassetteCtrlCmd();
+			pPage->setEquipment(pEquipment);
+			pPage->Create(IDD_PAGE_CASSETTE_CTRL_CMD);
+			dlg.addPage(pPage, "Cassette control command");
+		}
+
+		dlg.DoModal();
 		return true;
 	};
 	listener.onRclickEqItem = [&](EQITEM* pItem) -> bool {
@@ -146,7 +160,97 @@
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
 			pEquipment->outputGlass(1);
 		}
+		else if (nCmd == ID_EQSGRAPHITEM_TEST3) {
+			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
 
+			// 娴嬭瘯涓嬪彂Cim Message
+			/*
+			if (pEquipment->getID() == EQ_ID_Bonder1
+				|| pEquipment->getID() == EQ_ID_Bonder2) {
+				static int msgId = 0; msgId++;
+				if (msgId % 2 == 0) {
+					pEquipment->setCimMessage("Hello!", msgId, 1);
+				}
+				else {
+					pEquipment->setCimMessage("ABC0123456789", msgId, 2);
+				}
+			}
+			*/
+
+
+			// 娴嬭瘯娓呴櫎Cim Message
+			/*
+			if (pEquipment->getID() == EQ_ID_Bonder1
+				|| pEquipment->getID() == EQ_ID_Bonder2) {
+				static int msgId = 0; msgId++;
+				if (msgId % 2 == 0) {
+					pEquipment->clearCimMessage(msgId, 1);
+				}
+				else {
+					pEquipment->clearCimMessage(msgId, 2);
+				}
+			}
+			*/
+
+			// 娴嬭瘯璁剧疆鏃堕棿
+			/*
+			if (pEquipment->getID() == EQ_ID_Bonder1
+				|| pEquipment->getID() == EQ_ID_Bonder2) {
+				CTime time = CTime::GetCurrentTime();
+				pEquipment->setDateTime((short)time.GetYear(),
+					(short)time.GetMonth(),
+					(short)time.GetDay(),
+					(short)time.GetHour(),
+					(short)time.GetMinute(),
+					(short)time.GetSecond());
+			}
+			*/
+
+			
+			// 娴嬭瘯璁剧疆cim mode
+			/*
+			if (pEquipment->getID() == EQ_ID_Bonder1
+				|| pEquipment->getID() == EQ_ID_Bonder2) {
+				static int ii = 0; ii++;
+				pEquipment->setCimMode(ii % 2 == 0);
+			}
+			*/
+			
+			/*
+			if (pEquipment->getID() == EQ_ID_Bonder1
+				|| pEquipment->getID() == EQ_ID_Bonder2) {
+				static int ii = 0; ii++;
+				pEquipment->setEqMode((ii % 5) + 1);
+			}
+			*/
+
+			/*
+			SERVO::CGlass* pGlass = pEquipment->getFrontGlass();
+			if (pGlass != nullptr) {
+				std::string strDescription;
+				SERVO::CPath* pPath = pGlass->getPath();
+				while (pPath != nullptr) {
+					pPath->getDescription(strDescription);
+					AfxMessageBox(strDescription.c_str());
+					pPath = pPath->getNext();
+				}
+			}
+			*/
+
+
+			// 璇锋眰涓婚厤鏂瑰垪琛�
+			if (pEquipment != nullptr) {
+				pEquipment->masterRecipeListRequest(0);
+			}			
+		}
+
+
+		return true;
+	};
+	listener.onSelectEqItem = [&](EQITEM* pItem) -> bool {
+		ASSERT(pItem);
+		SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
+		theApp.m_model.notifyPtr(RX_CODE_SELECT_EQUIPMENT, pEquipment);
 
 		return true;
 	};
@@ -254,6 +358,9 @@
 	std::list<SERVO::CEquipment*>& eqs = theApp.m_model.m_master.getEquipmentList();
 	for (auto item : eqs) {
 		EQITEM* pEqItem = m_pEqsGraphWnd->GetItem((DWORD_PTR)item);
+		if (nullptr == pEqItem) {
+			continue;
+		}
 
 		strValue.Format(_T("%d"), pEqItem->rect.left);
 		WritePrivateProfileString(item->getName().c_str(), _T("Left"),

--
Gitblit v1.9.3