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.

66 lines
1.4 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: DirectInput.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of DirectInput.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __DIRECT__INPUT__H__INCLUDED__
  15. #define __DIRECT__INPUT__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "..\..\LgLib\Templ.h"
  20. class CDirectInput
  21. {
  22. public:
  23. CDirectInput();
  24. virtual ~CDirectInput();
  25. protected:
  26. friend class CDeviceDI;
  27. public:
  28. BOOL CheckState();
  29. BOOL CheckCommand( PBOOL pOn );
  30. int GetSubIndex() { return m_nSubIndex; }
  31. void CmdEnable( BOOL bEnable );
  32. void CmdReset();
  33. BOOL ConnectToDevice( CDeviceDI *pDeviceDI, int nDeviceBit, int nSensorBit );
  34. int GetState(); // behaviour should be redefined
  35. protected:
  36. enum{ DIC_SET_STATE, DIC_TIMEOUT };
  37. struct DIEVENT
  38. {
  39. BYTE id;
  40. union
  41. {
  42. BOOL bOn;
  43. };
  44. };
  45. CLgQueueP<DIEVENT,100> m_Queue;
  46. protected:
  47. void PostOn( BOOL bOn );
  48. CDeviceDI *m_pDeviceDI;
  49. int m_nBit;
  50. enum{ DIS_UNKNOWN, DIS_TIMEOUT, DIS_ON, DIS_OFF };
  51. int m_nState;
  52. bool m_bPostAlarm;
  53. int m_nSubIndex;
  54. };
  55. #endif