|
// ServoDlg.h : Í·Îļþ
|
//
|
|
#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
|
{
|
// ¹¹Ôì
|
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
|
enum { IDD = IDD_SERVO_DIALOG };
|
#endif
|
|
protected:
|
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();
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
afx_msg void OnPaint();
|
afx_msg HCURSOR OnQueryDragIcon();
|
DECLARE_MESSAGE_MAP()
|
public:
|
afx_msg void OnBnClickedOk();
|
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();
|
};
|