From a79fcf6a937e1bfe57014d2c99f1bb9f98bfa892 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 10 二月 2026 10:20:17 +0800
Subject: [PATCH] 1.完善日志; 2.背景图表配置 3.更改EAP通讯端口和设备名;
---
SourceCode/Bond/Servo/CPageGraph2.cpp | 214 +++++++++++++++++++++++++----------------------------
1 files changed, 100 insertions(+), 114 deletions(-)
diff --git a/SourceCode/Bond/Servo/CPageGraph2.cpp b/SourceCode/Bond/Servo/CPageGraph2.cpp
index 8c9050c..a440a50 100644
--- a/SourceCode/Bond/Servo/CPageGraph2.cpp
+++ b/SourceCode/Bond/Servo/CPageGraph2.cpp
@@ -15,6 +15,8 @@
#include "CPageCassetteCtrlCmd.h"
#include "CJobDataB.h"
+#define WM_MANUAL_ROUTE_REAPPLY (WM_APP + 105)
+
// CPageGraph2 瀵硅瘽妗�
@@ -44,6 +46,7 @@
ON_WM_DESTROY()
ON_WM_SIZE()
ON_WM_TIMER()
+ ON_MESSAGE(WM_MANUAL_ROUTE_REAPPLY, &CPageGraph2::OnManualRouteMsg)
END_MESSAGE_MAP()
@@ -61,13 +64,12 @@
// onNext
pAny->addRef();
int code = pAny->getCode();
- if (RX_CODE_EQ_DATA_CHANGED == code) {
- // 閫氱煡璁惧鐘舵��
+ if (RX_CODE_EQ_DATA_CHANGED == code
+ || RX_CODE_LOADPORT_STATUS_CHANGED == code) {
+ // 璁惧鏁版嵁鍙樺寲 / LoadPort鐘舵�佸彉鍖� 閮藉彲鑳藉鑷磗lot涓婁笅鏂囧彉鍖栵紝闇�鍒锋柊鎸囩ず鏍�
SERVO::CEquipment* pEquipment = nullptr;
- if (pAny->getPtrValue("ptr", (void*&)pEquipment)) {
- if (pEquipment != nullptr) {
- m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, pEquipment->hasGlass());
- }
+ if (pAny->getPtrValue("ptr", (void*&)pEquipment) && pEquipment != nullptr) {
+ UpdateItemIndicators(pEquipment);
}
}
@@ -122,12 +124,13 @@
};
listener.onEqItemPosChanged = [&](EQITEM* pItem, int x, int y) -> void {
ASSERT(pItem);
+ PostMessage(WM_MANUAL_ROUTE_REAPPLY, 0, 0);
};
listener.onDblckEqItem = [&](EQITEM* pItem) -> bool {
ASSERT(pItem);
SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- CHMPropertyDlg dlg(pEquipment->getName().c_str(), 658, 788);
+ CHMPropertyDlg dlg(pEquipment->getName().c_str(), 1258, 788);
CPageLinkSignal* pPage1 = new CPageLinkSignal();
pPage1->setEquipment(pEquipment);
@@ -159,7 +162,9 @@
}
if (pEquipment->getID() == EQ_ID_LOADPORT1
- || pEquipment->getID() == EQ_ID_LOADPORT2) {
+ || pEquipment->getID() == EQ_ID_LOADPORT2
+ || pEquipment->getID() == EQ_ID_LOADPORT3
+ || pEquipment->getID() == EQ_ID_LOADPORT4) {
CPageCassetteCtrlCmd* pPage = new CPageCassetteCtrlCmd();
pPage->setEquipment(pEquipment);
pPage->Create(IDD_PAGE_CASSETTE_CTRL_CMD);
@@ -210,97 +215,14 @@
// 娴嬭瘯
else if (nCmd == ID_EQSGRAPHITEM_TEST1) {
- BOOL bTestGenerate = FALSE;
- SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- if (pEquipment->getID() == EQ_ID_LOADPORT4 && !pEquipment->hasGlass()) {
- ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G1);
- bTestGenerate = TRUE;
- }
- /*
- else if (pEquipment->getID() == EQ_ID_LOADPORT2 && !pEquipment->hasGlass()) {
- ((SERVO::CLoadPort*)pEquipment)->testGenerateGlassList(SERVO::MaterialsType::G2,
- "P20250320G2X", 1);
- bTestGenerate = TRUE;
- }
- */
- if (!bTestGenerate) {
- /*
- SERVO::CRobotTask* pTask = theApp.m_model.getMaster().getActiveRobotTask();
- if (pTask != nullptr) {
- SERVO::CGlass* pGlass = (SERVO::CGlass*)pTask->getContext();
- SERVO::CJobDataB* pJobDataB = pGlass->getJobDataB();
- SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
- if (pJobDataB != nullptr && pJobDataS != nullptr) {
- pEquipment->onFetchedOutJob(0, pJobDataB);
- pEquipment->onSentOutJob(0, pJobDataS);
- }
- }
- */
- }
}
else if (nCmd == ID_EQSGRAPHITEM_TEST2) {
- SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- SERVO::CArm* pArm = (SERVO::CArm*)pEquipment->getArm();
- if (pArm != nullptr) {
- /*
- SERVO::CGlass* pGlass = pArm->getAnyGlass();
- if (pGlass != nullptr) {
- SERVO::CJobDataB* pJobDataB = pGlass->getJobDataB();
- SERVO::CJobDataS* pJobDataS = pGlass->getJobDataS();
- if (pJobDataB != nullptr && pJobDataS != nullptr) {
- pEquipment->onReceivedJob(0, pJobDataS);
- Sleep(600);
- pEquipment->onStoredJob(0, pJobDataB);
- }
- }*/
- }
}
else if (nCmd == ID_EQSGRAPHITEM_TEST3) {
- SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- if (pEquipment != nullptr) {
- SERVO::CGlass* pGlass = pEquipment->getAnyGlass();
- if (pGlass != nullptr) {
- SERVO::CProcessData pd;
- pd.setGlassId(pGlass->getID().c_str());
- pEquipment->onProcessData(&pd);
- }
- }
}
else if (nCmd == ID_EQSGRAPHITEM_TEST4) {
- SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- if (pEquipment != nullptr) {
- pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_INLINE, TRUE);
- pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_TROUBLE, FALSE);
- pEquipment->setLinkSignal(0, SIGNAL_INTERLOCK, TRUE);
- pEquipment->setLinkSignal(0, SIGNAL_SEND_ABLE, TRUE);
- pEquipment->setLinkSignal(1, SIGNAL_UPSTREAM_INLINE, TRUE);
- pEquipment->setLinkSignal(1, SIGNAL_UPSTREAM_TROUBLE, FALSE);
- pEquipment->setLinkSignal(1, SIGNAL_INTERLOCK, TRUE);
- pEquipment->setLinkSignal(1, SIGNAL_SEND_ABLE, TRUE);
- }
-
- if (pEquipment != nullptr && (pEquipment->getID() == EQ_ID_Bonder1
- || pEquipment->getID() == EQ_ID_Bonder2)) {
- SERVO::CGlass* pGlass = pEquipment->getAnyGlass();
- if (pGlass != nullptr) {
- SERVO::CProcessData pd;
- pd.setGlassId(pGlass->getID().c_str());
- pEquipment->onProcessData(&pd);
- }
- }
}
else if (nCmd == ID_EQSGRAPHITEM_TEST5) {
- SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
- if (pEquipment != nullptr) {
- pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_INLINE, TRUE);
- pEquipment->setLinkSignal(0, SIGNAL_UPSTREAM_TROUBLE, TRUE);
- pEquipment->setLinkSignal(0, SIGNAL_INTERLOCK, TRUE);
- pEquipment->setLinkSignal(0, SIGNAL_SEND_ABLE, FALSE);
- pEquipment->setLinkSignal(1, SIGNAL_UPSTREAM_INLINE, TRUE);
- pEquipment->setLinkSignal(1, SIGNAL_UPSTREAM_TROUBLE, TRUE);
- pEquipment->setLinkSignal(1, SIGNAL_INTERLOCK, TRUE);
- pEquipment->setLinkSignal(1, SIGNAL_SEND_ABLE, FALSE);
- }
}
else if (nCmd == ID_EQSGRAPHITEM_TEST6) {
SERVO::CEquipment* pEquipment = (SERVO::CEquipment*)pItem->pData;
@@ -337,8 +259,7 @@
// 娴嬭瘯璁剧疆鏃堕棿
/*
- if (pEquipment->getID() == EQ_ID_Bonder1
- || pEquipment->getID() == EQ_ID_Bonder2) {
+ if (pEquipment->getID() == EQ_ID_EFEM) {
CTime time = CTime::GetCurrentTime();
pEquipment->setDateTime((short)time.GetYear(),
(short)time.GetMonth(),
@@ -348,7 +269,6 @@
(short)time.GetSecond());
}
*/
-
// 娴嬭瘯璁剧疆cim mode
/*
@@ -359,32 +279,18 @@
}
*/
-
+ /*
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->getAnyGlass();
- 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);
- }
+ static int i = 0;
+ i++;
+ static char* pszText[] = {"123", "456", "789", "abc", "def"};
+ theApp.m_model.m_hsmsPassive.requestAlarmReport(i%3, i, pszText[i%5]);
}
@@ -402,6 +308,12 @@
m_pEqsGraphWnd->SetBkgndColor(m_crBkgnd);
m_pEqsGraphWnd->SetOnListener(listener);
+ CString strIniFile, strItem;
+ strIniFile.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+ int nIndicatorSize = GetPrivateProfileInt("PageGraph2", _T("IndicatorSize"), 10, strIniFile);
+ int nIndicatorMargin = GetPrivateProfileInt("PageGraph2", _T("IndicatorMargin"), 0, strIniFile);
+ m_pEqsGraphWnd->SetIndicatorSize(nIndicatorSize);
+ m_pEqsGraphWnd->SetIndicatorMargin(nIndicatorMargin);
return TRUE; // return TRUE unless you set the focus to a control
// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
@@ -474,7 +386,69 @@
m_pEqsGraphWnd->AddPin(pItem, OUTPIN, outPin->getName().c_str(), (DWORD_PTR)outPin);
}
- m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, pEquipment->hasGlass());
+ UpdateItemIndicators(pEquipment);
+}
+
+void CPageGraph2::UpdateItemIndicators(SERVO::CEquipment* pEquipment)
+{
+ for (int i = 0; i < SLOT_MAX; i++) {
+ auto pSlot = pEquipment->getSlot(i);
+
+ int state = 0;
+ if (pSlot->isEnable()) {
+ state = pSlot->getContext() != nullptr ? 1 : 2;
+ }
+ m_pEqsGraphWnd->ShowItemIndicator((DWORD_PTR)pEquipment, state, i);
+ }
+}
+
+void CPageGraph2::ApplyManualRoutes()
+{
+ if (m_pEqsGraphWnd == nullptr) {
+ return;
+ }
+
+ auto pMeasurement = (SERVO::CEquipment*)theApp.m_model.m_master.getEquipment(EQ_ID_MEASUREMENT);
+ auto pLoadPort1 = (SERVO::CEquipment*)theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT1);
+ auto pLoadPort3 = (SERVO::CEquipment*)theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT3);
+ auto pLoadPort4 = (SERVO::CEquipment*)theApp.m_model.m_master.getEquipment(EQ_ID_LOADPORT4);
+ if (pMeasurement == nullptr || pLoadPort1 == nullptr || pLoadPort3 == nullptr) {
+ return;
+ }
+
+ SERVO::CPin* pOut1 = pMeasurement->getPin("Out1");
+ SERVO::CPin* pOut2 = pMeasurement->getPin("Out2");
+ SERVO::CPin* pIn1 = pLoadPort1->getPin("In");
+ SERVO::CPin* pIn3 = pLoadPort3->getPin("In");
+ if (pOut1 == nullptr || pOut2 == nullptr || pIn1 == nullptr || pIn3 == nullptr) {
+ return;
+ }
+
+ if (pOut1->getConnectedPin() == pIn1) {
+ PIN* pGraphOut1 = m_pEqsGraphWnd->GetPin((DWORD_PTR)pMeasurement, (DWORD_PTR)pOut1);
+ PIN* pGraphIn1 = m_pEqsGraphWnd->GetPin((DWORD_PTR)pLoadPort1, (DWORD_PTR)pIn1);
+ if (pGraphOut1 != nullptr && pGraphIn1 != nullptr) {
+ m_pEqsGraphWnd->SetManualRoute(pGraphOut1, pGraphIn1, TRUE);
+ }
+ }
+
+ if (pOut2->getConnectedPin() == pIn3) {
+ PIN* pGraphOut2 = m_pEqsGraphWnd->GetPin((DWORD_PTR)pMeasurement, (DWORD_PTR)pOut2);
+ PIN* pGraphIn3 = m_pEqsGraphWnd->GetPin((DWORD_PTR)pLoadPort3, (DWORD_PTR)pIn3);
+ if (pGraphOut2 != nullptr && pGraphIn3 != nullptr) {
+ m_pEqsGraphWnd->SetManualRoute(pGraphOut2, pGraphIn3, FALSE);
+ if (pLoadPort4 != nullptr && pGraphOut2->nLinePtCount >= 6) {
+ EQITEM* pGraphPort4 = m_pEqsGraphWnd->GetItem((DWORD_PTR)pLoadPort4);
+ if (pGraphPort4 != nullptr) {
+ int yTarget = pGraphPort4->rect.bottom + 20;
+ if (pGraphOut2->ptConnectedLine[2].y < yTarget) {
+ pGraphOut2->ptConnectedLine[2].y = yTarget;
+ pGraphOut2->ptConnectedLine[3].y = yTarget;
+ }
+ }
+ }
+ }
+ }
}
void CPageGraph2::OnTimer(UINT_PTR nIDEvent)
@@ -495,11 +469,23 @@
}
}
}
+
+ ApplyManualRoutes();
}
CDialogEx::OnTimer(nIDEvent);
}
+LRESULT CPageGraph2::OnManualRouteMsg(WPARAM wParam, LPARAM lParam)
+{
+ ApplyManualRoutes();
+ CWnd* pGraphWnd = GetDlgItem(IDC_EQSGRAPHWND1);
+ if (pGraphWnd != nullptr) {
+ pGraphWnd->Invalidate(FALSE);
+ }
+ return 0;
+}
+
void CPageGraph2::SaveEqsGraphData()
{
char szFilepath[MAX_PATH];
--
Gitblit v1.9.3