From 8f84a1ffebfa0e44d1b6f3eac7257e5fd282b8af Mon Sep 17 00:00:00 2001
From: darker <mr.darker@163.com>
Date: 星期五, 21 二月 2025 11:58:03 +0800
Subject: [PATCH] 1. 添加报警的界面对应的类

---
 SourceCode/Bond/Servo/AlarmDlg.h            |   65 ++++++++++++++++++++++++++++++++
 SourceCode/Bond/Servo/Servo.vcxproj         |    2 +
 SourceCode/Bond/Servo/Servo.vcxproj.filters |    2 +
 SourceCode/Bond/Servo/AlarmDlg.cpp          |   50 +++++++++++++++++++++++++
 4 files changed, 119 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/AlarmDlg.cpp b/SourceCode/Bond/Servo/AlarmDlg.cpp
new file mode 100644
index 0000000..ac31cf9
--- /dev/null
+++ b/SourceCode/Bond/Servo/AlarmDlg.cpp
@@ -0,0 +1,50 @@
+锘�// AlarmDlg.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "Servo.h"
+#include "afxdialogex.h"
+#include "AlarmDlg.h"
+
+#define PAGE_SIZE						20
+#define PAGE_BACKGROUND_COLOR			RGB(252, 252, 255)
+
+// CAlarmDlg 瀵硅瘽妗�
+
+IMPLEMENT_DYNAMIC(CAlarmDlg, CDialogEx)
+
+CAlarmDlg::CAlarmDlg(CWnd* pParent /*=nullptr*/)
+	: CDialogEx(IDD_DIALOG_ALARM, pParent)
+{
+	m_crBkgnd = PAGE_BACKGROUND_COLOR;
+	m_hbrBkgnd = nullptr;
+	m_pObserver = nullptr;
+
+	m_strKeyword = "";
+	m_nCurPage = 0;
+	m_nTotalPages = 0;
+	m_nDateTimeFlag = 0;
+
+	memset(m_szTimeStart, 0, sizeof(m_szTimeStart));
+	memset(m_szTimeEnd, 0, sizeof(m_szTimeEnd));
+	m_szTimeStart[0] = '\0';
+	m_szTimeEnd[0] = '\0';
+}
+
+CAlarmDlg::~CAlarmDlg()
+{
+}
+
+void CAlarmDlg::DoDataExchange(CDataExchange* pDX)
+{
+	DDX_Control(pDX, IDC_DATETIMEPICKER_START, m_dateTimeStart);
+	DDX_Control(pDX, IDC_DATETIMEPICKER_END, m_dateTimeEnd);
+	CDialogEx::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CAlarmDlg, CDialogEx)
+END_MESSAGE_MAP()
+
+
+// CAlarmDlg 娑堟伅澶勭悊绋嬪簭
diff --git a/SourceCode/Bond/Servo/AlarmDlg.h b/SourceCode/Bond/Servo/AlarmDlg.h
new file mode 100644
index 0000000..44c82af
--- /dev/null
+++ b/SourceCode/Bond/Servo/AlarmDlg.h
@@ -0,0 +1,65 @@
+锘�#pragma once
+#include "afxdialogex.h"
+#include <vector>
+#include <string>
+
+// CAlarmDlg 瀵硅瘽妗�
+
+class CAlarmDlg : public CDialogEx
+{
+	DECLARE_DYNAMIC(CAlarmDlg)
+
+public:
+	CAlarmDlg(CWnd* pParent = nullptr);   // 鏍囧噯鏋勯�犲嚱鏁�
+	virtual ~CAlarmDlg();
+
+private:
+	//void InitRxWindow();
+	//void Resize();
+	//void LoadAlarms();
+	//void AddAlarm(CAlarmMonitor* pMonitor, CAlarm* pAlarm);
+	//void UpdateAlarm(CAlarmMonitor* pMonitor, CAlarm* pAlarm);
+	//void UpdatePageData();
+	//void UpdatePageControls();
+	//void FillDataToListCtrl(CListCtrl* pListCtrl, const std::vector<std::vector<std::string>>& vecData);
+
+private:
+	COLORREF m_crBkgnd;
+	HBRUSH m_hbrBkgnd;
+	IObserver* m_pObserver;
+
+	// 鍏抽敭瀛�
+	std::string m_strKeyword;
+
+	// 椤电爜
+	int m_nCurPage;
+	int m_nTotalPages;
+
+	// 鏃ユ湡
+	int m_nDateTimeFlag;
+	char m_szTimeStart[64];
+	char m_szTimeEnd[64];
+
+	// 鎺т欢
+	CDateTimeCtrl m_dateTimeStart;
+	CDateTimeCtrl m_dateTimeEnd;
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+	enum { IDD = IDD_DIALOG_ALARM };
+#endif
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 鏀寔
+	//virtual BOOL OnInitDialog();
+	//virtual BOOL DestroyWindow();
+	//afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
+	//afx_msg void OnDestroy();
+	//afx_msg void OnSize(UINT nType, int cx, int cy);
+	//afx_msg void OnCbnSelchangeComboDatetime();
+	//afx_msg void OnBnClickedButtonSearch();
+	//afx_msg void OnBnClickedButtonExport();
+	//afx_msg void OnBnClickedButtonPrevPage();
+	//afx_msg void OnBnClickedButtonNextPage();
+	DECLARE_MESSAGE_MAP()
+};
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj b/SourceCode/Bond/Servo/Servo.vcxproj
index 1668acb..2784b6e 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj
+++ b/SourceCode/Bond/Servo/Servo.vcxproj
@@ -195,6 +195,7 @@
     <Text Include="ReadMe.txt" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="AlarmDlg.h" />
     <ClInclude Include="AlarmManager.h" />
     <ClInclude Include="BlButton.h" />
     <ClInclude Include="CBonder.h" />
@@ -226,6 +227,7 @@
     <ClInclude Include="ToolUnits.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="AlarmDlg.cpp" />
     <ClCompile Include="AlarmManager.cpp" />
     <ClCompile Include="BlButton.cpp" />
     <ClCompile Include="CBonder.cpp" />
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj.filters b/SourceCode/Bond/Servo/Servo.vcxproj.filters
index b6912df..272d23b 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj.filters
+++ b/SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -37,6 +37,7 @@
     <ClCompile Include="ToolUnits.cpp" />
     <ClCompile Include="DevicePropertyDlg.cpp" />
     <ClCompile Include="CStep.cpp" />
+    <ClCompile Include="AlarmDlg.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="AlarmManager.h" />
@@ -72,6 +73,7 @@
     <ClInclude Include="ToolUnits.h" />
     <ClInclude Include="DevicePropertyDlg.h" />
     <ClInclude Include="CStep.h" />
+    <ClInclude Include="AlarmDlg.h" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Servo.rc" />

--
Gitblit v1.9.3