Channel.h 870 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _CHANNEL_H_
  2. #define _CHANNEL_H_
  3. //---------------------------------------------- CChannel ---------
  4. class USCADADLLEXPORT CChannel:public CObject // 通信口对象;
  5. {
  6. protected:
  7. DECLARE_SERIAL(CChannel);
  8. CChannel();
  9. public:
  10. void MoveToNextDevice();
  11. virtual ~CChannel();
  12. CChannel &operator=(CChannel& comport);
  13. virtual CChannel* Clone(void);
  14. virtual void Serialize(CArchive& ar);
  15. virtual void ReadData(void *pData, int nLen){};
  16. virtual void WriteDate(void *pData, int nLen){};
  17. virtual void FreshData(void);
  18. public:
  19. int GetUsedDeviceNum();
  20. CString m_strName; // 通信口名称
  21. int m_nCommunicateType; // 通信类型 0: 串口通信协议 1:网络通信协议
  22. CDeviceArray m_Devices; // 下挂串口设备;
  23. int m_nCurDeviceNo; // 当前工作的设备号,-1时所有设备都处理;
  24. };
  25. typedef CTypedPtrArray<CObArray, CChannel*> CChannelArray;
  26. #endif //(_CHANNEL_H_)