LAPTOP-SNT8I5JK\Boounion
2025-03-10 19261d011387ec57d646decc945aadaf8913eeab
SourceCode/Bond/Servo/ServoDlg.h
@@ -5,7 +5,18 @@
#pragma once
#include "ServoGraph.h"
#include "BlButton.h"
#include "LogDlg.h"
#include "AlarmDlg.h"
#include "TerminalDisplayDlg.h"
#include "CPanelMaster.h"
#include "CPanelEquipment.h"
#include "CPanelAttributes.h"
enum DeviceStatus {
   ONLINE,       // 在线
   OFFLINE,      // 离线
};
// CServoDlg 对话框
class CServoDlg : public CDialogEx
@@ -13,6 +24,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
@@ -24,7 +58,7 @@
private:
   BOOL m_bShowLogWnd;
   BOOL m_bIsRobotMoving;
// 实现
protected:
@@ -33,7 +67,10 @@
   COLORREF m_crBkgnd;
   HBRUSH m_hbrBkgnd;
   CBlButton m_btnLog;
   CBlButton m_btnAlarm;
   CPanelMaster* m_pPanelMaster;
   CPanelEquipment* m_pPanelEquipment;
   CPanelAttributes* m_pPanelAttributes;
   // 生成的消息映射函数
   virtual BOOL OnInitDialog();
@@ -47,4 +84,25 @@
   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();
   afx_msg void OnGraphItemClicked(NMHDR* pNMHDR, LRESULT* pResult);
   afx_msg LRESULT OnPanelResize(WPARAM wParam, LPARAM lParam);
};