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

115 lines
3.2 KiB
C++

#include "nmDataOilReservoirOutline.h"
#include "nmDefines.h"
#include "nmDataOilReservoirOutlineLineSegment.h"
#include "nmDataUtils.h"
ZX_DEFINE_DYNAMIC(DataOilReservoirOutline, nmDataOilReservoirOutline)
nmDataOilReservoirOutline::nmDataOilReservoirOutline(): ZxDataObjectDbl(0)
{
//m_sID = "";
// m_sWellCode = "";
//m_sName = "";
// m_dTopDepth = 0.00;
// m_dBottomDepth = 0.00;
m_sRemark = "";
m_sCth = "nmDORO";
checkXmlTable();
}
nmDataOilReservoirOutline::nmDataOilReservoirOutline(const nmDataOilReservoirOutline &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;
m_pointList = other.m_pointList;
m_lineSegmentList = other.m_lineSegmentList;
}
nmDataOilReservoirOutline::~nmDataOilReservoirOutline()
{
}
nmDataOilReservoirOutline &nmDataOilReservoirOutline::operator = (const nmDataOilReservoirOutline &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;
m_pointList = other.m_pointList;
m_lineSegmentList = other.m_lineSegmentList;
return *this;
}
ZxDataObject* nmDataOilReservoirOutline::clone()
{
ensureLoaded();
return (new nmDataOilReservoirOutline(*this));
}
QString nmDataOilReservoirOutline::type() const
{
return nmDataModelType::sTypeNumDataOilReservoirOutline;
}
QString nmDataOilReservoirOutline::getTableName()
{
// 返回表名,模型自行处理
return nmDataTableName::sTableNumDataOilReservoirOutline;
}
bool nmDataOilReservoirOutline::_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();
// 解析点数据
QByteArray pointsByteArray = vec.at(n++).toByteArray();
nmDataUtils::convertBa2VP(pointsByteArray, m_pointList);
return ZxDataObjectDbl::_parseData(vec, n);
}
bool nmDataOilReservoirOutline::_sumUpData(VecVariant& vec)
{
ensureLoaded();
vec.append(m_sCode);
// vec.append(m_sWellCode);
vec.append(m_sName);
// vec.append(m_dTopDepth);
// vec.append(m_dBottomDepth);
// 保存点信息
QByteArray pointsByteArray;
nmDataUtils::convertVP2Ba(m_pointList, pointsByteArray);
vec.append(pointsByteArray);
return ZxDataObjectDbl::_sumUpData(vec);
}
void nmDataOilReservoirOutline::onSerialize(ZxSerializer* ser)
{
ZxDataObjectDbl::onSerialize(ser);
// ser->write("WellCode", m_sWellCode);
// ser->write("TopDepth", m_dTopDepth);
// ser->write("BottomDepth", m_dBottomDepth);
}
void nmDataOilReservoirOutline::onDeserialize(ZxSerializer* ser)
{
ZxDataObjectDbl::onDeserialize(ser);
// ser->read("WellCode", m_sWellCode);
// ser->read("TopDepth", m_dTopDepth);
// ser->read("BottomDepth", m_dBottomDepth);
}
QIcon nmDataOilReservoirOutline::getIcon(bool expanded) const
{
return zxLoadIcon("DataOilReservoirOutline");
}