You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/FITK_Kernel/FITKEasyParam/FITKParamInt.cpp

58 lines
1.3 KiB
C++

#include "FITKParamInt.h"
namespace Core
{
FITKParamInt::FITKParamInt()
{
}
FITKParamInt::~FITKParamInt()
{
}
FITKAbstractEasyParam::FITKEasyParamType FITKParamInt::getParamType()
{
return FITKAbstractEasyParam::FITKEasyParamType::FEPInt;
}
void FITKParamInt::copyParaData(FITKAbstractEasyParam* data)
{
//判断同一类型数据对象
if (!data || data->getParamType() != this->getParamType())return;
FITKParamInt* oldData = dynamic_cast<FITKParamInt*>(data);
if (!oldData)return;
//设置名称
this->setDataObjectName(data->getDataObjectName());
//拷贝参数
this->_value = oldData->_value;
this->_range[0] = oldData->_range[0];
this->_range[1] = oldData->_range[1];
}
void FITKParamInt::setValue(int value)
{
if (value < _range[0] || value>_range[1])return;
_value = value;
emit sigDataChange();
}
int FITKParamInt::getValue()
{
return _value;
}
void FITKParamInt::setRange(int * range)
{
_range[0] = range[0];
_range[1] = range[1];
}
void FITKParamInt::getRange(int * range)
{
range[0] = _range[0];
range[1] = _range[1];
}
}