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.

68 lines
1.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: SocketPTZ.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of SocketPTZ.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __SOCKET__PTZ__H__INCLUDED__
  15. #define __SOCKET__PTZ__H__INCLUDED__
  16. #include "SocketRS232.h"
  17. #include "DevicePTZs.h"
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif
  21. class CSocketPTZ : public CSocketRS232
  22. {
  23. public:
  24. CSocketPTZ();
  25. virtual ~CSocketPTZ();
  26. public:
  27. BOOL Create( CSensorArray* pStorage, LPCTSTR pPort );
  28. BOOL DeviceAttach( CDevicePTZs *pDevice );
  29. BOOL DeviceDetach( CDevicePTZs *pDevice );
  30. protected:
  31. friend class CDevicePTZs;
  32. void Resume() { CSocketRS232::Start(); }
  33. private:
  34. enum{ MAX_DEVICE = 127 };
  35. CDevicePTZs *m_ppDevice[MAX_DEVICE];
  36. int m_nDeviceCount;
  37. int m_nDeviceCurrent;
  38. private:
  39. DWORD m_pTime[MAX_DEVICE];
  40. private:
  41. virtual int OnCommand();
  42. virtual void OnBeforeRead( DWORD& nCount, DWORD& dwTime );
  43. virtual int OnAfterRead( LPBYTE pBuffer, DWORD nCount );
  44. virtual void OnBeforeWrite( LPBYTE pBuffer, DWORD& nCount );
  45. virtual int OnAfterWrite();
  46. virtual int OnPause( DWORD &dwTime );
  47. virtual void CommandLoopStart() {}
  48. virtual void CommandLoopStop() {}
  49. private:
  50. enum{ MAX_LENGTH = 1000 };
  51. BYTE m_pBuffer[ MAX_LENGTH ];
  52. DWORD m_nRCount;
  53. DWORD m_nWCount;
  54. };
  55. #endif