#include "StdAfx.h" #include "DeviceCommonDataList.h" CDeviceCommonDataList::CDeviceCommonDataList(void) { } CDeviceCommonDataList::~CDeviceCommonDataList(void) { } void CDeviceCommonDataList::Init(pCallbackfun pCallback) { m_pCallback = pCallback; //信息 m_striVersion.Init(_T("Version"),_T("Info"),_T(""),m_pCallback); m_striDeviceType.Init(_T("DeviceType"),_T("Info"),_T(""),m_pCallback); m_striDeviceName.Init(_T("DeviceName"),_T("Info"),_T(""),m_pCallback); //状态 m_bsOpen.Init(_T("Open"),_T("Status"),false,m_pCallback); m_bsConnect.Init(_T("Connect"),_T("Status"),false,m_pCallback); m_bsError.Init(_T("Error"),_T("Status"),false,m_pCallback); m_strsLastError.Init(_T("LastError"),_T("Status"),_T(""),m_pCallback); //功能参数 m_strpLogConfPath.Init(_T("LogConfPath"),_T("API.Param"),_T("conf\\HWlog.properties"),m_pCallback); m_strpLogName.Init(_T("LogName"),_T("API.Param"),_T("Device"),m_pCallback); m_straBeginLog.Init(_T("BeginLog"),_T("API"),_T(""),m_pCallback); m_straOpen.Init(_T("Open"),_T("API"),_T(""),m_pCallback); m_straClose.Init(_T("Close"),_T("API"),_T(""),m_pCallback); m_straReset.Init(_T("Reset"),_T("API"),_T(""),m_pCallback); } int CDeviceCommonDataList::OnSetup( CString strName, CString strGroup, CString strValue ) { int nResult = DEVICE_RST_NOTEXIST; if (strGroup == _T("API.Param")) { if (strName == m_strpLogConfPath.Name()) { nResult = m_strpLogConfPath.SetValue(strValue)? DEVICE_RST_OK:DEVICE_RST_FAULT; } else if (strName == m_strpLogName.Name()) { nResult = m_strpLogName.SetValue(strValue)? DEVICE_RST_OK:DEVICE_RST_FAULT; } } return nResult; }