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.

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