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.

83 lines
1.7 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: DeviceDI.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of DeviceDI.h
  13. //----------------------------------------------------------------------------
  14. // DeviceIN.h: interface for the CDeviceIN class.
  15. //
  16. //////////////////////////////////////////////////////////////////////
  17. #ifndef __DEVICE__IN__H__INCLUDED__
  18. #define __DEVICE__IN__H__INCLUDED__
  19. #include "DirectInput.h"
  20. #include "..\..\LgLib\Templ.h"
  21. #if _MSC_VER > 1000
  22. #pragma once
  23. #endif // _MSC_VER > 1000
  24. // Device direct input
  25. class CDeviceDI
  26. {
  27. public:
  28. CDeviceDI();
  29. virtual ~CDeviceDI();
  30. public:
  31. void SetNC( int nBit, BOOL bNC );
  32. protected:
  33. void PostEnable( BOOL bEnable, int nBit = -1 );
  34. void PostGetState();
  35. public:
  36. enum{ DDIC_GET_STATE = 0,
  37. DDIC_ENABLE = 1,
  38. DDIC_COUNT = 2 };
  39. struct DDIEVENT
  40. {
  41. BYTE id;
  42. union
  43. {
  44. BOOL bEnable;
  45. int nBit;
  46. };
  47. };
  48. CLgQueueP<DDIEVENT,100> m_Queue;
  49. protected:
  50. void SetCount( int nCount );
  51. int GetCount() { return m_arrInput.GetCount(); }
  52. BOOL GetBit( int nBit );
  53. friend class CSocketRS232DI;
  54. void SetBit( int nBit, BOOL bOn );
  55. protected:
  56. friend class CDirectInput;
  57. BOOL SetDirectInput( CDirectInput *pDirectInput, int nBit );
  58. protected:
  59. typedef CLgArray<CDirectInput*> CDirectInputArray;
  60. typedef struct INPUT_INFO
  61. {
  62. BOOL bOn;
  63. BOOL bNC;
  64. BOOL bFirstTime;
  65. CDirectInputArray arrDirectInput;
  66. }INPUT_INFO;
  67. CLgArray<INPUT_INFO> m_arrInput;
  68. };
  69. #endif