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/nmDataAnalInfo.cpp

202 lines
4.8 KiB
C++

#include "iXmlTable.h"
#include "nmDataAnalInfo.h"
ZX_DEFINE_DYNAMIC(DataAnalInfo, nmDataAnalInfo)
nmDataAnalInfo::nmDataAnalInfo()
: ZxDataObjectStrUser(0)
{
// m_sAnalID = "";
m_sWellCode = "";
// m_sAnalTitle = "";
m_sAnalType = "";
m_sAnalDesc = "";
m_sCth = "Nai";
checkXmlTable();
}
nmDataAnalInfo::nmDataAnalInfo(const nmDataAnalInfo &other)
: ZxDataObjectStrUser(other)
{
if (this == &other)
{
return;
}
checkXmlTable();
//m_sAnalID = other.m_sAnalID;
m_sWellCode = other.m_sWellCode;
//m_sAnalTitle = other.m_sAnalTitle;
m_sAnalType = other.m_sAnalType;
m_sAnalDesc = other.m_sAnalDesc;
}
nmDataAnalInfo::~nmDataAnalInfo()
{
}
ZxDataObject* nmDataAnalInfo::clone()
{
ensureLoaded();
return (new nmDataAnalInfo(*this));
}
QString nmDataAnalInfo::type() const
{
// 模块自行处理及定义,框架部分不再涉及
return "zx_NumDataAnalInfo"; // iDataModelType::sTypeAnalInfo;
}
QString nmDataAnalInfo::getTableName()
{
// 返回表名,模型自行处理
return "N_ANAL_INFO";
}
nmDataAnalInfo &nmDataAnalInfo::operator = (const nmDataAnalInfo &other)
{
if (this == &other)
{
return *this;
}
ZxDataObjectStrUser::operator = (other);
//m_sAnalID = other.m_sAnalID;
m_sWellCode = other.m_sWellCode;
//m_sAnalTitle = other.m_sAnalTitle;
m_sAnalType = other.m_sAnalType;
m_sAnalDesc = other.m_sAnalDesc;
return *this;
}
bool nmDataAnalInfo::operator == (const nmDataAnalInfo &other) const
{
return (
ZxDataObjectStrUser::operator == (other) \
//&& m_sAnalID.compare(other.m_sAnalID, Qt::CaseInsensitive) == 0
&& m_sWellCode.compare(other.m_sWellCode, Qt::CaseInsensitive) == 0
//&& m_sAnalTitle.compare(other.m_sAnalTitle,Qt::CaseInsensitive) == 0
&& m_sAnalType.compare(other.m_sAnalType,Qt::CaseInsensitive) == 0
&& m_sAnalDesc.compare(other.m_sAnalDesc,Qt::CaseInsensitive) == 0
);
}
bool nmDataAnalInfo::operator != (const nmDataAnalInfo &other) const
{
return (
ZxDataObjectStrUser::operator != (other) \
//|| m_sAnalID.compare(other.m_sAnalID, Qt::CaseInsensitive) != 0
|| m_sWellCode.compare(other.m_sWellCode, Qt::CaseInsensitive) != 0
//|| m_sAnalTitle.compare(other.m_sAnalTitle,Qt::CaseInsensitive) != 0
|| m_sAnalType.compare(other.m_sAnalType,Qt::CaseInsensitive) != 0
|| m_sAnalDesc.compare(other.m_sAnalDesc,Qt::CaseInsensitive) != 0
);
}
//void nmDataAnalInfo::setAnalID(const QString &sAnalID)
//{
// m_sAnalID = sAnalID;
//}
//QString nmDataAnalInfo::getAnalID()const
//{
// ensureLoaded();
// return m_sAnalID;
//}
void nmDataAnalInfo::setWellCode(const QString &sWellCode)
{
m_sWellCode = sWellCode;
}
QString nmDataAnalInfo::getWellCode()const
{
ensureLoaded();
return m_sWellCode;
}
//void nmDataAnalInfo::setAnalTitle(const QString &sAnalTitle)
//{
// m_sAnalTitle = sAnalTitle;
//}
//QString nmDataAnalInfo::getAnalTitle()const
//{
// ensureLoaded();
// return m_sAnalTitle;
//}
void nmDataAnalInfo::setAnalType(const QString &sAnalType)
{
m_sAnalType = sAnalType;
}
QString nmDataAnalInfo::getAnalType()const
{
ensureLoaded();
return m_sAnalType;
}
void nmDataAnalInfo::setAnalDesc(const QString &sAnalDesc)
{
m_sAnalDesc = sAnalDesc;
}
QString nmDataAnalInfo::getAnalDesc(void) const
{
ensureLoaded();
return m_sAnalDesc;
}
bool nmDataAnalInfo::_parseData(VecVariant vec, int& n)
{
m_sCode = vec.at(n++).toString();
m_sWellCode = vec.at(n++).toString();
m_sName = vec.at(n++).toString();
m_sAnalType = vec.at(n++).toString();
m_sAnalDesc = vec.at(n++).toString();
return ZxDataObjectStrUser::_parseData(vec, n);
}
bool nmDataAnalInfo::_sumUpData(VecVariant& vec)
{
ensureLoaded();
vec.append(m_sCode);
vec.append(m_sWellCode);
vec.append(m_sName);
vec.append(m_sAnalType);
vec.append(m_sAnalDesc);
return ZxDataObjectStrUser::_sumUpData(vec);
}
void nmDataAnalInfo::onSerialize(ZxSerializer* ser)
{
ZxDataObjectStrUser::onSerialize(ser);
// ser->write("AnalID", m_sAnalID);
ser->write("WellCode", m_sWellCode);
// ser->write("AnalTitle", m_sAnalTitle);
ser->write("AnalType", m_sAnalType);
ser->write("AnalDesc",m_sAnalDesc);
}
void nmDataAnalInfo::onDeserialize(ZxSerializer* ser)
{
ZxDataObjectStrUser::onDeserialize(ser);
// ser->read("AnalID", m_sAnalID);
ser->read("WellCode", m_sWellCode);
// ser->read("AnalTitle", m_sAnalTitle);
ser->read("AnalType", m_sAnalType);
ser->read("AnalDesc",m_sAnalDesc);
}
QIcon nmDataAnalInfo::getIcon(bool expanded) const
{
return zxLoadIcon("tAnal");
}