|
|
|
#include "nmDataExample.h"
|
|
|
|
#include "nmDefines.h"
|
|
|
|
|
|
|
|
ZX_DEFINE_DYNAMIC(DataExample, nmDataExample)
|
|
|
|
|
|
|
|
nmDataExample::nmDataExample(): ZxDataObjectDbl(0)
|
|
|
|
{
|
|
|
|
//m_sID = "";
|
|
|
|
// m_sWellCode = "";
|
|
|
|
//m_sName = "";
|
|
|
|
// m_dTopDepth = 0.00;
|
|
|
|
// m_dBottomDepth = 0.00;
|
|
|
|
m_sRemark = "";
|
|
|
|
m_sCth = "nmDE";
|
|
|
|
checkXmlTable();
|
|
|
|
}
|
|
|
|
|
|
|
|
nmDataExample::nmDataExample(const nmDataExample &other)
|
|
|
|
: ZxDataObjectDbl(other)
|
|
|
|
{
|
|
|
|
if (this == &other) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
checkXmlTable();
|
|
|
|
//m_sID = other.m_sID;
|
|
|
|
// m_sWellCode = other.m_sWellCode;
|
|
|
|
//m_sName = other.m_sName;
|
|
|
|
// m_dTopDepth = other.m_dTopDepth;
|
|
|
|
// m_dBottomDepth = other.m_dBottomDepth;
|
|
|
|
}
|
|
|
|
|
|
|
|
nmDataExample::~nmDataExample()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nmDataExample &nmDataExample::operator = (const nmDataExample &other)
|
|
|
|
{
|
|
|
|
//m_sID = other.m_sID;
|
|
|
|
// m_sWellCode = other.m_sWellCode;
|
|
|
|
//m_sName = other.m_sName;
|
|
|
|
// m_dTopDepth = other.m_dTopDepth;
|
|
|
|
// m_dBottomDepth = other.m_dBottomDepth;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
ZxDataObject* nmDataExample::clone()
|
|
|
|
{
|
|
|
|
ensureLoaded();
|
|
|
|
return (new nmDataExample(*this));
|
|
|
|
}
|
|
|
|
|
|
|
|
QString nmDataExample::type() const
|
|
|
|
{
|
|
|
|
return nmDataModelType::sTypeNumDataExample;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString nmDataExample::getTableName()
|
|
|
|
{
|
|
|
|
// 返回表名,模型自行处理
|
|
|
|
return nmDataTableName::sTableNumDataExample;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool nmDataExample::_parseData(VecVariant vec, int& n)
|
|
|
|
{
|
|
|
|
m_sCode = vec.at(n++).toString();
|
|
|
|
// m_sWellCode = vec.at(n++).toString();
|
|
|
|
m_sName = vec.at(n++).toString();
|
|
|
|
// m_dTopDepth = vec.at(n++).toDouble();
|
|
|
|
// m_dBottomDepth = vec.at(n++).toDouble();
|
|
|
|
return ZxDataObjectDbl::_parseData(vec, n);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool nmDataExample::_sumUpData(VecVariant& vec)
|
|
|
|
{
|
|
|
|
ensureLoaded();
|
|
|
|
vec.append(m_sCode);
|
|
|
|
// vec.append(m_sWellCode);
|
|
|
|
vec.append(m_sName);
|
|
|
|
// vec.append(m_dTopDepth);
|
|
|
|
// vec.append(m_dBottomDepth);
|
|
|
|
return ZxDataObjectDbl::_sumUpData(vec);
|
|
|
|
}
|
|
|
|
|
|
|
|
void nmDataExample::onSerialize(ZxSerializer* ser)
|
|
|
|
{
|
|
|
|
ZxDataObjectDbl::onSerialize(ser);
|
|
|
|
// ser->write("WellCode", m_sWellCode);
|
|
|
|
// ser->write("TopDepth", m_dTopDepth);
|
|
|
|
// ser->write("BottomDepth", m_dBottomDepth);
|
|
|
|
}
|
|
|
|
|
|
|
|
void nmDataExample::onDeserialize(ZxSerializer* ser)
|
|
|
|
{
|
|
|
|
ZxDataObjectDbl::onDeserialize(ser);
|
|
|
|
// ser->read("WellCode", m_sWellCode);
|
|
|
|
// ser->read("TopDepth", m_dTopDepth);
|
|
|
|
// ser->read("BottomDepth", m_dBottomDepth);
|
|
|
|
}
|
|
|
|
|
|
|
|
QIcon nmDataExample::getIcon(bool expanded) const
|
|
|
|
{
|
|
|
|
return zxLoadIcon("DataExample");
|
|
|
|
}
|