#ifndef _CHANNEL_H_ #define _CHANNEL_H_ //---------------------------------------------- CChannel --------- class USCADADLLEXPORT CChannel:public CObject // 通信口对象; { protected: DECLARE_SERIAL(CChannel); CChannel(); public: void MoveToNextDevice(); virtual ~CChannel(); CChannel &operator=(CChannel& comport); virtual CChannel* Clone(void); virtual void Serialize(CArchive& ar); virtual void ReadData(void *pData, int nLen){}; virtual void WriteDate(void *pData, int nLen){}; virtual void FreshData(void); public: int GetUsedDeviceNum(); CString m_strName; // 通信口名称 int m_nCommunicateType; // 通信类型 0: 串口通信协议 1:网络通信协议 CDeviceArray m_Devices; // 下挂串口设备; int m_nCurDeviceNo; // 当前工作的设备号,-1时所有设备都处理; //add CString m_strPort; // 端口名(如COM1,COM2等); int m_nAddr; // 地址 int m_nBaudRate; // 0-6=1200,2400,4800,9600,14400,19200,38400; int m_nByteSize; // 0-2=6,7,8 int m_nParity; // 0-4=no,odd,even,mark int m_nStopBits; // 0-2=1,1.5,2 BOOL m_bDTRDSR; BOOL m_bRTSCTS; BOOL m_bXONXOFF; }; typedef CTypedPtrArray CChannelArray; #endif //(_CHANNEL_H_)