From 2d69213b1b41b5b039e5dc6f6b7c55d53fd03037 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 13 五月 2025 09:34:04 +0800
Subject: [PATCH] Merge branch 'clh'

---
 SourceCode/Bond/Servo/CPageGraph2.cpp |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index ffc169d..cc44782 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -22,6 +22,7 @@
 	m_pEqsGraphWnd = nullptr;
 	m_crBkgnd = PAGE_GRPAH2_BACKGROUND_COLOR;
 	m_hbrBkgnd = nullptr;
+	m_pObserver = nullptr;
 }
 
 CPageGraph2::~CPageGraph2()
@@ -45,9 +46,44 @@
 // CPageGraph2 娑堟伅澶勭悊绋嬪簭
 
 
+void CPageGraph2::InitRxWindows()
+{
+	/* code */
+	// 璁㈤槄鏁版嵁
+	IRxWindows* pRxWindows = RX_GetRxWindows();
+	pRxWindows->enableLog(5);
+	if (m_pObserver == NULL) {
+		m_pObserver = pRxWindows->allocObserver([&](IAny* pAny) -> void {
+			// onNext
+			pAny->addRef();
+			int code = pAny->getCode();
+			if (RX_CODE_EQ_DATA_CHANGED == code) {
+				// 閫氱煡璁惧鐘舵��
+				SERVO::CEquipment* pEquipment = nullptr;
+				if (pAny->getPtrValue("ptr", (void*&)pEquipment)) {
+					if (pEquipment != nullptr) {
+						m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, !pEquipment->isGlassListEmpty());
+					}
+				}
+			}
+
+			pAny->release();
+			}, [&]() -> void {
+				// onComplete
+			}, [&](IThrowable* pThrowable) -> void {
+				// onErrorm
+				pThrowable->printf();
+			});
+
+		theApp.m_model.getObservable()->observeOn(pRxWindows->mainThread())
+			->subscribe(m_pObserver);
+	}
+}
+
 BOOL CPageGraph2::OnInitDialog()
 {
 	CDialogEx::OnInitDialog();
+	InitRxWindows();
 	SetTimer(1, 2000, nullptr);
 
 
@@ -154,11 +190,14 @@
 		// 娴嬭瘯
 		else if (nCmd == ID_EQSGRAPHITEM_TEST1) {
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
-			pEquipment->outputGlass(0);
+			if (pEquipment->getID() == EQ_ID_LOADPORT1) {
+				pEquipment->outputGlass(1);
+			}
+			pEquipment->fetchedOutJob("P20250320A1A2");
 		}
 		else if (nCmd == ID_EQSGRAPHITEM_TEST2) {
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
-			pEquipment->outputGlass(1);
+			pEquipment->storedJob("P20250320A1A2");
 		}
 		else if (nCmd == ID_EQSGRAPHITEM_TEST3) {
 			SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
@@ -216,13 +255,13 @@
 			}
 			*/
 			
-			/*
+			
 			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();
@@ -290,6 +329,11 @@
 	if (m_hbrBkgnd != nullptr) {
 		::DeleteObject(m_hbrBkgnd);
 	}
+
+	if (m_pObserver != nullptr) {
+		m_pObserver->unsubscribe();
+		m_pObserver = NULL;
+	}
 }
 
 
@@ -325,6 +369,8 @@
 	for (auto outPin : outPins) {
 		m_pEqsGraphWnd->AddPin(pItem, OUTPIN, outPin->getName().c_str(), (DWORD_PTR)outPin);
 	}
+
+	m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, !pEquipment->isGlassListEmpty());
 }
 
 void CPageGraph2::OnTimer(UINT_PTR nIDEvent)

--
Gitblit v1.9.3