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.

94 lines
2.3 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: DeviceVMs.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of DeviceVMs.h
  13. //----------------------------------------------------------------------------
  14. // DeviceVideoMatrix.h: interface for the CDeviceVMs class.
  15. //
  16. //////////////////////////////////////////////////////////////////////
  17. #if !defined(AFX_DEVICEVIDEOMATRIX_H__91F2F4A1_525E_41D3_9840_04BC81ADDBDE__INCLUDED_)
  18. #define AFX_DEVICEVIDEOMATRIX_H__91F2F4A1_525E_41D3_9840_04BC81ADDBDE__INCLUDED_
  19. #include "Device.h"
  20. #include "DeviceVM.h"
  21. #include "QueueCommon.h"
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif
  25. // "Migvan" video mul
  26. class CDeviceVMs :
  27. public CDevice,
  28. public CDeviceVM
  29. {
  30. public:
  31. CDeviceVMs();
  32. virtual ~CDeviceVMs();
  33. public:
  34. enum{ INPUT_COUNT = 8, OUTPUT_COUNT = 4 };
  35. void SetAutoInit( BOOL bAutoInit ) { m_bAutoInit = bAutoInit; }
  36. void SetHardwareID( LPBYTE pID ) { ::CopyMemory( m_pHardwareID, pID, sizeof(BYTE)*4 ); }
  37. protected:
  38. friend class CSocketVM;
  39. virtual void PostConnect( int nInput, int nOutput );
  40. virtual void PostGetState();
  41. void SetLogicalID( WORD wId );
  42. BOOL GetCommand( LPBYTE pBuffer, DWORD &dwPause, BOOL &bPause );
  43. BOOL SetAnswer( LPBYTE pBuffer, DWORD nCount );
  44. private:
  45. enum{ STAGE_GET_HARDWARE_ID,
  46. STAGE_SET_LOGICAL_ID,
  47. STAGE_SET_CONNECT,
  48. STAGE_GET_CONNECT };
  49. struct STAGE
  50. {
  51. int nStage;
  52. int nPause;
  53. int nCount;
  54. int nRetry;
  55. };
  56. struct COMMAND
  57. {
  58. int nCount;
  59. int nStage;
  60. BOOL bPause;
  61. BOOL bSuccess;
  62. STAGE pStage[10];
  63. };
  64. static const COMMAND CMD_INIT;
  65. static const COMMAND CMD_AUTO_INIT;
  66. static const COMMAND CMD_GET_STATE;
  67. static const COMMAND CMD_CONNECT;
  68. COMMAND m_Command;
  69. BOOL m_bCommand[ DVMC_COUNT ];
  70. struct DATA_CONNECT
  71. {
  72. int pOutput[ OUTPUT_COUNT ];
  73. }m_DataConnect;
  74. private:
  75. BYTE m_pHardwareID[4];
  76. BYTE m_pLogicalID[2];
  77. BOOL m_bAutoInit;
  78. };
  79. #endif // !defined(AFX_DEVICEVIDEOMATRIX_H__91F2F4A1_525E_41D3_9840_04BC81ADDBDE__INCLUDED_)