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.

113 lines
2.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: Laserguard libraries
  7. // SUBSYSTEM: Devices support library
  8. // FILE: DMigPTZ.h
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of CLgDevicePTZMigvan
  13. //----------------------------------------------------------------------------
  14. #ifndef __LG__DEVICE__MIGVAN__PTZ__H__INCLUDED__
  15. #define __LG__DEVICE__MIGVAN__PTZ__H__INCLUDED__
  16. #ifdef __BORLANDC__
  17. #include "..\LgLib\Comm\ProtPTZm.h"
  18. #include "..\LgLib\Device\LgDevPTZ.h"
  19. #else
  20. #include "..\Comm\ProtPTZm.h"
  21. #include "LgDevPTZ.h"
  22. #endif
  23. class CLgDevicePTZMigvan :
  24. public CLgDevicePTZ
  25. {
  26. public:
  27. CLgDevicePTZMigvan();
  28. virtual ~CLgDevicePTZMigvan();
  29. public:
  30. // subtype
  31. enum MIGVAN_SUBTYPE{ MST_878 = 1, MST_KD6Z = 2 };
  32. void SetType( MIGVAN_SUBTYPE bType ) { m_bType = bType; }
  33. MIGVAN_SUBTYPE GetType() { return m_bType; }
  34. public:
  35. // commands for Migvan
  36. BOOL CmdAutoInit();
  37. BOOL CmdWarmBoot();
  38. BOOL CmdGetSerialNumber();
  39. BOOL CmdSetAddress( PBYTE pSerialNumber, BYTE bAddress );
  40. protected:
  41. // event for Migvan
  42. virtual void OnEvtAutoInit( PBYTE pSerialNumber, BYTE bAddress ) = 0;
  43. virtual void OnEvtWarmBoot() = 0;
  44. virtual void OnEvtGetSerialNumber( PBYTE pSerialNumber ) = 0;
  45. virtual void OnEvtSetAddress( BYTE bAddress, PBYTE pSerialNumber ) = 0;
  46. public:
  47. virtual BOOL WriteProc( void *pProtocol, PLONG pTimeout );
  48. virtual BOOL ReadProc( void *pProtocol, LONG lTimeout, BOOL bLastChance );
  49. private:
  50. enum
  51. {
  52. STAGE_GET_SERIAL_NUMBER,
  53. STAGE_SET_FOCUS,
  54. STAGE_GET_POSITION,
  55. STAGE_SET_PRESET,
  56. STAGE_GOTO_PRESET,
  57. STAGE_SET_ADDRESS,
  58. STAGE_WARM_BOOT,
  59. };
  60. /*
  61. private:
  62. BYTE m_bAddress;
  63. */
  64. public:
  65. enum
  66. {
  67. CMD_AUTO_INIT = CMD_DEVICE_PTZ + 1,
  68. CMD_WARM_BOOT = CMD_DEVICE_PTZ + 2,
  69. CMD_GET_SERIAL_NUMBER = CMD_DEVICE_PTZ + 3,
  70. CMD_SET_ADDRESS = CMD_DEVICE_PTZ + 4,
  71. EVT_SERIAL_NUMBER = EVT_DEVICE_PTZ + 1,
  72. EVT_ADDRESS = EVT_DEVICE_PTZ + 2,
  73. EVT_AUTO_INIT = EVT_DEVICE_PTZ + 3,
  74. EVT_WARM_BOOT = EVT_DEVICE_PTZ + 4,
  75. };
  76. public:
  77. typedef struct PTZ_SERIAL_NUMBER
  78. {
  79. BYTE bAddress;
  80. BYTE pSerialNumber[5];
  81. }PTZ_SERIAL_NUMBER, *PPTZ_SERIAL_NUMBER;
  82. private:
  83. PTZ_SERIAL_NUMBER m_SerialNumber;
  84. private:
  85. INT m_nMode;
  86. INT m_nStage;
  87. INT m_nStageCounter;
  88. INT m_nNotInPositionCount;
  89. private:
  90. INT m_nPresetCount;
  91. INT m_nPresetMax;
  92. private:
  93. MIGVAN_SUBTYPE m_bType;
  94. private:
  95. void OnPerformCmd();
  96. };
  97. #endif