Commit eb7a6b12 authored by 刘乐's avatar 刘乐

1,

parent 6d82f512
......@@ -10,6 +10,13 @@ void CivConHydrTest::test(char* uri)
std::cout << "测试结果:" << succ << std::endl;
}
// 模型维护
void CivModelHydrTest::test(char* uri)
{
int succ = modelMatation(uri);
std::cout << "测试结果:" << succ << std::endl;
}
// 水质测试
void CivConQuaTest::test(char* uri)
{
......
......@@ -7,6 +7,13 @@ public:
virtual void test(char* uri) = 0;
};
// 模型监测和维护
class CivModelHydrTest :public CivHydrTest
{
public:
virtual void test(char* uri);
};
// 水力测试
class CivConHydrTest :public CivHydrTest
{
......
......@@ -23,10 +23,13 @@ int main(int argc, char* argv[])
/*CivTestContext context(new CivConQuaTest());
context.contextTest(findUri);*/
// 测试追踪分析
CivTestContext context(new CivConTrackTest());
CivTestContext context(new CivModelHydrTest());
context.contextTest(findUri);
// 测试追踪分析
/*CivTestContext context(new CivConTrackTest());
context.contextTest(findUri);*/
// 测试根据时段获取值
/*CivTestContext context(new CivConGetDataTest());
context.contextTest(findUri);*/
......
......@@ -31,6 +31,16 @@ bool FUNEXPORT getDataByInterval(char* uri, char* date, char* interval)
return true;
}
bool FUNEXPORT modelMatation(char* uri)
{
// 创建数据库连接
CivDbConn* pgConn = new CivPgConn(uri);
pgConn->checkHyDrNetTable();
delete pgConn;
return true;
}
bool FUNEXPORT hdyrSimulation(char* uri)
{
// 创建数据库连接
......
......@@ -7,6 +7,8 @@
extern "C" {
#endif
bool FUNEXPORT modelMatation(char* uri);
/**
*@brief 上游追踪
*@param uri 数据库连接地址
......
......@@ -982,5 +982,50 @@ void CivPgConn::checkHyDrNetTable()
{
createTable(pipeTemp);
}
// 方案电表
CivProjNodeTableTemp projeNodeTemp;
if (!tableExist(projeNodeTemp.name()))
{
createTable(projeNodeTemp);
}
//方案线表
CivProjPipeTableTemp projPipeTemp;
if (!tableExist(projPipeTemp.name()))
{
createTable(projPipeTemp);
}
// 方案表
CivProjTableTemp projTemp;
if (!tableExist(projTemp.name()))
{
createTable(projTemp);
}
// 监测点压力
CivMonitorPressureTableTemp pressureTemp;
if (!tableExist(pressureTemp.name()))
{
createTable(pressureTemp);
}
// 监测点流量
CivMonitorFlowTableTemp flowTemp;
if (!tableExist(flowTemp.name()))
{
createTable(flowTemp);
}
// 监测点水质表
CivMonitorQualityTableTemp qualityTemp;
if (!tableExist(qualityTemp.name()))
{
createTable(qualityTemp);
}
}
......@@ -35,20 +35,20 @@ Str CivTableTemp::createSql()
if (mPropertys.size() <= 0)
return Str();
char sql[512] = "create table ";
std::string sql = "create table ";
sql.append(mTableName);
sql.append("(id serial primary key");
strcat_s(sql, mTableName.c_str());
strcat_s(sql, "(id serial primary key");
size_t total = mPropertys.size();
for (int i = 0; i < total; i++)
{
FieldProperty property = mPropertys[i];
strcat_s(sql, ",");
strcat_s(sql, property.mFiledName.c_str());
strcat_s(sql, " ");
strcat_s(sql, property.mFieldType.c_str());
sql.append(",");
sql.append("\""+property.mFiledName+"\"");
sql.append(" ");
sql.append(property.mFieldType);
}
strcat_s(sql, ")");
sql.append(")");
return sql;
}
......
......@@ -35,8 +35,8 @@ typedef const std::string& StrQuote;
监测点表系列
*/
#define PRESSURETABLE Str("__monitor_pressure__")
#define FLOWTABLE Str("__monitor_flow __")
#define QUALITYTABLE Str("__monitor_quality __")
#define FLOWTABLE Str("__monitor_flow__")
#define QUALITYTABLE Str("__monitor_quality__")
#define PRV_TYPE Str("稳压阀")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment