DeviceData.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include <afxstr.h>
  3. #include "DeviceInterface/Device_API.h"
  4. class CDeviceData
  5. {
  6. public:
  7. CDeviceData();
  8. CDeviceData(CString strName,CString strGroup,int nType,CString strValue);
  9. ~CDeviceData();
  10. int Init(CString strName,CString strGroup,int nValue,pCallbackfun pfun);
  11. int Init(CString strName,CString strGroup,float fValue,pCallbackfun pfun);
  12. int Init(CString strName,CString strGroup,bool bValue,pCallbackfun pfun);
  13. int Init(CString strName,CString strGroup,CString strValue,pCallbackfun pfun);
  14. int Init(CString strName,CString strGroup,const wchar_t* strValue,pCallbackfun pfun);
  15. int Init(CString strName,CString strGroup,const char* strValue,pCallbackfun pfun);
  16. bool operator=(const int nValue);
  17. bool operator=(const float fValue);
  18. bool operator=(const bool bValue);
  19. bool operator=(const wchar_t* strValue);
  20. bool operator=(const CString& strValue);
  21. bool operator=(const char* strValue);
  22. CString Name();
  23. CString Group();
  24. CString Data();
  25. int Type();
  26. CString strType();
  27. int nValue();
  28. float fValue();
  29. bool bValue();
  30. CString strValue();
  31. bool SetValue(CString strValue);
  32. private:
  33. CString m_strName;
  34. CString m_strGroup;
  35. CString m_Value;
  36. int m_nType; //0:int 1:float 2:bool 3:string
  37. pCallbackfun m_pFunc;
  38. int m_nValue;
  39. float m_fValue;
  40. bool m_bValue;
  41. CString m_strValue;
  42. bool FireCallback();
  43. };