From c36e0403012fda6101c176be7a875846fe383a53 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 16 九月 2025 18:03:05 +0800
Subject: [PATCH] 1.CJ管理功能持续实现中...
---
SourceCode/Bond/Servo/Servo.vcxproj | 6
SourceCode/Bond/Servo/CCjPage1.cpp | 63 ---
SourceCode/Bond/Servo/CCjPageBase.cpp | 137 ++++++++
SourceCode/Bond/Servo/ProcessJob.h | 1
SourceCode/Bond/Servo/ProcessJob.cpp | 6
SourceCode/Bond/Servo/resource.h | 0
SourceCode/Bond/Servo/CCjPageBase.h | 56 +++
SourceCode/Bond/Servo/CControlJob.cpp | 22 +
SourceCode/Bond/Servo/CControlJob.h | 2
SourceCode/Bond/Servo/CCjPage2.h | 38 ++
SourceCode/Bond/Servo/CCjPage3.h | 31 +
SourceCode/Bond/Servo/CControlJobManagerDlg.h | 23 +
SourceCode/Bond/Servo/CCjPage1.h | 13
SourceCode/Bond/Servo/CControlJobManagerDlg.cpp | 267 +++++++++++++++
SourceCode/Bond/Servo/CMaster.h | 4
SourceCode/Bond/Servo/CCjPage3.cpp | 73 ++++
SourceCode/Bond/Servo/CCjPage2.cpp | 122 +++++++
SourceCode/Bond/Servo/Servo.vcxproj.filters | 6
SourceCode/Bond/Servo/ToolUnits.cpp | 20 +
SourceCode/Bond/Servo/Servo.rc | 0
SourceCode/Bond/Servo/CMaster.cpp | 17 +
Document/EO2860AVA-101工艺参数(4).xlsx | 0
SourceCode/Bond/Servo/ToolUnits.h | 1
23 files changed, 830 insertions(+), 78 deletions(-)
diff --git "a/Document/EO2860AVA-101\345\267\245\350\211\272\345\217\202\346\225\260\0504\051.xlsx" "b/Document/EO2860AVA-101\345\267\245\350\211\272\345\217\202\346\225\260\0504\051.xlsx"
new file mode 100644
index 0000000..4500fd0
--- /dev/null
+++ "b/Document/EO2860AVA-101\345\267\245\350\211\272\345\217\202\346\225\260\0504\051.xlsx"
Binary files differ
diff --git a/SourceCode/Bond/Servo/CCjPage1.cpp b/SourceCode/Bond/Servo/CCjPage1.cpp
index f81f8dd..cb35ba1 100644
--- a/SourceCode/Bond/Servo/CCjPage1.cpp
+++ b/SourceCode/Bond/Servo/CCjPage1.cpp
@@ -9,13 +9,11 @@
// CPjPage1 瀵硅瘽妗�
-IMPLEMENT_DYNAMIC(CCjPage1, CDialogEx)
+IMPLEMENT_DYNAMIC(CCjPage1, CCjPageBase)
CCjPage1::CCjPage1(CWnd* pParent /*=nullptr*/)
- : CDialogEx(IDD_CJ_PAGE1, pParent)
+ : CCjPageBase(IDD_CJ_PAGE1, pParent)
{
- m_crBkgnd = RGB(255, 255, 255);
- m_crBkgndCached = CLR_INVALID;
}
CCjPage1::~CCjPage1()
@@ -24,14 +22,12 @@
void CCjPage1::DoDataExchange(CDataExchange* pDX)
{
- CDialogEx::DoDataExchange(pDX);
+ CCjPageBase::DoDataExchange(pDX);
}
-BEGIN_MESSAGE_MAP(CCjPage1, CDialogEx)
- ON_WM_CTLCOLOR()
+BEGIN_MESSAGE_MAP(CCjPage1, CCjPageBase)
ON_WM_DESTROY()
- ON_WM_SIZE()
END_MESSAGE_MAP()
@@ -40,65 +36,23 @@
BOOL CCjPage1::OnInitDialog()
{
- CDialogEx::OnInitDialog();
- Resize();
+ CCjPageBase::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
}
-
-HBRUSH CCjPage1::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
-{
- HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
-
- // 鎯崇粰鍝簺鎺т欢鏀瑰簳鑹插氨鎶婂畠浠殑绫诲瀷鍐欒繘鏉ワ細
- const bool needCustomBg =
- (nCtlColor == CTLCOLOR_STATIC) ||
- (nCtlColor == CTLCOLOR_DLG) || // 瀵硅瘽妗嗗簳鑹�
- (nCtlColor == CTLCOLOR_BTN); // 鎸夐挳锛堝彲閫夛級
-
- if (needCustomBg)
- {
- // 鑻ョ涓�娆″垱寤猴紝鎴栭鑹叉敼鍙樺垯閲嶅缓
- if (m_brBkgnd.GetSafeHandle() == nullptr || m_crBkgndCached != m_crBkgnd)
- {
- if (m_brBkgnd.GetSafeHandle())
- m_brBkgnd.DeleteObject();
-
- m_brBkgnd.CreateSolidBrush(m_crBkgnd);
- m_crBkgndCached = m_crBkgnd;
- }
-
- // 鏂囨湰鍓嶆櫙/鑳屾櫙璁剧疆锛堜粎褰卞搷鏂囨湰缁樺埗锛�
- pDC->SetBkColor(m_crBkgnd);
- pDC->SetTextColor(RGB(0, 0, 0));
- // 濡傞渶璁╅潤鎬佹枃鏈�忔槑鍙犲湪搴曡壊涓婏紝鍙敤锛�
- // pDC->SetBkMode(TRANSPARENT);
-
- return (HBRUSH)m_brBkgnd; // 瀹夊叏鐨勯殣寮忚浆鎹�
- }
-
- // 鍏朵粬鎺т欢绫诲瀷娌跨敤鍩虹被榛樿鐨勫埛瀛�
- return hbr;
-}
-
void CCjPage1::OnDestroy()
{
- CDialogEx::OnDestroy();
+ CCjPageBase::OnDestroy();
// TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
}
-void CCjPage1::OnSize(UINT nType, int cx, int cy)
-{
- CDialogEx::OnSize(nType, cx, cy);
- if (GetDlgItem(IDC_LABEL_NO_SEL) == nullptr) return;
- Resize();
-}
-
void CCjPage1::Resize()
{
+ CCjPageBase::Resize();
+ /*
CWnd* pItem;
CRect rcClient, rcItem;
GetClientRect(&rcClient);
@@ -107,4 +61,5 @@
pItem->MoveWindow((rcClient.Width() - rcItem.Width()) / 2,
(rcClient.Height() - rcItem.Height()) / 2,
rcItem.Width(), rcItem.Height());
+ */
}
diff --git a/SourceCode/Bond/Servo/CCjPage1.h b/SourceCode/Bond/Servo/CCjPage1.h
index 168fe9c..3ee0c38 100644
--- a/SourceCode/Bond/Servo/CCjPage1.h
+++ b/SourceCode/Bond/Servo/CCjPage1.h
@@ -1,9 +1,10 @@
锘�#pragma once
+#include "CCjPageBase.h"
// CPjPage1 瀵硅瘽妗�
-class CCjPage1 : public CDialogEx
+class CCjPage1 : public CCjPageBase
{
DECLARE_DYNAMIC(CCjPage1)
@@ -11,13 +12,9 @@
CCjPage1(CWnd* pParent = nullptr); // 鏍囧噯鏋勯�犲嚱鏁�
virtual ~CCjPage1();
-private:
- void Resize();
+protected:
+ virtual void Resize();
-private:
- COLORREF m_crBkgnd;
- COLORREF m_crBkgndCached;
- CBrush m_brBkgnd;
// 瀵硅瘽妗嗘暟鎹�
#ifdef AFX_DESIGN_TIME
@@ -30,7 +27,5 @@
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
- afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnDestroy();
- afx_msg void OnSize(UINT nType, int cx, int cy);
};
diff --git a/SourceCode/Bond/Servo/CCjPage2.cpp b/SourceCode/Bond/Servo/CCjPage2.cpp
new file mode 100644
index 0000000..0f4aac9
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCjPage2.cpp
@@ -0,0 +1,122 @@
+锘�// CPjPage1.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "Servo.h"
+#include "CCjPage2.h"
+#include "afxdialogex.h"
+#include "RecipeManager.h"
+
+
+// CPjPage1 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CCjPage2, CCjPageBase)
+
+CCjPage2::CCjPage2(CWnd* pParent /*=nullptr*/)
+ : CCjPageBase(IDD_CJ_PAGE2, pParent)
+{
+
+}
+
+CCjPage2::~CCjPage2()
+{
+}
+
+void CCjPage2::DoDataExchange(CDataExchange* pDX)
+{
+ CCjPageBase::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CCjPage2, CCjPageBase)
+ ON_WM_DESTROY()
+ ON_EN_CHANGE(IDC_EDIT_PJ_ID, &CCjPage2::OnEnChangeEditPjId)
+ ON_CBN_SELCHANGE(IDC_COMBO_RECIPE, &CCjPage2::OnCbnSelchangeComboRecipe)
+END_MESSAGE_MAP()
+
+
+// CPjPage1 娑堟伅澶勭悊绋嬪簭
+
+
+void CCjPage2::OnSetContext(void* pContext)
+{
+ UpdatePjData();
+}
+
+BOOL CCjPage2::OnInitDialog()
+{
+ CCjPageBase::OnInitDialog();
+
+
+ UpdatePjData();
+
+
+ ;
+ return TRUE; // return TRUE unless you set the focus to a control
+ // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+void CCjPage2::OnDestroy()
+{
+ CCjPageBase::OnDestroy();
+
+ // TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
+}
+
+void CCjPage2::Resize()
+{
+ CCjPageBase::Resize();
+ /*
+ CWnd* pItem;
+ CRect rcClient, rcItem;
+ GetClientRect(&rcClient);
+ pItem = GetDlgItem(IDC_LABEL_TITLE);
+ pItem->GetWindowRect(&rcItem);
+ pItem->MoveWindow(12, 8, rcClient.Width() - 24, rcItem.Height());
+ */
+}
+
+void CCjPage2::OnApply()
+{
+ //SERVO::CProcessJob*
+ if (m_pContext == nullptr) return;
+ SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)m_pContext;
+
+ // 鏇存柊鍚嶇О
+ char szBuffer[256];
+ GetDlgItemText(IDC_EDIT_PJ_ID, szBuffer, 256);
+ pProcessJob->setId(std::string(szBuffer));
+
+ ContentChanged(1);
+}
+
+void CCjPage2::UpdatePjData()
+{
+ m_bContentChangedLock = TRUE;
+
+ CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_RECIPE);
+ pComboBox->ResetContent();
+ std::vector<std::string> vecRecipe = RecipeManager::getInstance().getAllPPID();
+ for (const auto& recipe : vecRecipe) {
+ pComboBox->AddString(CString(recipe.c_str()));
+ }
+
+ if (m_pContext) {
+ SERVO::CProcessJob* pProcessJob = (SERVO::CProcessJob*)m_pContext;
+ SetDlgItemText(IDC_EDIT_PJ_ID, pProcessJob->id().c_str());
+ int idx = pComboBox->FindStringExact(-1, pProcessJob->recipeSpec().c_str());
+ if (idx != CB_ERR) pComboBox->SetCurSel(idx);
+ }
+
+ m_bContentChangedLock = FALSE;
+}
+
+void CCjPage2::OnEnChangeEditPjId()
+{
+ ContentChanged(0);
+}
+
+void CCjPage2::OnCbnSelchangeComboRecipe()
+{
+ ContentChanged(0);
+}
diff --git a/SourceCode/Bond/Servo/CCjPage2.h b/SourceCode/Bond/Servo/CCjPage2.h
new file mode 100644
index 0000000..e277ac4
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCjPage2.h
@@ -0,0 +1,38 @@
+锘�#pragma once
+#include "CCjPageBase.h"
+#include "ProcessJob.h"
+
+
+// CPjPage1 瀵硅瘽妗�
+
+class CCjPage2 : public CCjPageBase
+{
+ DECLARE_DYNAMIC(CCjPage2)
+
+public:
+ CCjPage2(CWnd* pParent = nullptr); // 鏍囧噯鏋勯�犲嚱鏁�
+ virtual ~CCjPage2();
+
+protected:
+ void Resize();
+ virtual void OnApply();
+ virtual void OnSetContext(void* pContext);
+
+private:
+ void UpdatePjData();
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+ enum { IDD = IDD_CJ_PAGE1 };
+#endif
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鏀寔
+
+ DECLARE_MESSAGE_MAP()
+public:
+ virtual BOOL OnInitDialog();
+ afx_msg void OnDestroy();
+ afx_msg void OnEnChangeEditPjId();
+ afx_msg void OnCbnSelchangeComboRecipe();
+};
diff --git a/SourceCode/Bond/Servo/CCjPage3.cpp b/SourceCode/Bond/Servo/CCjPage3.cpp
new file mode 100644
index 0000000..44428e9
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCjPage3.cpp
@@ -0,0 +1,73 @@
+锘�// CPjPage1.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "Servo.h"
+#include "CCjPage3.h"
+#include "afxdialogex.h"
+
+
+// CPjPage1 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CCjPage3, CCjPageBase)
+
+CCjPage3::CCjPage3(CWnd* pParent /*=nullptr*/)
+ : CCjPageBase(IDD_CJ_PAGE3, pParent)
+{
+
+}
+
+CCjPage3::~CCjPage3()
+{
+}
+
+void CCjPage3::DoDataExchange(CDataExchange* pDX)
+{
+ CCjPageBase::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CCjPage3, CCjPageBase)
+ ON_WM_DESTROY()
+END_MESSAGE_MAP()
+
+
+// CPjPage1 娑堟伅澶勭悊绋嬪簭
+
+
+BOOL CCjPage3::OnInitDialog()
+{
+ CCjPageBase::OnInitDialog();
+
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+void CCjPage3::OnDestroy()
+{
+ CCjPageBase::OnDestroy();
+
+ // TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
+}
+
+void CCjPage3::Resize()
+{
+ CCjPageBase::Resize();
+
+ /*
+ CWnd* pItem;
+ CRect rcClient, rcItem;
+ GetClientRect(&rcClient);
+ pItem = GetDlgItem(IDC_LABEL_NO_SEL);
+ pItem->GetWindowRect(&rcItem);
+ pItem->MoveWindow((rcClient.Width() - rcItem.Width()) / 2,
+ (rcClient.Height() - rcItem.Height()) / 2,
+ rcItem.Width(), rcItem.Height());
+ */
+}
+
+void CCjPage3::OnApply()
+{
+
+}
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/CCjPage3.h b/SourceCode/Bond/Servo/CCjPage3.h
new file mode 100644
index 0000000..1593973
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCjPage3.h
@@ -0,0 +1,31 @@
+锘�#pragma once
+#include "CCjPageBase.h"
+
+
+// CPjPage1 瀵硅瘽妗�
+
+class CCjPage3 : public CCjPageBase
+{
+ DECLARE_DYNAMIC(CCjPage3)
+
+public:
+ CCjPage3(CWnd* pParent = nullptr); // 鏍囧噯鏋勯�犲嚱鏁�
+ virtual ~CCjPage3();
+
+protected:
+ void Resize();
+ virtual void OnApply();
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+ enum { IDD = IDD_CJ_PAGE1 };
+#endif
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鏀寔
+
+ DECLARE_MESSAGE_MAP()
+public:
+ virtual BOOL OnInitDialog();
+ afx_msg void OnDestroy();
+};
diff --git a/SourceCode/Bond/Servo/CCjPageBase.cpp b/SourceCode/Bond/Servo/CCjPageBase.cpp
new file mode 100644
index 0000000..d7c0391
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCjPageBase.cpp
@@ -0,0 +1,137 @@
+锘�// CPjPage1.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "Servo.h"
+#include "CCjPageBase.h"
+#include "afxdialogex.h"
+
+
+// CPjPage1 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CCjPageBase, CDialogEx)
+
+CCjPageBase::CCjPageBase(UINT nID, CWnd* pPage) : CDialogEx(nID, pPage)
+{
+ m_crBkgnd = RGB(255, 255, 255);
+ m_crBkgndCached = CLR_INVALID;
+ m_onContentChanged = nullptr;
+ m_bContentChangedLock = FALSE;
+ m_pContext = nullptr;
+ m_nContextType = 0;
+}
+
+CCjPageBase::~CCjPageBase()
+{
+}
+
+void CCjPageBase::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CCjPageBase, CDialogEx)
+ ON_WM_CTLCOLOR()
+ ON_WM_SIZE()
+END_MESSAGE_MAP()
+
+
+// CPjPage1 娑堟伅澶勭悊绋嬪簭
+
+void CCjPageBase::SetTitle(CString strTitle)
+{
+ SetDlgItemText(IDC_LABEL_TITLE, strTitle);
+}
+
+void CCjPageBase::SetContext(void* pContext, int type)
+{
+ m_pContext = pContext;
+ m_nContextType = type;
+ OnSetContext(pContext);
+}
+
+void* CCjPageBase::GetContext()
+{
+ return m_pContext;
+}
+
+void CCjPageBase::SetOnContentChanged(ONCONTENTCHANGED onContentChanged)
+{
+ m_onContentChanged = onContentChanged;
+}
+
+BOOL CCjPageBase::OnInitDialog()
+{
+ CDialogEx::OnInitDialog();
+ Resize();
+
+
+ m_labelTitle.SubclassDlgItem(IDC_LABEL_TITLE, this);
+ m_labelTitle.Setpadding(PADDING_LEFT, 0);
+ m_labelTitle.Setpadding(PADDING_RIGHT, 0);
+
+ ;
+ return TRUE; // return TRUE unless you set the focus to a control
+ // 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+
+HBRUSH CCjPageBase::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
+{
+ HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
+
+ // 鎯崇粰鍝簺鎺т欢鏀瑰簳鑹插氨鎶婂畠浠殑绫诲瀷鍐欒繘鏉ワ細
+ const bool needCustomBg =
+ (nCtlColor == CTLCOLOR_STATIC) ||
+ (nCtlColor == CTLCOLOR_DLG) || // 瀵硅瘽妗嗗簳鑹�
+ (nCtlColor == CTLCOLOR_BTN); // 鎸夐挳锛堝彲閫夛級
+
+ if (needCustomBg)
+ {
+ // 鑻ョ涓�娆″垱寤猴紝鎴栭鑹叉敼鍙樺垯閲嶅缓
+ if (m_brBkgnd.GetSafeHandle() == nullptr || m_crBkgndCached != m_crBkgnd)
+ {
+ if (m_brBkgnd.GetSafeHandle())
+ m_brBkgnd.DeleteObject();
+
+ m_brBkgnd.CreateSolidBrush(m_crBkgnd);
+ m_crBkgndCached = m_crBkgnd;
+ }
+
+ // 鏂囨湰鍓嶆櫙/鑳屾櫙璁剧疆锛堜粎褰卞搷鏂囨湰缁樺埗锛�
+ pDC->SetBkColor(m_crBkgnd);
+ pDC->SetTextColor(RGB(0, 0, 0));
+ // 濡傞渶璁╅潤鎬佹枃鏈�忔槑鍙犲湪搴曡壊涓婏紝鍙敤锛�
+ // pDC->SetBkMode(TRANSPARENT);
+
+ return (HBRUSH)m_brBkgnd; // 瀹夊叏鐨勯殣寮忚浆鎹�
+ }
+
+ // 鍏朵粬鎺т欢绫诲瀷娌跨敤鍩虹被榛樿鐨勫埛瀛�
+ return hbr;
+}
+
+void CCjPageBase::OnSize(UINT nType, int cx, int cy)
+{
+ CDialogEx::OnSize(nType, cx, cy);
+ if (GetDlgItem(IDC_LABEL_TITLE) == nullptr) return;
+ Resize();
+}
+
+void CCjPageBase::Resize()
+{
+ CWnd* pItem;
+ CRect rcClient, rcItem;
+ GetClientRect(&rcClient);
+ pItem = GetDlgItem(IDC_LABEL_TITLE);
+ pItem->GetWindowRect(&rcItem);
+ pItem->MoveWindow(12, 8, rcClient.Width() - 24, rcItem.Height());
+}
+
+void CCjPageBase::ContentChanged(int code)
+{
+ if (!m_bContentChangedLock && m_onContentChanged != nullptr) {
+ m_onContentChanged(this, code, m_pContext, m_nContextType);
+ }
+}
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/CCjPageBase.h b/SourceCode/Bond/Servo/CCjPageBase.h
new file mode 100644
index 0000000..3b90763
--- /dev/null
+++ b/SourceCode/Bond/Servo/CCjPageBase.h
@@ -0,0 +1,56 @@
+锘�#pragma once
+#include "GroupLabel.h"
+#include <functional>
+
+
+typedef std::function<void(void* pFrom, int code, void* pContext, int contextType)> ONCONTENTCHANGED;
+
+
+// CPjPage1 瀵硅瘽妗�
+
+class CCjPageBase : public CDialogEx
+{
+ DECLARE_DYNAMIC(CCjPageBase)
+
+public:
+ CCjPageBase(UINT nID, CWnd* pPage); // 鏍囧噯鏋勯�犲嚱鏁�
+ virtual ~CCjPageBase();
+
+public:
+ void SetTitle(CString strTitle);
+ virtual void OnApply() {};
+ void SetOnContentChanged(ONCONTENTCHANGED onContentChanged);
+ void SetContext(void* pContext, int type);
+ void* GetContext();
+
+protected:
+ virtual void Resize();
+ virtual void ContentChanged(int code);
+ virtual void OnSetContext(void* pContext) { };
+
+private:
+ COLORREF m_crBkgndCached;
+ CBrush m_brBkgnd;
+ CGroupLabel m_labelTitle;
+ ONCONTENTCHANGED m_onContentChanged;
+
+protected:
+ COLORREF m_crBkgnd;
+ BOOL m_bContentChangedLock;
+ void* m_pContext;
+ int m_nContextType;
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+ enum { IDD = IDD_CJ_PAGE1 };
+#endif
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鏀寔
+
+ DECLARE_MESSAGE_MAP()
+public:
+ virtual BOOL OnInitDialog();
+ afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+};
diff --git a/SourceCode/Bond/Servo/CControlJob.cpp b/SourceCode/Bond/Servo/CControlJob.cpp
index be1b43a..02939b2 100644
--- a/SourceCode/Bond/Servo/CControlJob.cpp
+++ b/SourceCode/Bond/Servo/CControlJob.cpp
@@ -60,6 +60,28 @@
return true;
}
+ bool CControlJob::addPjPointer(CProcessJob* pj)
+ {
+ for (auto item : m_pjs) {
+ if (item->id().compare(pj->id()) == 0) return false;
+ }
+
+ m_pjs.push_back(pj);
+ return true;
+ }
+
+ bool CControlJob::removePjPointer(const std::string& id)
+ {
+ for(auto iter = m_pjs.begin(); iter != m_pjs.end(); ++iter) {
+ if ((*iter)->id().compare(id) == 0) {
+ m_pjs.erase(iter);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
bool CControlJob::removePJ(const std::string& pjId) {
auto it = std::find(m_pjIds.begin(), m_pjIds.end(), pjId);
if (it == m_pjIds.end()) return false;
diff --git a/SourceCode/Bond/Servo/CControlJob.h b/SourceCode/Bond/Servo/CControlJob.h
index 3053795..9c85607 100644
--- a/SourceCode/Bond/Servo/CControlJob.h
+++ b/SourceCode/Bond/Servo/CControlJob.h
@@ -54,6 +54,8 @@
bool containsPJ(const std::string& pjId) const;
const std::vector<std::string>& pjIds() const noexcept { return m_pjIds; }
bool setPJs(const std::vector<CProcessJob*>& pjs);
+ bool removePjPointer(const std::string& id);
+ bool addPjPointer(CProcessJob* pj);
void clearPJs() { m_pjIds.clear(); }
const std::vector<CProcessJob*>& getPjs() { return m_pjs; };
diff --git a/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp b/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp
index e801498..e125c68 100644
--- a/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp
+++ b/SourceCode/Bond/Servo/CControlJobManagerDlg.cpp
@@ -5,6 +5,7 @@
#include "Servo.h"
#include "CControlJobManagerDlg.h"
#include "afxdialogex.h"
+#include "ToolUnits.h"
// CControlJobManagerDlg 瀵硅瘽妗�
@@ -14,22 +15,40 @@
CControlJobManagerDlg::CControlJobManagerDlg(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DIALOG_CONTROL_JOB_MANAGER, pParent)
{
- m_pPage1 = nullptr;
+ m_pControlJob = nullptr;
}
CControlJobManagerDlg::~CControlJobManagerDlg()
{
+ for (auto pj : m_processJobs) {
+ delete pj;
+ }
+ m_processJobs.clear();
+
+ if (m_pControlJob != nullptr) {
+ delete m_pControlJob;
+ m_pControlJob = nullptr;
+ }
}
void CControlJobManagerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_LIST1, m_listBox);
+ DDX_Control(pDX, IDC_TREE1, m_tree);
}
BEGIN_MESSAGE_MAP(CControlJobManagerDlg, CDialogEx)
ON_WM_SIZE()
ON_WM_GETMINMAXINFO()
+ ON_BN_CLICKED(IDC_BUTTON_CREATE_CJ, &CControlJobManagerDlg::OnBnClickedCreateCJ)
+ ON_BN_CLICKED(IDC_BUTTON_CREATE_PJ, &CControlJobManagerDlg::OnBnClickedButtonCreatePj)
+ ON_CLBN_CHKCHANGE(IDC_LIST1, &CControlJobManagerDlg::OnListChkChange) // 澶嶉�夌姸鎬佸彉鏇撮�氱煡
+ ON_LBN_SELCHANGE(IDC_LIST1, &CControlJobManagerDlg::OnLbnSelchangeList1)
+ ON_NOTIFY(TVN_SELCHANGED, IDC_TREE1, &CControlJobManagerDlg::OnTvnSelchangedTree1)
+ ON_WM_DESTROY()
+ ON_BN_CLICKED(IDC_BUTTON_APPLY, &CControlJobManagerDlg::OnBnClickedButtonApply)
END_MESSAGE_MAP()
@@ -40,13 +59,47 @@
{
CDialogEx::OnInitDialog();
-
+ auto onContentChanged = [&](void* pFrom, int code, void* pContext, int contextType) -> void {
+ if (0 == code) {
+ GetDlgItem(IDC_BUTTON_APPLY)->EnableWindow(TRUE);
+ }
+ else if (1 == code) {
+ if (contextType == 1) {
+ UpProcessJobId((SERVO::CProcessJob*)pContext);
+ }
+ }
+ };
+
// page1
- m_pPage1 = new CCjPage1(this);
- m_pPage1->Create(IDD_CJ_PAGE1, this);
- m_pPage1->ShowWindow(SW_SHOW);
+ CCjPage1* pPage1 = new CCjPage1(this);
+ pPage1->Create(IDD_CJ_PAGE1, this);
+ pPage1->SetTitle(_T("鏈�夋嫨"));
+ pPage1->SetOnContentChanged(onContentChanged);
+ pPage1->ShowWindow(SW_SHOW);
+ m_pages.push_back(pPage1);
+
+ // page2
+ CCjPage2* pPage2 = new CCjPage2(this);
+ pPage2->Create(IDD_CJ_PAGE2, this);
+ pPage2->SetTitle(_T("ProcessJob"));
+ pPage2->SetOnContentChanged(onContentChanged);
+ m_pages.push_back(pPage2);
+
+ // page3
+ CCjPage3* pPage3 = new CCjPage3(this);
+ pPage3->Create(IDD_CJ_PAGE3, this);
+ pPage3->SetTitle(_T("ControlJob"));
+ pPage3->SetOnContentChanged(onContentChanged);
+ m_pages.push_back(pPage3);
+ // ListBox
+ m_listBox.ModifyStyle(0, LBS_OWNERDRAWFIXED | LBS_HASSTRINGS);
+ m_listBox.SetCheckStyle(BS_AUTOCHECKBOX);
+ m_listBox.SetItemHeight(0, max(22, ::GetSystemMetrics(SM_CYMENUCHECK) + 4));
+
+
+ UpdateCtrlState();
Resize();
@@ -72,19 +125,25 @@
ScreenToClient(&rcItem);
const int LEFTWIDTH = 218;
- int x = 12;
+ int x = 12, y = 12;
int x2 = rcClient.right - 12;
int y2 = rcClient.bottom - 12;
// 鍏堢Щ鍔ㄦ寜閽�
- pItem = GetDlgItem(IDC_BUTTON_BATH_COMPLETION);
+ pItem = GetDlgItem(IDC_BUTTON_CREATE_PJ);
pItem->GetWindowRect(&rcItem);
pItem->MoveWindow(x, y2 - rcItem.Height(), rcItem.Width(), rcItem.Height());
x += rcItem.Width();
x += 8;
- pItem = GetDlgItem(IDC_BUTTON_BATH_NEW);
+ pItem = GetDlgItem(IDC_BUTTON_CREATE_CJ);
+ pItem->GetWindowRect(&rcItem);
+ pItem->MoveWindow(x, y2 - rcItem.Height(), rcItem.Width(), rcItem.Height());
+ x += rcItem.Width();
+ x += 8;
+
+ pItem = GetDlgItem(IDC_BUTTON_BATH_COMPLETION);
pItem->GetWindowRect(&rcItem);
pItem->MoveWindow(x, y2 - rcItem.Height(), rcItem.Width(), rcItem.Height());
x += rcItem.Width();
@@ -96,25 +155,37 @@
x += rcItem.Width();
x += 8;
- pItem = GetDlgItem(IDCANCEL);
+ pItem = GetDlgItem(IDC_BUTTON_APPLY);
pItem->GetWindowRect(&rcItem);
pItem->MoveWindow(x2 - rcItem.Width(), y2 - rcItem.Height(), rcItem.Width(), rcItem.Height());
y2 -= rcItem.Height();
y2 -= 8;
+ // 鍒楄〃鎺т欢
+ x = 12;
+ y = 12;
+ pItem = GetDlgItem(IDC_LIST1);
+ pItem->MoveWindow(x, y, LEFTWIDTH, 180);
+ x += LEFTWIDTH;
+ x += 5;
+ y += 180;
+ y += 5;
+
+
// 鏍戞帶浠�
x = 12;
pItem = GetDlgItem(IDC_TREE1);
- pItem->MoveWindow(x, 12, LEFTWIDTH, y2 - 12);
+ pItem->MoveWindow(x, y, LEFTWIDTH, y2 - y);
x += LEFTWIDTH;
x += 5;
// 瀛愰〉闈�
- if (m_pPage1 != nullptr) {
- m_pPage1->MoveWindow(x, 12, x2 - x, y2 - 12);
+ for (auto page : m_pages) {
+ page->MoveWindow(x, 12, x2 - x, y2 - 12);
}
+
}
void CControlJobManagerDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
@@ -129,3 +200,175 @@
// lpMMI->ptMaxTrackSize.x = 800;
// lpMMI->ptMaxTrackSize.y = 600;
}
+
+void CControlJobManagerDlg::UpdateCtrlState()
+{
+ auto& master = theApp.m_model.getMaster();
+ auto cj = master.getControlJob();
+ GetDlgItem(IDC_BUTTON_CREATE_PJ)->EnableWindow(TRUE);
+ GetDlgItem(IDC_BUTTON_CREATE_CJ)->EnableWindow(
+ m_pControlJob == nullptr
+ );
+ GetDlgItem(IDC_BUTTON_BATH_COMPLETION)->EnableWindow(false);
+ GetDlgItem(IDC_BUTTON_BATH_DELETE)->EnableWindow(true);
+}
+
+
+void CControlJobManagerDlg::OnBnClickedButtonCreatePj()
+{
+ static int index = 0;
+ char szBuffer[256];
+ sprintf_s(szBuffer, 256, "PJ%03d", ++index);
+ SERVO::CProcessJob* pj = new SERVO::CProcessJob(std::string(szBuffer));
+ m_processJobs.push_back(pj);
+ UpdateProcessJobs();
+ UpdateCtrlState();
+}
+
+void CControlJobManagerDlg::OnBnClickedCreateCJ()
+{
+ if (m_pControlJob != nullptr) {
+ return;
+ }
+
+ m_pControlJob = new SERVO::CControlJob("CJ" + CToolUnits::NowStrSec());
+ UpdateControlJob();
+ UpdateCtrlState();
+}
+
+void CControlJobManagerDlg::UpdateProcessJobs()
+{
+ m_listBox.ResetContent();
+ for (auto item : m_processJobs) {
+ int index = m_listBox.InsertString(m_listBox.GetCount(), item->id().c_str());
+ m_listBox.SetItemDataPtr(index, item);
+ }
+}
+
+void CControlJobManagerDlg::UpdateControlJob()
+{
+ m_tree.DeleteAllItems();
+ if (m_pControlJob == nullptr) return;
+
+ HTREEITEM hRoot = m_tree.InsertItem(m_pControlJob->id().c_str(), 0, 0);
+ m_tree.SetItemData(hRoot, (DWORD_PTR)m_pControlJob);
+ auto& pjs = m_pControlJob->getPjs();
+ for (auto pj : pjs) {
+ HTREEITEM hItem = m_tree.InsertItem(pj->id().c_str(), 0, 0, hRoot);
+ m_tree.SetItemData(hItem, (DWORD_PTR)pj);
+ }
+ m_tree.Expand(hRoot, TVE_EXPAND);
+}
+
+void CControlJobManagerDlg::OnListChkChange()
+{
+ int idx = m_listBox.GetCurSel();
+ if (idx != LB_ERR) {
+ SERVO::CProcessJob* pj = (SERVO::CProcessJob*)m_listBox.GetItemDataPtr(idx);
+ BOOL checked = m_listBox.GetCheck(idx); // 鑻ヤ笁鎬�: 0/1/2
+ if (checked) {
+ if (AddPorcessJob(pj)) {
+ UpdateControlJob();
+ }
+ }
+ else {
+ if (RemovePorcessJob(pj)) {
+ UpdateControlJob();
+ }
+ }
+ }
+}
+
+bool CControlJobManagerDlg::AddPorcessJob(SERVO::CProcessJob* pj)
+{
+ if (m_pControlJob == nullptr) return false;
+ return m_pControlJob->addPjPointer(pj);
+}
+
+bool CControlJobManagerDlg::RemovePorcessJob(SERVO::CProcessJob* pj)
+{
+ if (m_pControlJob == nullptr) return false;
+ return m_pControlJob->removePjPointer(pj->id());
+}
+
+void CControlJobManagerDlg::OnLbnSelchangeList1()
+{
+ int idx = m_listBox.GetCurSel();
+ if (idx != LB_ERR) {
+ SERVO::CProcessJob* pj = (SERVO::CProcessJob*)m_listBox.GetItemDataPtr(idx);
+
+ ASSERT(m_pages.size() == 3);
+ m_pages[0]->ShowWindow(SW_HIDE);
+ m_pages[1]->ShowWindow(SW_SHOW);
+ m_pages[2]->ShowWindow(SW_HIDE);
+
+ m_pages[1]->SetContext(pj, 1);
+ }
+}
+
+void CControlJobManagerDlg::OnTvnSelchangedTree1(NMHDR* pNMHDR, LRESULT* pResult)
+{
+ LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
+
+ HTREEITEM hSel = pNMTreeView->itemNew.hItem;
+ if (hSel != nullptr) {
+ HTREEITEM hParent = m_tree.GetParentItem(hSel);
+ if (hParent == nullptr) {
+ SERVO::CControlJob* cj = (SERVO::CControlJob*)m_tree.GetItemData(hSel);
+ ASSERT(m_pages.size() == 3);
+ m_pages[0]->ShowWindow(SW_HIDE);
+ m_pages[1]->ShowWindow(SW_HIDE);
+ m_pages[2]->ShowWindow(SW_SHOW);
+ }
+ else if (m_tree.GetParentItem(hParent) == nullptr) {
+ SERVO::CProcessJob* pj = (SERVO::CProcessJob*)m_tree.GetItemData(hSel);
+ m_pages[0]->ShowWindow(SW_HIDE);
+ m_pages[1]->ShowWindow(SW_SHOW);
+ m_pages[2]->ShowWindow(SW_HIDE);
+
+ m_pages[1]->SetContext(pj, 1);
+ }
+ else {
+ // 鏈夌鍏� 鈫� 绗笁灞傚強浠ヤ笅 鈫� Glass
+ }
+ }
+
+ *pResult = 0;
+}
+
+void CControlJobManagerDlg::OnDestroy()
+{
+ CDialogEx::OnDestroy();
+
+ for (auto page : m_pages) {
+ page->DestroyWindow();
+ delete page;
+ }
+}
+
+
+void CControlJobManagerDlg::OnBnClickedButtonApply()
+{
+ for (auto item : m_pages) {
+ item->OnApply();
+ }
+ GetDlgItem(IDC_BUTTON_APPLY)->EnableWindow(FALSE);
+}
+
+void CControlJobManagerDlg::UpProcessJobId(SERVO::CProcessJob* pJob)
+{
+ int count = m_listBox.GetCount();
+ for (int idx = 0; idx < count; idx++) {
+ if ((m_listBox.GetItemDataPtr(idx) == (void*)pJob)) {
+ BOOL check = m_listBox.GetCheck(idx);
+ BOOL wasCurSel = (m_listBox.GetCurSel() == idx); // 鍗曢�夋ā寮�
+ m_listBox.DeleteString(idx);
+ int newIdx = m_listBox.InsertString(idx, pJob->id().c_str());
+ m_listBox.SetItemDataPtr(newIdx, pJob);
+ m_listBox.SetCheck(newIdx, check);
+ if (wasCurSel) {
+ m_listBox.SetCurSel(newIdx);
+ }
+ }
+ }
+}
diff --git a/SourceCode/Bond/Servo/CControlJobManagerDlg.h b/SourceCode/Bond/Servo/CControlJobManagerDlg.h
index ebc1f11..23d6523 100644
--- a/SourceCode/Bond/Servo/CControlJobManagerDlg.h
+++ b/SourceCode/Bond/Servo/CControlJobManagerDlg.h
@@ -1,5 +1,8 @@
锘�#pragma once
#include "CCjPage1.h"
+#include "CCjPage2.h"
+#include "CCjPage3.h"
+#include "ApredTreeCtrl2.h"
// CControlJobManagerDlg 瀵硅瘽妗�
@@ -14,9 +17,20 @@
private:
void Resize();
+ void UpdateCtrlState();
+ void UpdateProcessJobs();
+ void UpdateControlJob();
+ bool AddPorcessJob(SERVO::CProcessJob* pj);
+ bool RemovePorcessJob(SERVO::CProcessJob* pj);
+ void UpProcessJobId(SERVO::CProcessJob* pJob);
private:
- CCjPage1* m_pPage1;
+ std::vector<CCjPageBase*> m_pages;
+ SERVO::CControlJob* m_pControlJob;
+ std::vector<SERVO::CProcessJob*> m_processJobs;
+ CCheckListBox m_listBox;
+ CApredTreeCtrl2 m_tree;
+
// 瀵硅瘽妗嗘暟鎹�
#ifdef AFX_DESIGN_TIME
@@ -31,4 +45,11 @@
virtual BOOL OnInitDialog();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
+ afx_msg void OnBnClickedCreateCJ();
+ afx_msg void OnBnClickedButtonCreatePj();
+ afx_msg void OnListChkChange();
+ afx_msg void OnLbnSelchangeList1();
+ afx_msg void OnTvnSelchangedTree1(NMHDR* pNMHDR, LRESULT* pResult);
+ afx_msg void OnDestroy();
+ afx_msg void OnBnClickedButtonApply();
};
diff --git a/SourceCode/Bond/Servo/CMaster.cpp b/SourceCode/Bond/Servo/CMaster.cpp
index ab5214c..c39cc13 100644
--- a/SourceCode/Bond/Servo/CMaster.cpp
+++ b/SourceCode/Bond/Servo/CMaster.cpp
@@ -2758,6 +2758,23 @@
return nullptr;
}
+ bool CMaster::canCreateControlJob()
+ {
+ return m_pControlJob == nullptr;
+ }
+
+ bool CMaster::canCompleteControlJob()
+ {
+ return m_pControlJob != nullptr && m_state == SERVO::MASTERSTATE::READY;
+ }
+
+ bool CMaster::canDeleteControlJob()
+ {
+ return m_pControlJob != nullptr
+ && m_pControlJob->state() == CJState::NoState
+ && m_state == SERVO::MASTERSTATE::READY;
+ }
+
int CMaster::getWipGlasses(std::vector<CGlass*>& glasses)
{
for (auto eq : m_listEquipment) {
diff --git a/SourceCode/Bond/Servo/CMaster.h b/SourceCode/Bond/Servo/CMaster.h
index fa3f6b3..98a661f 100644
--- a/SourceCode/Bond/Servo/CMaster.h
+++ b/SourceCode/Bond/Servo/CMaster.h
@@ -190,7 +190,9 @@
bool checkAndUpdatePjComplete(CProcessJob* pJob);
bool checkAndUpdateCjComplete(CControlJob* pJob);
CProcessJob* getGlassProcessJob(CGlass* pGlass);
-
+ bool canCreateControlJob();
+ bool canCompleteControlJob();
+ bool canDeleteControlJob();
private:
CRITICAL_SECTION m_criticalSection;
diff --git a/SourceCode/Bond/Servo/ProcessJob.cpp b/SourceCode/Bond/Servo/ProcessJob.cpp
index 57c771c..1ae4b9e 100644
--- a/SourceCode/Bond/Servo/ProcessJob.cpp
+++ b/SourceCode/Bond/Servo/ProcessJob.cpp
@@ -27,6 +27,12 @@
clampString(m_pjId, MAX_ID_LEN);
}
+ void CProcessJob::setId(std::string& id)
+ {
+ m_pjId = trimCopy(id);
+ clampString(m_pjId, MAX_ID_LEN);
+ }
+
void CProcessJob::setParentCjId(std::string cjId) {
m_parentCjId = trimCopy(cjId);
clampString(m_parentCjId, MAX_ID_LEN);
diff --git a/SourceCode/Bond/Servo/ProcessJob.h b/SourceCode/Bond/Servo/ProcessJob.h
index 28b83e1..5324875 100644
--- a/SourceCode/Bond/Servo/ProcessJob.h
+++ b/SourceCode/Bond/Servo/ProcessJob.h
@@ -90,6 +90,7 @@
explicit CProcessJob(std::string pjId);
const std::string& id() const noexcept { return m_pjId; }
+ void setId(std::string& id);
const std::string& parentCjId() const noexcept { return m_parentCjId; }
PJState state() const noexcept { return m_state; }
StartPolicy startPolicy() const noexcept { return m_startPolicy; }
diff --git a/SourceCode/Bond/Servo/Servo.rc b/SourceCode/Bond/Servo/Servo.rc
index 8ee0574..fe77aef 100644
--- a/SourceCode/Bond/Servo/Servo.rc
+++ b/SourceCode/Bond/Servo/Servo.rc
Binary files differ
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj b/SourceCode/Bond/Servo/Servo.vcxproj
index 5b150fd..1b2bcc9 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj
+++ b/SourceCode/Bond/Servo/Servo.vcxproj
@@ -210,6 +210,9 @@
<ClInclude Include="..\jsoncpp\include\json\writer.h" />
<ClInclude Include="..\jsoncpp\lib_json\json_batchallocator.h" />
<ClInclude Include="CBaseDlg.h" />
+ <ClInclude Include="CCjPage2.h" />
+ <ClInclude Include="CCjPage3.h" />
+ <ClInclude Include="CCjPageBase.h" />
<ClInclude Include="CControlJob.h" />
<ClInclude Include="CControlJobDlg.h" />
<ClInclude Include="CControlJobManagerDlg.h" />
@@ -389,6 +392,9 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="CBaseDlg.cpp" />
+ <ClCompile Include="CCjPage2.cpp" />
+ <ClCompile Include="CCjPage3.cpp" />
+ <ClCompile Include="CCjPageBase.cpp" />
<ClCompile Include="CControlJob.cpp" />
<ClCompile Include="CControlJobDlg.cpp" />
<ClCompile Include="CControlJobManagerDlg.cpp" />
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj.filters b/SourceCode/Bond/Servo/Servo.vcxproj.filters
index d7b7472..9202388 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj.filters
+++ b/SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -201,6 +201,9 @@
<ClCompile Include="GroupLabel.cpp" />
<ClCompile Include="CControlJobManagerDlg.cpp" />
<ClCompile Include="CCjPage1.cpp" />
+ <ClCompile Include="CCjPage2.cpp" />
+ <ClCompile Include="CCjPage3.cpp" />
+ <ClCompile Include="CCjPageBase.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AlarmManager.h" />
@@ -427,6 +430,9 @@
<ClInclude Include="GroupLabel.h" />
<ClInclude Include="CControlJobManagerDlg.h" />
<ClInclude Include="CCjPage1.h" />
+ <ClInclude Include="CCjPage2.h" />
+ <ClInclude Include="CCjPage3.h" />
+ <ClInclude Include="CCjPageBase.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Servo.rc" />
diff --git a/SourceCode/Bond/Servo/ToolUnits.cpp b/SourceCode/Bond/Servo/ToolUnits.cpp
index cc9a1bf..6d5df0d 100644
--- a/SourceCode/Bond/Servo/ToolUnits.cpp
+++ b/SourceCode/Bond/Servo/ToolUnits.cpp
@@ -4,7 +4,9 @@
#include <memory>
#include <sstream>
#include <algorithm>
-
+#include <ctime>
+#include <iomanip>
+#include <sstream>
CToolUnits::CToolUnits()
{
@@ -557,3 +559,19 @@
std::snprintf(out, sizeof(out), "%s.%03d", date, ms);
return out;
}
+
+std::string CToolUnits::NowStrSec()
+{
+ using namespace std::chrono;
+ auto now = system_clock::now();
+ std::time_t t = system_clock::to_time_t(now);
+ std::tm tm{};
+#ifdef _WIN32
+ localtime_s(&tm, &t); // 本地时间(Windows 线程安全)
+#else
+ localtime_r(&t, &tm); // 本地时间(POSIX 线程安全)
+#endif
+ std::ostringstream oss;
+ oss << std::put_time(&tm, "%Y%m%d%H%M%S"); // 例:2025-09-15 08:23:07
+ return oss.str();
+}
\ No newline at end of file
diff --git a/SourceCode/Bond/Servo/ToolUnits.h b/SourceCode/Bond/Servo/ToolUnits.h
index b5f8430..f88788d 100644
--- a/SourceCode/Bond/Servo/ToolUnits.h
+++ b/SourceCode/Bond/Servo/ToolUnits.h
@@ -59,5 +59,6 @@
static std::string TimePointToUtcString(const std::optional<TP>& tp,
const char* fmt = "%Y-%m-%d %H:%M:%S");
static std::string TimePointToLocalStringMs(const std::optional<TP>& tp);
+ static std::string NowStrSec();
};
diff --git a/SourceCode/Bond/Servo/resource.h b/SourceCode/Bond/Servo/resource.h
index 7e8dbb3..0da8d69 100644
--- a/SourceCode/Bond/Servo/resource.h
+++ b/SourceCode/Bond/Servo/resource.h
Binary files differ
--
Gitblit v1.9.3