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/Include/nmNum/nmData/nmDataDemo.h

77 lines
2.2 KiB
C

#pragma once
#include "ZxDataObjectDbl.h"
#include "nmData_global.h"
// 这是数值试井数据对象的例子
// 对应的表结构参见
/* <Node Alias="n数值样例数据表" Name="N_DATA_DEMO">
<FieldInfo Alias="序号" bKey="1" FieldName="ID"/>
<FieldInfo Alias="井号" FieldName="WellCode"/>
<FieldInfo Alias="储层名称" FieldName="LayerName"/>
<FieldInfo eDataType="2" Alias="储层顶深" FieldName="TopDepth" sUnit="m"/>
<FieldInfo eDataType="2" Alias="储层底深" FieldName="BottomDepth" sUnit="m"/>
<FieldInfo Alias="备注" FieldName="Remark"/>
<FieldInfo Alias="扩展字段1" eDataType="2" FieldName="Ext1" Visible="0"/>
<FieldInfo Alias="扩展字段2" eDataType="2" FieldName="Ext2" Visible="0"/>
<FieldInfo Alias="扩展字段3" eDataType="2" FieldName="Ext3" Visible="0"/>
<FieldInfo Alias="扩展字段4" eDataType="2" FieldName="Ext4" Visible="0"/>
<FieldInfo Alias="扩展字段5" eDataType="2" FieldName="Ext5" Visible="0"/>
</Node> */
class NM_DATA_EXPORT nmDataDemo : public ZxDataObjectDbl
{
ZX_DECLARE_DYNAMIC
public:
nmDataDemo();
nmDataDemo(const nmDataDemo &other);
virtual ~nmDataDemo();
nmDataDemo &operator = (const nmDataDemo &other);
public:
// 接口
virtual ZxDataObject* clone();
virtual QString type() const;
// 加载保存(数据库部分)
virtual bool _parseData(VecVariant vec, int& n);
virtual bool _sumUpData(VecVariant& vec);
// 序列化(统一序列化为大字段时的处理)
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
// Icon
virtual QIcon getIcon(bool expanded) const;
public:
// 对于参数的set和get处理主要是为了调用方便
void setWellCode(const QString& s);
QString getWellCode() const;
void setTopDepth(const double& d);
double getTopDepth() const;
void setBottomDepth(const double& d);
double getBottomDepth() const;
protected:
// 与数据库关联的数据,如果父类已经定义,则无需再次定义
//QString m_sID;
QString m_sWellCode;
//QString m_sName;
double m_dTopDepth;
double m_dBottomDepth;
};