From 415ad67bb66ca2d99fb21a8eeb32f942ad2cd7b0 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期一, 09 二月 2026 13:32:42 +0800
Subject: [PATCH] 1.修改为tab页的展示形式

---
 SourceCode/Bond/Servo/CPageGlassList.h        |    1 
 SourceCode/Bond/Servo/CProcessDataListDlg.cpp |  173 ++++++++++++++++++
 SourceCode/Bond/Servo/CEquipment.cpp          |   21 ++
 SourceCode/Bond/Servo/CProcessDataListDlg.h   |   33 +++
 SourceCode/Bond/Servo/CPageGlassList.cpp      |  271 +++++++++++++++++++++++++++++
 5 files changed, 484 insertions(+), 15 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 88f93ac..c0d4998 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -927,6 +927,27 @@
 		for (int i = 0; i < SLOT_MAX; i++) {
 			CGlass* pGlass = (CGlass*)m_slot[i].getContext();
 			if (pGlass != nullptr && compareJobData(pJobDataB, pGlass->getJobDataS())) {
+				// 鍙栫墖鎴愬姛鍚庯紝鍥炲~褰撳墠璺緞鑺傜偣鐨勭寮�鏃堕棿锛堜紭鍏堝尮閰嶅皻鏈寮�鐨勮妭鐐癸級銆�
+				CPath* pPath = pGlass->getPath();
+				if (pPath != nullptr) {
+					CPath* pScan = pPath->getHeadPath();
+					CPath* pOpenNode = nullptr;
+					const unsigned int slotNo = (unsigned int)m_slot[i].getNo();
+					const unsigned int unitNo = getSlotUnit((int)slotNo);
+					while (pScan != nullptr) {
+						if (pScan->getEqID() == m_nID
+							&& pScan->getUnit() == unitNo
+							&& pScan->getSlot() == slotNo
+							&& pScan->getOutTime() == 0) {
+							pOpenNode = pScan;
+						}
+						pScan = pScan->getNext();
+					}
+					if (pOpenNode != nullptr) {
+						pOpenNode->setOutTime(CToolUnits::getTimestamp());
+					}
+				}
+
 				pContext = pGlass;
 				if (pGlass != nullptr) pGlass->addRef();
 				m_slot[i].setContext(nullptr);
diff --git a/SourceCode/Bond/Servo/CPageGlassList.cpp b/SourceCode/Bond/Servo/CPageGlassList.cpp
index 29b3b23..3fbf607 100644
--- a/SourceCode/Bond/Servo/CPageGlassList.cpp
+++ b/SourceCode/Bond/Servo/CPageGlassList.cpp
@@ -24,6 +24,86 @@
 static const COLORREF kWipParentBk = RGB(201, 228, 180); // 鍩虹缁�
 static const COLORREF kWipChildBk = RGB(221, 241, 208); // 鏇存祬涓�鐐�
 
+namespace {
+	CString FormatPathTime(ULONGLONG ts)
+	{
+		if (ts == 0) return _T("");
+		return CString(CToolUnits::timeToString2(ts).c_str());
+	}
+
+	void BuildPathRowsFromGlass(SERVO::CGlass& glass, std::vector<CProcessDataListDlg::PathRow>& rows)
+	{
+		rows.clear();
+		SERVO::CPath* pHead = glass.getPath();
+		if (pHead == nullptr) return;
+
+		SERVO::CPath* p = pHead->getHeadPath();
+		int step = 1;
+		while (p != nullptr) {
+			CProcessDataListDlg::PathRow r;
+			r.step.Format(_T("%d"), step++);
+			std::string eqName = SERVO::CServoUtilsTool::getEqUnitName(
+				(int)p->getEqID(), (int)p->getUnit(), (int)p->getSlot());
+			if (eqName.empty()) {
+				CString tmp;
+				tmp.Format(_T("Eq:%u Unit:%u Slot:%u"), p->getEqID(), p->getUnit(), p->getSlot());
+				r.chamber = tmp;
+			}
+			else {
+				r.chamber = eqName.c_str();
+			}
+			r.enterTime = FormatPathTime(p->getInTime());
+			r.leaveTime = FormatPathTime(p->getOutTime());
+			r.isArmStep = (p->getEqID() == EQ_ID_ARM
+				|| p->getEqID() == EQ_ID_ARM_TRAY1
+				|| p->getEqID() == EQ_ID_ARM_TRAY2);
+			rows.push_back(r);
+			p = p->getNext();
+		}
+	}
+
+	void ParseNameValuePairs(const CString& text, std::vector<std::pair<CString, CString>>& outRows)
+	{
+		outRows.clear();
+		int idx = 0;
+		CString token;
+		while (AfxExtractSubString(token, text, idx, ',')) {
+			++idx;
+			const int pos = token.Find(_T(':'));
+			if (pos < 0) continue;
+			CString name = token.Left(pos);
+			CString value = token.Mid(pos + 1);
+			name.Trim();
+			value.Trim();
+			if (!name.IsEmpty()) {
+				outRows.emplace_back(name, value);
+			}
+		}
+	}
+
+	void BuildBasicRowsFromList(CListCtrl& list, int row, std::vector<std::pair<CString, CString>>& rows)
+	{
+		rows.clear();
+		CHeaderCtrl* pHdr = list.GetHeaderCtrl();
+		const int colCount = pHdr ? pHdr->GetItemCount() : 0;
+		for (int col = 1; col < colCount; ++col) {
+			if (col == 11 || col == 12) continue; // 杩欎袱鍒楀崟鐙綔涓哄叾浠栭〉
+			TCHAR buf[256] = { 0 };
+			LVCOLUMN lvc = {};
+			lvc.mask = LVCF_TEXT;
+			lvc.pszText = buf;
+			lvc.cchTextMax = _countof(buf);
+			CString header;
+			if (list.GetColumn(col, &lvc)) header = lvc.pszText;
+			header.Trim();
+			if (header.IsEmpty()) continue;
+
+			CString val = list.GetItemText(row, col);
+			rows.emplace_back(header, val);
+		}
+	}
+}
+
 // ===== 鏀惧湪 CPageGlassList.cpp 椤堕儴鐨勫尶鍚嶅伐鍏凤紙鏂囦欢鍐呴潤鎬侊級 =====
 // 鎶婂綋鍓嶁�滃凡灞曞紑鈥濈殑鐖惰锛岀敤瀹冧滑鐨� classId锛堢4鍒楁枃鏈級鍋� key 璁板綍涓嬫潵
 static std::unordered_set<std::string> SnapshotExpandedKeys(CExpandableListCtrl& lv) {
@@ -479,6 +559,7 @@
     ON_BN_CLICKED(IDC_BUTTON_PREV_PAGE, &CPageGlassList::OnBnClickedButtonPrevPage)
     ON_BN_CLICKED(IDC_BUTTON_NEXT_PAGE, &CPageGlassList::OnBnClickedButtonNextPage)
     ON_NOTIFY(ELCN_SHOWFULLTEXT, IDC_LIST_ALARM, &CPageGlassList::OnShowFullText)
+    ON_NOTIFY(NM_DBLCLK, IDC_LIST_ALARM, &CPageGlassList::OnNMDblclkListAlarm)
     ON_BN_CLICKED(IDC_BUTTON_EXPORT_ROW, &CPageGlassList::OnBnClickedButtonExportRow)
 END_MESSAGE_MAP()
 
@@ -1578,16 +1659,192 @@
 {
     auto* p = reinterpret_cast<NMC_ELC_SHOWFULLTEXT*>(pNMHDR);
 
-    // 瀵硅瘽妗嗘樉绀哄伐鑹哄弬鏁�
-    if (p->iSubItem == 12) {
-        CProcessDataListDlg dlg;
-        dlg.setRawText(p->text);
-        dlg.DoModal();
-    }
-    else {
+	if (p->iSubItem != 11 && p->iSubItem != 12) {
         AfxMessageBox(p->text);
+        *pResult = 0;
+        return;
     }
 
+    const int row = p->iItem;
+    std::vector<std::pair<CString, CString>> basicRows;
+    std::vector<std::pair<CString, CString>> processRows;
+    std::vector<CProcessDataListDlg::PathRow> pathRows;
+    bool pathOk = false;
+
+    BuildBasicRowsFromList(m_listCtrl, row, basicRows);
+
+    CString paramsText = m_listCtrl.GetItemText(row, 12);
+    ParseNameValuePairs(paramsText, processRows);
+
+    CString strId = m_listCtrl.GetItemText(row, 1); // DB id锛學IP涓虹┖
+    if (!strId.IsEmpty()) {
+        try {
+            auto rec = GlassLogDb::Instance().queryById(_ttoi64(strId));
+            if (rec.has_value() && !rec->pretty.empty()) {
+                SERVO::CGlass tempGlass;
+                if (GlassJson::FromString(rec->pretty, tempGlass)) {
+                    BuildPathRowsFromGlass(tempGlass, pathRows);
+                    pathOk = !pathRows.empty();
+                }
+            }
+        }
+        catch (...) {
+            pathOk = false;
+        }
+    }
+
+    if (!pathOk) {
+        CString cls = m_listCtrl.GetItemText(row, 4); // Class ID
+#ifdef _UNICODE
+        std::string classId = CT2A(cls);
+#else
+        std::string classId = cls.GetString();
+#endif
+        if (!classId.empty()) {
+            std::vector<SERVO::CGlass*> wipGlasses;
+            theApp.m_model.m_master.getWipGlasses(wipGlasses);
+            std::vector<SERVO::CGlass*> tempRetain = wipGlasses;
+            SERVO::CGlass* found = nullptr;
+            for (auto* g : wipGlasses) {
+                if (g == nullptr) continue;
+                if (g->getID() == classId) { found = g; break; }
+                SERVO::CGlass* b = g->getBuddy();
+                if (b != nullptr && b->getID() == classId) { found = b; break; }
+            }
+            if (found != nullptr) {
+                BuildPathRowsFromGlass(*found, pathRows);
+                pathOk = !pathRows.empty();
+            }
+            for (auto* item : tempRetain) {
+                if (item != nullptr) item->release();
+            }
+        }
+    }
+
+    if (!pathOk) {
+        CString pathText = m_listCtrl.GetItemText(row, 11);
+        if (!pathText.IsEmpty()) {
+            int cur = 0;
+            CString token = pathText.Tokenize(_T("->"), cur);
+            int step = 1;
+            while (!token.IsEmpty()) {
+                token.Trim();
+                if (!token.IsEmpty()) {
+                    CProcessDataListDlg::PathRow r;
+                    r.step.Format(_T("%d"), step++);
+                    r.chamber = token;
+                    r.enterTime = _T("");
+                    r.leaveTime = _T("");
+                    CString upper = token;
+                    upper.MakeUpper();
+                    r.isArmStep = (upper.Find(_T("ARM")) >= 0 || upper.Find(_T("TRAY")) >= 0);
+                    pathRows.push_back(r);
+                }
+                token = pathText.Tokenize(_T("->"), cur);
+            }
+        }
+    }
+
+    CProcessDataListDlg dlg;
+    dlg.setUnifiedData(basicRows, pathRows, processRows);
+    dlg.setInitialTab((p->iSubItem == 11) ? 1 : 2);
+    dlg.DoModal();
+
+    *pResult = 0;
+}
+
+void CPageGlassList::OnNMDblclkListAlarm(NMHDR* pNMHDR, LRESULT* pResult)
+{
+    LPNMITEMACTIVATE pItem = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
+    if (pItem == nullptr || pItem->iItem < 0) {
+        *pResult = 0;
+        return;
+    }
+
+    const int row = pItem->iItem;
+    std::vector<std::pair<CString, CString>> basicRows;
+    std::vector<std::pair<CString, CString>> processRows;
+    std::vector<CProcessDataListDlg::PathRow> pathRows;
+    bool pathOk = false;
+
+    BuildBasicRowsFromList(m_listCtrl, row, basicRows);
+
+    CString paramsText = m_listCtrl.GetItemText(row, 12);
+    ParseNameValuePairs(paramsText, processRows);
+
+    CString strId = m_listCtrl.GetItemText(row, 1); // DB id锛學IP涓虹┖
+    if (!strId.IsEmpty()) {
+        try {
+            auto rec = GlassLogDb::Instance().queryById(_ttoi64(strId));
+            if (rec.has_value() && !rec->pretty.empty()) {
+                SERVO::CGlass tempGlass;
+                if (GlassJson::FromString(rec->pretty, tempGlass)) {
+                    BuildPathRowsFromGlass(tempGlass, pathRows);
+                    pathOk = !pathRows.empty();
+                }
+            }
+        }
+        catch (...) {
+            pathOk = false;
+        }
+    }
+
+    if (!pathOk) {
+        CString cls = m_listCtrl.GetItemText(row, 4); // Class ID
+#ifdef _UNICODE
+        std::string classId = CT2A(cls);
+#else
+        std::string classId = cls.GetString();
+#endif
+        if (!classId.empty()) {
+            std::vector<SERVO::CGlass*> wipGlasses;
+            theApp.m_model.m_master.getWipGlasses(wipGlasses);
+            std::vector<SERVO::CGlass*> tempRetain = wipGlasses;
+            SERVO::CGlass* found = nullptr;
+            for (auto* g : wipGlasses) {
+                if (g == nullptr) continue;
+                if (g->getID() == classId) { found = g; break; }
+                SERVO::CGlass* b = g->getBuddy();
+                if (b != nullptr && b->getID() == classId) { found = b; break; }
+            }
+            if (found != nullptr) {
+                BuildPathRowsFromGlass(*found, pathRows);
+                pathOk = !pathRows.empty();
+            }
+            for (auto* item : tempRetain) {
+                if (item != nullptr) item->release();
+            }
+        }
+    }
+
+    if (!pathOk) {
+        CString pathText = m_listCtrl.GetItemText(row, 11);
+        if (!pathText.IsEmpty()) {
+            int cur = 0;
+            CString token = pathText.Tokenize(_T("->"), cur);
+            int step = 1;
+            while (!token.IsEmpty()) {
+                token.Trim();
+                if (!token.IsEmpty()) {
+                    CProcessDataListDlg::PathRow r;
+                    r.step.Format(_T("%d"), step++);
+                    r.chamber = token;
+                    r.enterTime = _T("");
+                    r.leaveTime = _T("");
+                    CString upper = token;
+                    upper.MakeUpper();
+                    r.isArmStep = (upper.Find(_T("ARM")) >= 0 || upper.Find(_T("TRAY")) >= 0);
+                    pathRows.push_back(r);
+                }
+                token = pathText.Tokenize(_T("->"), cur);
+            }
+        }
+    }
+
+    CProcessDataListDlg dlg;
+    dlg.setUnifiedData(basicRows, pathRows, processRows);
+    dlg.DoModal();
+
     *pResult = 0;
 }
 
diff --git a/SourceCode/Bond/Servo/CPageGlassList.h b/SourceCode/Bond/Servo/CPageGlassList.h
index 38a35c7..3a28774 100644
--- a/SourceCode/Bond/Servo/CPageGlassList.h
+++ b/SourceCode/Bond/Servo/CPageGlassList.h
@@ -91,6 +91,7 @@
 	afx_msg void OnBnClickedButtonPrevPage();
 	afx_msg void OnBnClickedButtonNextPage();
 	afx_msg void OnShowFullText(NMHDR* pNMHDR, LRESULT* pResult);
+	afx_msg void OnNMDblclkListAlarm(NMHDR* pNMHDR, LRESULT* pResult);
 	virtual BOOL PreTranslateMessage(MSG* pMsg);
 	DECLARE_MESSAGE_MAP()
 public:
diff --git a/SourceCode/Bond/Servo/CProcessDataListDlg.cpp b/SourceCode/Bond/Servo/CProcessDataListDlg.cpp
index 65e58dd..fa2a799 100644
--- a/SourceCode/Bond/Servo/CProcessDataListDlg.cpp
+++ b/SourceCode/Bond/Servo/CProcessDataListDlg.cpp
@@ -6,6 +6,10 @@
 #include "CProcessDataListDlg.h"
 #include "afxdialogex.h"
 
+namespace {
+	static const UINT IDC_CHECK_SHOW_ARM_STEPS = 0x5001;
+	static const UINT IDC_TAB_UNIFIED = 0x5002;
+}
 
 // CProcessDataListDlg 瀵硅瘽妗�
 
@@ -30,6 +34,8 @@
 
 BEGIN_MESSAGE_MAP(CProcessDataListDlg, CDialogEx)
     ON_BN_CLICKED(IDC_BUTTON1, &CProcessDataListDlg::OnBnClickedButton1)
+    ON_BN_CLICKED(IDC_CHECK_SHOW_ARM_STEPS, &CProcessDataListDlg::OnBnClickedCheckShowArm)
+    ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_UNIFIED, &CProcessDataListDlg::OnTcnSelchangeTabUnified)
 END_MESSAGE_MAP()
 
 
@@ -40,7 +46,18 @@
 {
 	CDialogEx::OnInitDialog();
 
+    SetupListCtrlStyle();
+    SetWindowText(_T("Glass鏁版嵁璇︽儏"));
+    LoadArmStepOption();
+    InitUnifiedLayout();
+    RenderUnifiedTab();
 
+	return TRUE;  // return TRUE unless you set the focus to a control
+				  // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+void CProcessDataListDlg::SetupListCtrlStyle()
+{
     DWORD dwStyle = m_listCtrl.GetExtendedStyle();
     dwStyle |= LVS_EX_FULLROWSELECT;
     dwStyle |= LVS_EX_GRIDLINES;
@@ -49,19 +66,146 @@
 
     HIMAGELIST imageList = ImageList_Create(24, 24, ILC_COLOR24, 1, 1);
     ListView_SetImageList(m_listCtrl.GetSafeHwnd(), imageList, LVSIL_SMALL);
-    m_listCtrl.InsertColumn(0, _T("鍚嶇О"), LVCFMT_RIGHT, 188);
-    m_listCtrl.InsertColumn(1, _T("鍊�"), LVCFMT_LEFT, 128);
-
-
-    InsertParamsToListCtrl(m_listCtrl, m_strRawText);
-
-	return TRUE;  // return TRUE unless you set the focus to a control
-				  // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
 }
 
 void CProcessDataListDlg::setRawText(CString& strRawText)
 {
 	m_strRawText = strRawText;
+    m_initialTab = 2;
+}
+
+void CProcessDataListDlg::setPathRows(const std::vector<PathRow>& rows)
+{
+	m_pathRows = rows;
+    m_initialTab = 1;
+}
+
+void CProcessDataListDlg::setUnifiedData(const std::vector<std::pair<CString, CString>>& basicRows,
+    const std::vector<PathRow>& pathRows,
+    const std::vector<std::pair<CString, CString>>& processRows)
+{
+    m_basicRows = basicRows;
+    m_pathRows = pathRows;
+    m_processRows = processRows;
+}
+
+void CProcessDataListDlg::setInitialTab(int tabIndex)
+{
+    if (tabIndex < 0) tabIndex = 0;
+    if (tabIndex > 2) tabIndex = 2;
+    m_initialTab = tabIndex;
+}
+
+void CProcessDataListDlg::LoadArmStepOption()
+{
+	CString iniPath;
+	iniPath.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+	m_showArmSteps = (GetPrivateProfileInt(_T("GlassPathDlg"), _T("ShowArmSteps"), 0, iniPath) != 0);
+}
+
+void CProcessDataListDlg::SaveArmStepOption() const
+{
+	CString iniPath, val;
+	iniPath.Format(_T("%s\\configuration.ini"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
+	val.Format(_T("%d"), m_showArmSteps ? 1 : 0);
+	WritePrivateProfileString(_T("GlassPathDlg"), _T("ShowArmSteps"), val, iniPath);
+}
+
+void CProcessDataListDlg::BuildPathList()
+{
+	m_listCtrl.DeleteAllItems();
+	int stepNo = 1;
+	for (const auto& r : m_pathRows)
+	{
+		if (!m_showArmSteps && r.isArmStep) continue;
+
+		CString step;
+		step.Format(_T("%d"), stepNo++);
+		int nItem = m_listCtrl.InsertItem(m_listCtrl.GetItemCount(), step);
+		m_listCtrl.SetItemText(nItem, 1, r.chamber);
+		m_listCtrl.SetItemText(nItem, 2, r.enterTime);
+		m_listCtrl.SetItemText(nItem, 3, r.leaveTime);
+	}
+}
+
+void CProcessDataListDlg::BuildNameValueList(const std::vector<std::pair<CString, CString>>& rows)
+{
+    m_listCtrl.DeleteAllItems();
+    for (int i = 0; i < (int)rows.size(); ++i) {
+        int nItem = m_listCtrl.InsertItem(i, rows[i].first);
+        m_listCtrl.SetItemText(nItem, 1, rows[i].second);
+    }
+}
+
+void CProcessDataListDlg::InitUnifiedLayout()
+{
+    CRect rcList;
+    m_listCtrl.GetWindowRect(&rcList);
+    ScreenToClient(&rcList);
+
+    CRect rcTab(rcList.left, rcList.top, rcList.right, rcList.top + 24);
+    m_tabCtrl.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP, rcTab, this, IDC_TAB_UNIFIED);
+    m_tabCtrl.SetFont(GetFont());
+    m_tabCtrl.InsertItem(0, _T("鍩虹淇℃伅"));
+    m_tabCtrl.InsertItem(1, _T("宸ヨ壓Step"));
+    m_tabCtrl.InsertItem(2, _T("ProcessData"));
+    m_tabCtrl.SetCurSel(m_initialTab);
+
+    CRect rcNewList(rcList.left, rcTab.bottom + 2, rcList.right, rcList.bottom);
+    m_listCtrl.MoveWindow(&rcNewList);
+
+    CRect rcChk(rcNewList.left, rcNewList.bottom + 6, rcNewList.left + 200, rcNewList.bottom + 24);
+    m_chkShowArm.Create(_T("鏄剧ず鏈烘鎵嬬浉鍏砈tep"),
+        WS_CHILD | BS_AUTOCHECKBOX,
+        rcChk, this, IDC_CHECK_SHOW_ARM_STEPS);
+    m_chkShowArm.SetFont(GetFont());
+    m_chkShowArm.SetCheck(m_showArmSteps ? BST_CHECKED : BST_UNCHECKED);
+}
+
+void CProcessDataListDlg::RenderUnifiedTab()
+{
+    const int tab = m_tabCtrl.GetCurSel();
+    while (m_listCtrl.GetHeaderCtrl() && m_listCtrl.GetHeaderCtrl()->GetItemCount() > 0) {
+        m_listCtrl.DeleteColumn(0);
+    }
+
+    if (tab == 0) {
+        m_chkShowArm.ShowWindow(SW_HIDE);
+        m_listCtrl.InsertColumn(0, _T("鍚嶇О"), LVCFMT_RIGHT, 200);
+        m_listCtrl.InsertColumn(1, _T("鍊�"), LVCFMT_LEFT, 320);
+        BuildNameValueList(m_basicRows);
+    }
+    else if (tab == 1) {
+        m_chkShowArm.ShowWindow(SW_SHOW);
+        m_listCtrl.InsertColumn(0, _T("Step"), LVCFMT_RIGHT, 56);
+        m_listCtrl.InsertColumn(1, _T("鑵斾綋鍚嶇О"), LVCFMT_LEFT, 180);
+        m_listCtrl.InsertColumn(2, _T("杩涘叆鏃堕棿"), LVCFMT_LEFT, 156);
+        m_listCtrl.InsertColumn(3, _T("绂诲紑鏃堕棿"), LVCFMT_LEFT, 156);
+
+        m_listCtrl.DeleteAllItems();
+        int stepNo = 1;
+        for (const auto& r : m_pathRows)
+        {
+            if (!m_showArmSteps && r.isArmStep) continue;
+            CString step;
+            step.Format(_T("%d"), stepNo++);
+            int nItem = m_listCtrl.InsertItem(m_listCtrl.GetItemCount(), step);
+            m_listCtrl.SetItemText(nItem, 1, r.chamber);
+            m_listCtrl.SetItemText(nItem, 2, r.enterTime);
+            m_listCtrl.SetItemText(nItem, 3, r.leaveTime);
+        }
+    }
+    else {
+        m_chkShowArm.ShowWindow(SW_HIDE);
+        m_listCtrl.InsertColumn(0, _T("鍚嶇О"), LVCFMT_RIGHT, 200);
+        m_listCtrl.InsertColumn(1, _T("鍊�"), LVCFMT_LEFT, 320);
+        if (!m_processRows.empty()) {
+            BuildNameValueList(m_processRows);
+        }
+        else {
+            InsertParamsToListCtrl(m_listCtrl, m_strRawText);
+        }
+    }
 }
 
 void CProcessDataListDlg::InsertParamsToListCtrl(CListCtrl& listCtrl, const CString& data)
@@ -199,3 +343,16 @@
         AfxMessageBox(_T("澶嶅埗澶辫触锛�"));
     }
 }
+
+void CProcessDataListDlg::OnBnClickedCheckShowArm()
+{
+	m_showArmSteps = (m_chkShowArm.GetCheck() == BST_CHECKED);
+	SaveArmStepOption();
+	RenderUnifiedTab();
+}
+
+void CProcessDataListDlg::OnTcnSelchangeTabUnified(NMHDR* pNMHDR, LRESULT* pResult)
+{
+	RenderUnifiedTab();
+	*pResult = 0;
+}
diff --git a/SourceCode/Bond/Servo/CProcessDataListDlg.h b/SourceCode/Bond/Servo/CProcessDataListDlg.h
index a825179..dccf562 100644
--- a/SourceCode/Bond/Servo/CProcessDataListDlg.h
+++ b/SourceCode/Bond/Servo/CProcessDataListDlg.h
@@ -1,5 +1,7 @@
 锘�#pragma once
 #include "ListCtrlEx.h"
+#include <vector>
+#include <utility>
 
 
 // CProcessDataListDlg 瀵硅瘽妗�
@@ -13,13 +15,42 @@
 	virtual ~CProcessDataListDlg();
 
 public:
+	struct PathRow {
+		CString step;
+		CString chamber;
+		CString enterTime;
+		CString leaveTime;
+		bool isArmStep = false;
+	};
+
 	void setRawText(CString& strRawText);
+	void setPathRows(const std::vector<PathRow>& rows);
+	void setUnifiedData(const std::vector<std::pair<CString, CString>>& basicRows,
+		const std::vector<PathRow>& pathRows,
+		const std::vector<std::pair<CString, CString>>& processRows);
+	void setInitialTab(int tabIndex);
 	void InsertParamsToListCtrl(CListCtrl& listCtrl, const CString& data);
 	bool CopyListCtrlToClipboard(CListCtrl& listCtrl, bool includeHeader = false);
 
 private:
 	CString m_strRawText;
 	CListCtrlEx m_listCtrl;
+	CTabCtrl m_tabCtrl;
+	std::vector<PathRow> m_pathRows;
+	std::vector<std::pair<CString, CString>> m_basicRows;
+	std::vector<std::pair<CString, CString>> m_processRows;
+	CButton m_chkShowArm;
+	bool m_showArmSteps = false;
+	int m_initialTab = 0;
+
+private:
+	void LoadArmStepOption();
+	void SaveArmStepOption() const;
+	void SetupListCtrlStyle();
+	void BuildNameValueList(const std::vector<std::pair<CString, CString>>& rows);
+	void BuildPathList();
+	void InitUnifiedLayout();
+	void RenderUnifiedTab();
 
 
 // 瀵硅瘽妗嗘暟鎹�
@@ -34,4 +65,6 @@
 public:
 	virtual BOOL OnInitDialog();
 	afx_msg void OnBnClickedButton1();
+	afx_msg void OnBnClickedCheckShowArm();
+	afx_msg void OnTcnSelchangeTabUnified(NMHDR* pNMHDR, LRESULT* pResult);
 };

--
Gitblit v1.9.3