Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.7 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LocatorWnd.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of LocatorWnd.h
  13. //----------------------------------------------------------------------------
  14. #if !defined(AFX_LOCATORWND_H__C29D4A3C_CCC5_4A48_81C5_025C1FAECD39__INCLUDED_)
  15. #define AFX_LOCATORWND_H__C29D4A3C_CCC5_4A48_81C5_025C1FAECD39__INCLUDED_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19. #include "..\LgLib\MFC\MemoryDC.h"
  20. #include "..\LgLib\LgImageDIB.h"
  21. #include "CameraPositionWnd.h"
  22. #define LG_CAMERA_POSITION_CHANGED (WM_USER+101)
  23. class CLocatorWnd : public CWnd
  24. {
  25. public:
  26. CLocatorWnd();
  27. public:
  28. //{{AFX_VIRTUAL(CLocatorWnd)
  29. public:
  30. virtual BOOL DestroyWindow();
  31. //}}AFX_VIRTUAL
  32. public:
  33. BOOL Create( CWnd* pParentWnd, INT x, INT y, INT cx, INT cy );
  34. BOOL Create( CWnd* pParentWnd, CRect &rect );
  35. virtual ~CLocatorWnd();
  36. public:
  37. BOOL AddTarget( double dAngle, double dRange, COLORREF color );
  38. BOOL Clear();
  39. BOOL SetBackgroundDIB( CLgImageDIB *pDIB );
  40. public:
  41. typedef struct PTZ
  42. {
  43. double dPan;
  44. double dTilt;
  45. double dZoom;
  46. }PTZ, *PPTZ;
  47. const PTZ& GetPTZ() { return m_PTZ; }
  48. void SetPTZ( double dPan , double dTilt, double dZoom ) { m_PTZ.dPan = dPan; m_PTZ.dTilt = dTilt; m_PTZ.dZoom = dZoom; RedrawCamera(); }
  49. void ValidatePTZ( double dPan , double dTilt, double dZoom );
  50. enum{ PAN_LEFT = 0x03, PAN_RIGTH = 0x02, PAN_STOP = 0x01, PAN_MASK = 0x03,
  51. TILT_UP = 0x0C, TILT_DOWN = 0x08, TILT_STOP = 0x04, TILT_MASK = 0x0C,
  52. ZOOM_TELE = 0x30, ZOOM_WIDE = 0x20, ZOOM_STOP = 0x10, ZOOM_MASK = 0x30 };
  53. void MovePTZ( DWORD dwDir );
  54. protected:
  55. //{{AFX_MSG(CLocatorWnd)
  56. afx_msg void OnPaint();
  57. afx_msg void OnSize(UINT nType, int cx, int cy);
  58. afx_msg void OnTimer(UINT nIDEvent);
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. private:
  62. UINT m_nTimer;
  63. DWORD m_dwDirection;
  64. BOOL m_bSynchronizedPan;
  65. BOOL m_bSynchronizedTilt;
  66. private:
  67. void Draw( CDC *pDC );
  68. void DrawCamera(CDC *pDC);
  69. private:
  70. CLgMemoryDC m_FieldDC;
  71. CLgMemoryDC m_BackgroundDC;
  72. CLgMemoryDC m_CameraDC;
  73. CLgMemoryDC m_MemoryDC;
  74. private:
  75. void RedrawCamera();
  76. PTZ m_PTZ;
  77. PTZ m_dPTZ;
  78. private:
  79. INT m_bChange;
  80. INT m_nChangeTime;
  81. BOOL m_bBackground;
  82. public:
  83. void SetCameraPositionWnd( CCameraPositionWnd *pCameraPositionWnd ) { m_pCameraPositionWnd = pCameraPositionWnd; }
  84. private:
  85. CCameraPositionWnd *m_pCameraPositionWnd;
  86. };
  87. //{{AFX_INSERT_LOCATION}}
  88. #endif