From 9d48f280e9a512d894ecdd05d80d8ec3915a704c Mon Sep 17 00:00:00 2001
From: Darker <mr.darker@163.com>
Date: 星期三, 05 三月 2025 17:13:17 +0800
Subject: [PATCH] 1. 完善报警窗口显示 1.1 日志和报警窗口同一时间只能显示一个 1.2 报警窗口跟随主窗口移动 1.3 重写报警窗口的关闭方法

---
 SourceCode/Bond/Servo/ServoDlg.h |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoDlg.h b/SourceCode/Bond/Servo/ServoDlg.h
index 1353deb..dc5314e 100644
--- a/SourceCode/Bond/Servo/ServoDlg.h
+++ b/SourceCode/Bond/Servo/ServoDlg.h
@@ -4,7 +4,15 @@
 
 #pragma once
 #include "ServoGraph.h"
+#include "BlButton.h"
+#include "LogDlg.h"
+#include "AlarmDlg.h"
+#include "TerminalDisplayDlg.h"
 
+enum DeviceStatus {
+	ONLINE,       // 在线
+	OFFLINE,      // 离线
+};
 
 // CServoDlg 对话框
 class CServoDlg : public CDialogEx
@@ -12,6 +20,29 @@
 // 构造
 public:
 	CServoDlg(CWnd* pParent = NULL);	// 标准构造函数
+
+
+public:
+	void ShowTerminalText(const char* pszText, unsigned int duration = -1);
+
+private:
+	void InitRxWindows();
+	void Resize();
+	void UpdateLogBtn();
+	void UpdateAlarmBtn();
+	void UpdateRobotPosition(float percentage);
+	void RotateRobot(float angleInDegrees);
+	void UpdateDeviceStatus(int id, DeviceStatus status);
+
+
+private:
+	IObserver* m_pObserver;
+	BOOL m_bShowLogWnd;
+	BOOL m_bShowAlarmWnd;
+	CLogDlg* m_pLogDlg;
+	CAlarmDlg* m_pAlarmDlg;
+	CTerminalDisplayDlg* m_pTerminalDisplayDlg;
+
 
 // 对话框数据
 #ifdef AFX_DESIGN_TIME
@@ -22,12 +53,18 @@
 	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持
 
 
+private:
+	BOOL m_bIsRobotMoving;
+
 // 实现
 protected:
 	HICON m_hIcon;
 	CServoGraph* m_pGraph;
 	COLORREF m_crBkgnd;
 	HBRUSH m_hbrBkgnd;
+	CBlButton m_btnLog;
+	CBlButton m_btnAlarm;
+
 
 	// 生成的消息映射函数
 	virtual BOOL OnInitDialog();
@@ -40,4 +77,24 @@
 	afx_msg void OnBnClickedCancel();
 	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
 	afx_msg void OnDestroy();
+	afx_msg void OnBnClickedButtonLog();
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+	afx_msg void OnClose();
+	afx_msg LRESULT OnLogDlgHide(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnAlarmDlgHide(WPARAM wParam, LPARAM lParam);
+	afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
+	afx_msg void OnMove(int x, int y);
+	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
+	afx_msg void OnMenuFileSettings();
+	afx_msg void OnUpdateMenuFileSettings(CCmdUI* pCmdUI);
+	afx_msg void OnMenuFileSecsTest();
+	afx_msg void OnUpdateMenuFileSecsTest(CCmdUI* pCmdUI);
+	afx_msg void OnMenuWndLog();
+	afx_msg void OnUpdateMenuWndLog(CCmdUI* pCmdUI);
+	afx_msg void OnMenuFileExit();
+	afx_msg void OnUpdateMenuFileExit(CCmdUI* pCmdUI);
+	afx_msg void OnMenuHelpAbout();
+	afx_msg void OnTimer(UINT_PTR nIDEvent);
+	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+	afx_msg void OnBnClickedButtonAlarm();
 };

--
Gitblit v1.9.3