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.
nmWATI/Src/nmNum/nmData/nmDataAnalRun.cpp

179 lines
3.8 KiB
C++

#include "iXmlTable.h"
#include "nmDataAnalRun.h"
ZX_DEFINE_DYNAMIC(DataAnalRun, nmDataAnalRun)
nmDataAnalRun::nmDataAnalRun()
: ZxDataObjectBin(0)
{
// m_sAnalID = "";
m_baDataBasic = QByteArray();
m_baDataPvt = QByteArray();
m_baDataKrog = QByteArray();
m_sCth = "Nar";
checkXmlTable();
}
nmDataAnalRun::nmDataAnalRun(const nmDataAnalRun &other)
: ZxDataObjectBin(other)
{
if (this == &other)
{
return;
}
checkXmlTable();
//m_sAnalID = other.m_sAnalID;
m_baDataBasic = other.m_baDataBasic;
m_baDataPvt = other.m_baDataPvt;
m_baDataKrog = other.m_baDataKrog;
}
nmDataAnalRun::~nmDataAnalRun()
{
}
ZxDataObject* nmDataAnalRun::clone()
{
ensureLoaded();
return (new nmDataAnalRun(*this));
}
QString nmDataAnalRun::type() const
{
// 模块自行处理及定义,框架部分不再涉及
return "zx_NumDataAnalRun"; // iDataModelType::sTypeAnalRun;
}
QString nmDataAnalRun::getTableName()
{
// 返回表名,模型自行处理
return "N_ANAL_RUN";
}
nmDataAnalRun &nmDataAnalRun::operator = (const nmDataAnalRun &other)
{
if (this == &other)
{
return *this;
}
ZxDataObjectBin::operator = (other);
//m_sAnalID = other.m_sAnalID;
m_baDataBasic = other.m_baDataBasic;
m_baDataPvt = other.m_baDataPvt;
m_baDataKrog = other.m_baDataKrog;
return *this;
}
bool nmDataAnalRun::operator == (const nmDataAnalRun &other) const
{
return (
ZxDataObjectBin::operator == (other) \
//&& m_sAnalID.compare(other.m_sAnalID, Qt::CaseInsensitive) == 0
&& m_baDataBasic == other.m_baDataBasic
&& m_baDataPvt == other.m_baDataPvt
&& m_baDataKrog == other.m_baDataKrog
);
}
bool nmDataAnalRun::operator != (const nmDataAnalRun &other) const
{
return (
ZxDataObjectBin::operator != (other) \
//|| m_sAnalID.compare(other.m_sAnalID, Qt::CaseInsensitive) != 0
|| m_baDataBasic != other.m_baDataBasic
|| m_baDataPvt != other.m_baDataPvt
|| m_baDataKrog != other.m_baDataKrog
);
}
void nmDataAnalRun::setDataBasic(const QByteArray& v)
{
m_baDataBasic = v;
}
QByteArray nmDataAnalRun::getDataBasic() const
{
ensureLoaded();
return m_baDataBasic;
}
void nmDataAnalRun::setDataPvt(const QByteArray& v)
{
m_baDataPvt = v;
}
QByteArray nmDataAnalRun::getDataPvt() const
{
ensureLoaded();
return m_baDataPvt;
}
void nmDataAnalRun::setDataKrog(const QByteArray& v)
{
m_baDataKrog = v;
}
QByteArray nmDataAnalRun::getDataKrog() const
{
ensureLoaded();
return m_baDataKrog;
}
bool nmDataAnalRun::_parseData(VecVariant vec, int& n)
{
m_sCode = vec.at(n++).toString();
m_baDataBasic = vec.at(n++).toByteArray();
m_baDataPvt = vec.at(n++).toByteArray();
m_baDataKrog = vec.at(n++).toByteArray();
return ZxDataObjectBin::_parseData(vec, n);
}
bool nmDataAnalRun::_sumUpData(VecVariant& vec)
{
ensureLoaded();
vec.append(m_sCode);
vec.append(m_baDataBasic);
vec.append(m_baDataPvt);
vec.append(m_baDataKrog);
return ZxDataObjectBin::_sumUpData(vec);
}
void nmDataAnalRun::onSerialize(ZxSerializer* ser)
{
ZxDataObjectBin::onSerialize(ser);
// ser->write("AnalID", m_sAnalID);
ser->write("DataBasic", m_baDataBasic);
ser->write("DataPvt", m_baDataPvt);
ser->write("DataKrog", m_baDataKrog);
}
void nmDataAnalRun::onDeserialize(ZxSerializer* ser)
{
ZxDataObjectBin::onDeserialize(ser);
// ser->read("AnalID", m_sAnalID);
ser->read("DataBasic", m_baDataBasic);
ser->read("DataPvt", m_baDataPvt);
ser->read("DataKrog", m_baDataKrog);
}
QIcon nmDataAnalRun::getIcon(bool expanded) const
{
return zxLoadIcon("tAnal");
}