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.

131 lines
2.8 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: CalibratePTZDlg.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of CalibratePTZDlg.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __CALIBRATE__PTZ__DLG__H__INCLUDED__
  15. #define __CALIBRATE__PTZ__DLG__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "GenericWnd.h"
  20. class CApplication;
  21. class CCalibratePTZDlg : public CGenericWnd
  22. {
  23. public:
  24. CCalibratePTZDlg();
  25. virtual ~CCalibratePTZDlg();
  26. public:
  27. UINT DoModal( CApplication* pApplication, HWND hParent );
  28. private:
  29. virtual LRESULT OnDestroy( WPARAM, LPARAM );
  30. virtual LRESULT OnCommand( WPARAM, LPARAM );
  31. virtual LRESULT OnInitDialog( WPARAM, LPARAM );
  32. virtual LRESULT OnTimer( WPARAM, LPARAM );
  33. private:
  34. void OnButtonOk();
  35. void OnButtonCancel();
  36. void OnCheckSynchronize();
  37. void OnRadioRange();
  38. void OnPressButtonPTZ( INT nButton, BOOL bPressed );
  39. void OnButtonGetPTZF();
  40. void OnButtonUpdatePanShift();
  41. void OnCheckTablePanShift();
  42. private:
  43. void EnableControls( BOOL bEnable );
  44. void GetCameraPosition();
  45. void SetCameraPosition();
  46. public:
  47. void OnTarget( double dAngle, double dRange );
  48. private:
  49. CApplication* m_pApplication;
  50. private:
  51. enum
  52. {
  53. BUTTON_LEFT = 0,
  54. BUTTON_RIGHT = 1,
  55. BUTTON_UP = 2,
  56. BUTTON_DOWN = 3,
  57. BUTTON_TELE = 4,
  58. BUTTON_WIDE = 5,
  59. BUTTON_FAR = 6,
  60. BUTTON_NEAR = 7,
  61. BUTTON_COUNT = 8,
  62. };
  63. private:
  64. class CActiveButton : public CGenericWnd
  65. {
  66. public:
  67. BOOL AttachButton( HWND hWnd, UINT uIconID );
  68. protected:
  69. virtual LRESULT WindowProc( UINT, WPARAM, LPARAM );
  70. private:
  71. HICON m_hIcon;
  72. public:
  73. void SetStop( BOOL bStopped ) { m_bStopped = bStopped; }
  74. BOOL IsStopped() { return m_bStopped; }
  75. void SetPressState( BOOL bPressed ) { m_bPressed = bPressed; m_dSpeed = 1.0; }
  76. BOOL IsPressed() { return m_bPressed; }
  77. double GetPressSpeed() { return m_dSpeed; }
  78. BOOL UpdatePressSpeed()
  79. {
  80. if( m_dSpeed < 100.0 )
  81. {
  82. m_dSpeed += 5.0;
  83. if( m_dSpeed > 100.0 )
  84. m_dSpeed = 100.0;
  85. return TRUE;
  86. }
  87. return FALSE;
  88. }
  89. private:
  90. BOOL m_bStopped;
  91. BOOL m_bPressed;
  92. double m_dSpeed;
  93. };
  94. private:
  95. CActiveButton m_pButton[BUTTON_COUNT];
  96. private:
  97. BOOL m_bNeedSendGetPosition;
  98. BOOL m_bNeedCheckPosition;
  99. BOOL m_bUpdatePanShift;
  100. private:
  101. BOOL m_bNeedSetPosition;
  102. double m_dPositionPan;
  103. double m_dPositionTilt;
  104. double m_dPositionZoom;
  105. double m_dPositionFocus;
  106. private:
  107. double m_dPanShift;
  108. double m_dAngle;
  109. };
  110. #endif