PNP_PIbd-31_Rodionov_I_A_Co.../models/devicestructureelement.cpp
2024-12-24 18:13:22 +04:00

80 lines
1.6 KiB
C++

#include "devicestructureelement.h"
DeviceStructureElement::DeviceStructureElement()
{}
DeviceStructureElement::~DeviceStructureElement()
{}
QString DeviceStructureElement::nameModel() const
{
return _nameModel;
}
void DeviceStructureElement::setNameModel(const QString &newNameModel)
{
_nameModel = newNameModel;
}
QString DeviceStructureElement::nameManuf() const
{
return _nameManuf;
}
void DeviceStructureElement::setNameManuf(const QString &newNameManuf)
{
_nameManuf = newNameManuf;
}
QString DeviceStructureElement::description() const
{
return _description;
}
void DeviceStructureElement::setDescription(const QString &newDescription)
{
_description = newDescription;
}
QString DeviceStructureElement::nameType() const
{
return _nameType;
}
void DeviceStructureElement::setNameType(const QString &newNameType)
{
_nameType = newNameType;
}
int DeviceStructureElement::count() const
{
return _count;
}
void DeviceStructureElement::setCount(int newCount)
{
_count = newCount;
}
void DeviceStructureElement::fromJson(const QJsonObject &json)
{
setId(json["id"].toInt());
setNameModel(json["nameModel"].toString());
setNameManuf(json["nameManuf"].toString());
setDescription(json["description"].toString());
setNameType(json["nameType"].toString());
setCount(json["count"].toInt());
}
QJsonObject DeviceStructureElement::toJson() const
{
QJsonObject obj;
obj["id"] = id();
obj["nameModel"] = nameModel();
obj["nameManuf"] = nameManuf();
obj["description"] = description();
obj["nameType"] = nameType();
obj["count"] = count();
return obj;
}