From 072a953dd0bbec385cdf809f4403c1e975f13c37 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期三, 11 二月 2026 21:31:01 +0800
Subject: [PATCH] 1.客户说我们Status变量和Data变量搞反了。就是那个SxFx需要换过来,先标记下来,如确实需要修改再处理。

---
 SourceCode/Bond/Servo/CProcessDataListDlg.cpp |  173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 165 insertions(+), 8 deletions(-)

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;
+}

--
Gitblit v1.9.3