|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "PropertieMgr.h"
|
|
|
|
|
#include "Propertie.h"
|
|
|
|
|
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
CPropertieMgr gDevicePropertieMgr;//设备属性管理
|
|
|
|
|
CPropertieMgr gDrawPropertieMgr;//绘制属性管理
|
|
|
|
|
|
|
|
|
@ -79,3 +79,54 @@ void CPropertieMgr::SaveAllPropertie()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPropertieMgr::ChangePropertieByName(CString name, _variant_t newVal)
|
|
|
|
|
{
|
|
|
|
|
auto iter = m_PropertieValMap.begin();
|
|
|
|
|
auto iter_end = m_PropertieValMap.end();
|
|
|
|
|
for (;iter != iter_end;iter++)
|
|
|
|
|
{
|
|
|
|
|
if ((iter->first)->GetName() == name)
|
|
|
|
|
{
|
|
|
|
|
iter->second->PropertyChangeVal(newVal);
|
|
|
|
|
gDevicePropertieMgr.UpdateDevicePropertyPage();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPropertieMgr::ChangePropertieByVal(void * pVal, _variant_t newVal)
|
|
|
|
|
{
|
|
|
|
|
auto iter = m_AllPropertieVec.begin();
|
|
|
|
|
auto iter_end = m_AllPropertieVec.end();
|
|
|
|
|
for (;iter != iter_end;iter++)
|
|
|
|
|
{
|
|
|
|
|
if ((*iter)->GetpVal() == pVal)
|
|
|
|
|
{
|
|
|
|
|
(*iter)->PropertyChangeVal(newVal);
|
|
|
|
|
gDevicePropertieMgr.UpdateDevicePropertyPage();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CPropertieMgr::UpdateDevicePropertyPage()
|
|
|
|
|
{
|
|
|
|
|
GetFrame()->m_PaneDevicePar.OnCbnSelPropertyChange();
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
CPropertie * CPropertieMgr::GetPropertie(void * pVal)
|
|
|
|
|
{
|
|
|
|
|
auto iter = m_AllPropertieVec.begin();
|
|
|
|
|
auto iter_end = m_AllPropertieVec.end();
|
|
|
|
|
for (;iter != iter_end;iter++)
|
|
|
|
|
{
|
|
|
|
|
if ((*iter)->GetpVal() == pVal)
|
|
|
|
|
{
|
|
|
|
|
return *iter;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}*/
|
|
|
|
|