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.

165 lines
3.6 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: DevicePTZ.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of DevicePTZ.cpp
  13. //----------------------------------------------------------------------------
  14. // DevicePTZ.cpp: implementation of the CDevicePTZ class.
  15. //
  16. //////////////////////////////////////////////////////////////////////
  17. #include "stdafx.h"
  18. #include "DevicePTZ.h"
  19. #include "CameraPTZ.h"
  20. #include "..\..\LgLib\Version.h"
  21. #ifdef _DEBUG
  22. #undef THIS_FILE
  23. static char THIS_FILE[]=__FILE__;
  24. #define new DEBUG_NEW
  25. #endif
  26. //////////////////////////////////////////////////////////////////////
  27. // Construction/Destruction
  28. //////////////////////////////////////////////////////////////////////
  29. CDevicePTZ::CDevicePTZ()
  30. {
  31. m_pCamera = NULL;
  32. // m_pName = NULL;
  33. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDevicePTZ::CDevicePTZ") );
  34. }
  35. CDevicePTZ::~CDevicePTZ()
  36. {
  37. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDevicePTZ::~CDevicePTZ") );
  38. }
  39. void CDevicePTZ::PTZ_PostInit()
  40. {
  41. PTZEVENT event;
  42. event.id = PTZC_INIT;
  43. m_Queue.Push( event );
  44. }
  45. void CDevicePTZ::PTZ_PostReset()
  46. {
  47. PTZEVENT event;
  48. event.id = PTZC_RESET;
  49. m_Queue.Push( event );
  50. }
  51. void CDevicePTZ::PTZ_PostSetPTZ( double pan, double tilt, double zoom )
  52. {
  53. PTZEVENT event;
  54. event.id = PTZC_SET_PTZ;
  55. event.ptz.pan = pan;
  56. event.ptz.tilt = tilt;
  57. event.ptz.zoom = zoom;
  58. m_Queue.Push( event );
  59. }
  60. void CDevicePTZ::PTZ_PostGetPTZ()
  61. {
  62. PTZEVENT event;
  63. event.id = PTZC_GET_PTZ;
  64. m_Queue.Push( event );
  65. }
  66. void CDevicePTZ::PTZ_PostPan( double speed, int nDir )
  67. {
  68. PTZEVENT event;
  69. event.id = PTZC_PAN;
  70. event.move.nDir = nDir;
  71. event.move.speed = speed;
  72. m_Queue.Push( event );
  73. }
  74. void CDevicePTZ::PTZ_PostIris( double value )
  75. {
  76. PTZEVENT event;
  77. event.id = PTZC_IRIS;
  78. event.iris.value = value;
  79. m_Queue.Push( event );
  80. }
  81. void CDevicePTZ::PTZ_PostWiper( BOOL bOn )
  82. {
  83. PTZEVENT event;
  84. event.id = PTZC_WIPER;
  85. event.wiper.on = bOn;
  86. m_Queue.Push( event );
  87. }
  88. void CDevicePTZ::PTZ_PostTilt( double speed, int nDir )
  89. {
  90. PTZEVENT event;
  91. event.id = PTZC_TILT;
  92. event.move.nDir = nDir;
  93. event.move.speed = speed;
  94. m_Queue.Push( event );
  95. }
  96. void CDevicePTZ::PTZ_PostZoom( double speed, int nDir )
  97. {
  98. PTZEVENT event;
  99. event.id = PTZC_ZOOM;
  100. event.move.nDir = nDir;
  101. event.move.speed = speed;
  102. m_Queue.Push( event );
  103. }
  104. void CDevicePTZ::PTZ_PostGetDoplerMask()
  105. {
  106. PTZEVENT event;
  107. event.id = PTZC_GET_DOPLER_MASK;
  108. m_Queue.Push( event );
  109. }
  110. void CDevicePTZ::PTZ_PostSetDopler( BOOL bOn, double angle, DWORD dwTimeout )
  111. {
  112. PTZEVENT event;
  113. event.id = PTZC_SET_DOPLER;
  114. event.dopler.bOn = bOn;
  115. event.dopler.angle = angle;
  116. event.dopler.dwTimeout = dwTimeout;
  117. m_Queue.Push( event );
  118. }
  119. void CDevicePTZ::SetPTZ( double pan, double tilt, double zoom )
  120. {
  121. if( m_pCamera )
  122. m_pCamera->PostPTZReady( pan, tilt, zoom );
  123. }
  124. void CDevicePTZ::SetDoplerMask( CLgDeviceDopler::DOPLER_MASK_ARRAY* pMask )
  125. {
  126. if( m_pCamera )
  127. m_pCamera->PostDoplerMask( pMask );
  128. }
  129. void CDevicePTZ::SetDoplerAlarm( CLgDeviceDopler::DOPLER_ALARM* pAlarm )
  130. {
  131. if( m_pCamera )
  132. m_pCamera->PostDoplerAlarm( pAlarm );
  133. }
  134. void CDevicePTZ::SetDopler( CLgDeviceDopler::DOPLER* pDopler )
  135. {
  136. if( m_pCamera )
  137. m_pCamera->PostDopler( pDopler );
  138. }
  139. void CDevicePTZ::SetReady()
  140. {
  141. if( m_pCamera )
  142. m_pCamera->PostReady();
  143. }