1、设置数据表名;

feature/ribbon-menu-20240927
simonyan 1 month ago
parent cd93b785e1
commit a02ea2641e

@ -36,6 +36,8 @@ public:
// 接口
virtual ZxDataObject* clone();
virtual QString type() const;
// 表名
virtual QString getTableName();
// 加载保存(数据库部分)
virtual bool _parseData(VecVariant vec, int& n);

@ -19,7 +19,8 @@ public:
// 接口
virtual ZxDataObject* clone();
virtual QString type() const;
// 表名
virtual QString getTableName();
// 加载保存(数据库部分)
virtual bool _parseData(VecVariant vec, int& n);
virtual bool _sumUpData(VecVariant& vec);

@ -42,3 +42,11 @@ namespace nmDataModelType
const QString sTypeNumDataOilReservoirOutline = "zx_NumDataOilReservoirOutline";
const QString sTypeNumDataExample = "zx_NumDataExample";
}
namespace nmDataTableName
{
// 数据模型类型定义
const QString sTableNumDataDemo = "N_DATA_OIL_DEMO";
const QString sTableNumDataOilReservoirOutline = "N_DATA_OIL_RESERVOIR_OUTLINE";
const QString sTableNumDataExample = "N_DATA_OIL_EXAMPLE";
}

@ -51,9 +51,16 @@ ZxDataObject* nmDataDemo::clone()
QString nmDataDemo::type() const
{
// 模块自行处理及定义,框架部分不再涉及
return nmDataModelType::sTypeNumDataDemo;
}
QString nmDataDemo::getTableName()
{
// 返回表名,模型自行处理
return nmDataTableName::sTableNumDataDemo;
}
void nmDataDemo::setWellCode(const QString& s)
{
m_sWellCode = s;

@ -1,7 +1,7 @@
#include "nmDataExample.h"
#include "nmDefines.h"
ZX_DEFINE_DYNAMIC(DataOilReservoirOutline, nmDataExample)
ZX_DEFINE_DYNAMIC(DataExample, nmDataExample)
nmDataExample::nmDataExample(): ZxDataObjectDbl(0)
{
@ -51,7 +51,13 @@ ZxDataObject* nmDataExample::clone()
QString nmDataExample::type() const
{
return nmDataModelType::sTypeNumDataOilExample;
return nmDataModelType::sTypeNumDataExample;
}
QString nmDataExample::getTableName()
{
// 返回表名,模型自行处理
return nmDataTableName::sTableNumDataExample;
}
bool nmDataExample::_parseData(VecVariant vec, int& n)

@ -53,7 +53,11 @@ 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();

Loading…
Cancel
Save