DevicesManager.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _DEVICEMANAGER_H_
  2. #define _DEVICEMANAGER_H_
  3. //-------------------------------------- CDevicesManager --------------------------------------
  4. class USCADADLLEXPORT CDevicesManager
  5. {
  6. public:
  7. CDevicesManager();
  8. ~CDevicesManager();
  9. public:
  10. void Load(char *pStrDirectroy);
  11. void Store(char *pStrDirectroy);
  12. int FindCommPort(CString strName);
  13. BOOL FindDev(CString strName, int &nChannlIndex, int &nDeviceIndex);
  14. BOOL FindDev(CString strIP, int m_nPort, int &nChannlIndex, int &nDeviceIndex);
  15. BOOL FindCommPort(CString strName, int nAddr, int &nChannlIndex, int &nDeviceIndex);
  16. int GetVarstatus(double iParaValue, int iUpperLimit, int iLowerLimit, int iNormalState);
  17. BOOL Connection(LPCTSTR strAddr, LPCTSTR strPort);
  18. void DisConnection( LPCTSTR strPort);
  19. BOOL GetOpenStatus(LPCTSTR strPort);
  20. BOOL GetSocketStatus(LPCTSTR strPort);
  21. void SetSocketStatus(BOOL bSocket,LPCTSTR strPort);
  22. BOOL SendNoticeToServer( int iCmd,int iOperateType,CString sUserName,CString sUID,int iVarID,LPCTSTR strPort );
  23. BOOL GetDogInfo(LPCTSTR strPort);
  24. BOOL TestAlarm(LPCTSTR strPort);
  25. BOOL ConfigAlarm( CString sUID,int iVarID,int iStatus,int iAlarmIndex );
  26. void Release(LPCTSTR strPort);//ÊÍ·ÅCTCPClient£º£ºm_pTcpClient
  27. bool m_bIsPastDue;//ÊÇ·ñ¹ýÆÚ
  28. public:
  29. void InitailizeData();
  30. void FreshData(void);
  31. public:
  32. CChannelArray m_channels;
  33. protected:
  34. unsigned int CalcCheckSum( void *pData, unsigned int nSize );
  35. private:
  36. void ClearUp();
  37. };
  38. #endif