DeviceCommonDataList.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "StdAfx.h"
  2. #include "DeviceCommonDataList.h"
  3. CDeviceCommonDataList::CDeviceCommonDataList(void)
  4. {
  5. }
  6. CDeviceCommonDataList::~CDeviceCommonDataList(void)
  7. {
  8. }
  9. void CDeviceCommonDataList::Init(pCallbackfun pCallback)
  10. {
  11. m_pCallback = pCallback;
  12. //ÐÅÏ¢
  13. m_striVersion.Init(_T("Version"),_T("Info"),_T(""),m_pCallback);
  14. m_striDeviceType.Init(_T("DeviceType"),_T("Info"),_T(""),m_pCallback);
  15. m_striDeviceName.Init(_T("DeviceName"),_T("Info"),_T(""),m_pCallback);
  16. //״̬
  17. m_bsOpen.Init(_T("Open"),_T("Status"),false,m_pCallback);
  18. m_bsConnect.Init(_T("Connect"),_T("Status"),false,m_pCallback);
  19. m_bsError.Init(_T("Error"),_T("Status"),false,m_pCallback);
  20. m_strsLastError.Init(_T("LastError"),_T("Status"),_T(""),m_pCallback);
  21. //¹¦ÄܲÎÊý
  22. m_strpLogConfPath.Init(_T("LogConfPath"),_T("API.Param"),_T("conf\\HWlog.properties"),m_pCallback);
  23. m_strpLogName.Init(_T("LogName"),_T("API.Param"),_T("Device"),m_pCallback);
  24. m_straBeginLog.Init(_T("BeginLog"),_T("API"),_T(""),m_pCallback);
  25. m_straOpen.Init(_T("Open"),_T("API"),_T(""),m_pCallback);
  26. m_straClose.Init(_T("Close"),_T("API"),_T(""),m_pCallback);
  27. m_straReset.Init(_T("Reset"),_T("API"),_T(""),m_pCallback);
  28. }
  29. int CDeviceCommonDataList::OnSetup( CString strName, CString strGroup, CString strValue )
  30. {
  31. int nResult = DEVICE_RST_NOTEXIST;
  32. if (strGroup == _T("API.Param"))
  33. {
  34. if (strName == m_strpLogConfPath.Name())
  35. {
  36. nResult = m_strpLogConfPath.SetValue(strValue)? DEVICE_RST_OK:DEVICE_RST_FAULT;
  37. }
  38. else if (strName == m_strpLogName.Name())
  39. {
  40. nResult = m_strpLogName.SetValue(strValue)? DEVICE_RST_OK:DEVICE_RST_FAULT;
  41. }
  42. }
  43. return nResult;
  44. }