52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
|
|
#include "baseItemPropertyProxy.h"
|
||
|
|
#include "graphicsItem/functionModelItem/graphicsFunctionModelItem.h"
|
||
|
|
#include "graphicsDataModel/fixedPortsModel.h"
|
||
|
|
#include "baseProperty.h"
|
||
|
|
|
||
|
|
BaseItemPropertyProxy::BaseItemPropertyProxy(GraphicsFunctionModelItem* pItem)
|
||
|
|
: BasePropertyProxy(pItem)
|
||
|
|
,_pItem(pItem)
|
||
|
|
,_pControl(nullptr)
|
||
|
|
{
|
||
|
|
_pControl= _pItem->getHandle();
|
||
|
|
}
|
||
|
|
|
||
|
|
BaseItemPropertyProxy::~BaseItemPropertyProxy()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
QString BaseItemPropertyProxy::getName() const
|
||
|
|
{
|
||
|
|
|
||
|
|
return _pItem->getName();
|
||
|
|
}
|
||
|
|
|
||
|
|
void BaseItemPropertyProxy::setName(QString str)
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
QMap<QString,double> BaseItemPropertyProxy::getMap()
|
||
|
|
{
|
||
|
|
QUuid uid = _pItem->getProperty()->uuid();
|
||
|
|
QMap<QString,double> map;
|
||
|
|
if(_pControl){
|
||
|
|
auto pPara = _pControl->getMonitorPara();
|
||
|
|
auto lstInfo = pPara.value(uid);
|
||
|
|
if(!lstInfo.isEmpty()){
|
||
|
|
for(auto &info:lstInfo){
|
||
|
|
if(info.bSelected)
|
||
|
|
map[info.sName] = info.mapValue.size()?info.mapValue.last():0; //取最新的值
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return map;
|
||
|
|
}
|
||
|
|
|
||
|
|
void BaseItemPropertyProxy::setMap(QMap<QString,double>)
|
||
|
|
{
|
||
|
|
//todo:接口修改参量
|
||
|
|
}
|