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.

105 lines
2.1 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: cpg3ad.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of cpg3ad.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "cpg3ad.h"
  16. #ifdef EMBEDDED_CAMERA_PHILIPS
  17. #include "..\lglib\comm\ptzpg3ad.cpp"
  18. #include "..\lglib\device\dpg3ad.cpp"
  19. CCameraPhilipsG3ADPTZ::CCameraPhilipsG3ADPTZ()
  20. {
  21. m_pComm = NULL;
  22. m_pCamera = NULL;
  23. }
  24. CCameraPhilipsG3ADPTZ::~CCameraPhilipsG3ADPTZ()
  25. {
  26. Destroy();
  27. }
  28. BOOL CCameraPhilipsG3ADPTZ::Create( CCamera *pCamera, CComm485* pComm, CComm485::PORTS nPort, LGS::PCAMERA_PARAMETERS pParameters )
  29. {
  30. // destroy old incarnation :)
  31. Destroy();
  32. m_pComm = pComm;
  33. m_pCamera = pCamera;
  34. if( !m_pComm->Create( nPort, 9600L, 8, CComm485::_NOPARITY ) )
  35. return FALSE;
  36. if( !m_Protocol.Create( m_pComm ) )
  37. return FALSE;
  38. SetProtocol( &m_Protocol );
  39. SetAddress( 0 );
  40. return CmdGetPTZ();
  41. }
  42. void CCameraPhilipsG3ADPTZ::Destroy()
  43. {
  44. m_Protocol.Destroy();
  45. if( m_pComm )
  46. {
  47. m_pComm->Destroy();
  48. m_pComm = NULL;
  49. }
  50. }
  51. /*
  52. void CCameraPhilipsG3ADPTZ::Invalidate( DWORD nSlowTimer, WORD nFastTimer, BOOL bFastTimeValid )
  53. {
  54. // update timeout
  55. if( m_lTimeout > 0 && m_dwLastTime != nFastTimer )
  56. {
  57. // DWORD dwDeltaTime = *s_pTimer - m_dwLastTime;
  58. // m_lTimeout -= (LONG)dwDeltaTime * 55;
  59. // m_dwLastTime = *s_pTimer;
  60. m_lTimeout--;
  61. m_dwLastTime = nFastTimer;
  62. }
  63. // write command
  64. if( m_lTimeout <= 0 )
  65. {
  66. if( m_bRead )
  67. ReadProc( &m_Protocol, 0, TRUE );
  68. m_bRead = WriteProc( &m_Protocol, &m_lTimeout );
  69. m_lTimeout <<= 3;
  70. // m_dwLastTime = *s_pTimer;
  71. }
  72. // read reply
  73. if( m_bRead )
  74. {
  75. BOOL bSuccess = ReadProc( &m_Protocol, 0, FALSE );
  76. // if read successeful
  77. if( bSuccess )
  78. m_lTimeout = 0;
  79. m_bRead = !bSuccess;
  80. }
  81. }
  82. */
  83. #endif // EMBEDDED_CAMERA_PHILIPS