Commit 06584466 authored by 刘乐's avatar 刘乐

1,水力模型更改

parent e95c0cca
......@@ -23,16 +23,16 @@ int main(int argc, char* argv[])
strcpy_s(net, "水力模型管网");
strcpy_s(flag, "QUALITY");
/* bool msg = simulation(findUri, net, flag);
std::cout << msg << std::endl;*/
bool msg = simulation(findUri, net, flag);
std::cout << msg << std::endl;
const char* date = "2020-07-02";
char* dates = const_cast<char*>(date);
/*const char* date = "2020-07-02";
char* dates = const_cast<char*>(date);
const char* interval = "4";
char* intervals = const_cast<char*>(interval);
bool isSucces = getDataByInterval(findUri, dates, intervals);
std::cout << isSucces << std::endl;
std::cout << isSucces << std::endl;*/
getchar();
return 0;
......
......@@ -659,9 +659,7 @@ void CivHydrCalc::getNodeResult(short time)
ENgetnodevalue(i, EN_MAXVOLUME, &nodeItem.dTankMaxVolume);
// 液位高度
ENgetnodevalue(i, EN_TANKLEVEL, &nodeItem.dTankLevel);
//// 水质
//ENgetnodevalue(i, EN_QUALITY, &nodeItem.dQuality);
nodeItem.dInterval = time;
// 放到缓存类中
......
......@@ -5,7 +5,7 @@
#include "CivSysLog.h"
#include "CivSimulResultCache.h"
class CivDbConnection;
class CivDbConnection;
class CivDbConn;
/**
......
......@@ -39,13 +39,14 @@ public:
void setSources(const CivSources& sources);
void setMixing(const CivMixing& mixing);
// 选项和报表
/*void setReactions();
void setOptions();
void setTimes();
void setReport();
void setEnergy();
*/
// 选项和报表 ,统一读取参数表
/*
void setReactions();
void setOptions();
void setTimes();
void setReport();
void setEnergy();
*/
void setParamter(const CivParameter& params, const std::string& type);
......
......@@ -404,13 +404,11 @@ bool CivPgConn::getPatterns(CivPatterns& patterns)
CivPatternTableTemp::PatternTable patternTable;
char sql[512] = "select ";
strcat_s(sql, patternTable.Name.c_str());
strcat_s(sql, patternTable.modelName.c_str());
strcat_s(sql, ",");
strcat_s(sql, patternTable.time.c_str());
strcat_s(sql, patternTable.modelData.c_str());
strcat_s(sql, ",");
strcat_s(sql, patternTable.Value.c_str());
strcat_s(sql, ",");
strcat_s(sql, patternTable.type.c_str());
strcat_s(sql, patternTable.modelType.c_str());
strcat_s(sql, " from public.\"__pattern__\"");
std::string utf8Sql = TransUTFCoding(sql);
......@@ -457,11 +455,11 @@ bool CivPgConn::getCurves(CivCurves& curves)
CivCurveTableTemp::CurveTable curveTable;
char sql[512] = "select ";
strcat_s(sql, curveTable.Label.c_str());
strcat_s(sql, curveTable.CurveName.c_str());
strcat_s(sql, ",");
strcat_s(sql, curveTable.XCoord.c_str());
strcat_s(sql, curveTable.CurveType.c_str());
strcat_s(sql, ",");
strcat_s(sql, curveTable.YCoord.c_str());
strcat_s(sql, curveTable.CurveData.c_str());
strcat_s(sql, " from public.\"__curve__\"");
std::string utf8Sql = TransUTFCoding(sql);
......
......@@ -6,10 +6,11 @@ CivTableTemp::CivTableTemp()
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_INT, "int"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_INTEGER,"integer"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_DOUBLE, "double precision"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_VARCHAR, "varchar(20)"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_VARCHAR, "varchar(32)"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_VARCHAR64, "varchar(64)"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_VARCHAR128, "varchar(20)"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_DATETIME, "timestamp"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_VARCHAR128, "varchar(128)"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_VARCHAR256,"varchar(256)"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_DATETIME, "timestamp"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_JSON, "json"));
mFieldTyepMap.insert(std::pair<FieldType, std::string>(CivTableTemp::FILED_DATE, "date"));
}
......@@ -313,19 +314,17 @@ CivPatternTableTemp::CivPatternTableTemp() :CivTableTemp()
setName(PATTERNTABLE);
TableField fileds;
addProperty(fileds.Name, CivTableTemp::FILED_VARCHAR);
addProperty(fileds.Value, CivTableTemp::FILED_VARCHAR64);
addProperty(fileds.modelName, CivTableTemp::FILED_VARCHAR);
addProperty(fileds.modelData, CivTableTemp::FILED_VARCHAR64);
addProperty(fileds.modelType, CivTableTemp::FILED_INTEGER);
}
/**
参数表
*/
CivParametorTableTemp::CivParametorTableTemp() :CivTableTemp()
CivParametorTableTemp::CivParametorTableTemp() :CivTableTemp()
{
setName(OPTIONTTABLE);
TableField fileds;
addProperty(fileds.name, CivTableTemp::FILED_VARCHAR);
addProperty(fileds.val, CivTableTemp::FILED_VARCHAR);
......@@ -339,10 +338,8 @@ CivParametorTableTemp::CivParametorTableTemp() :CivTableTemp()
CivCurveTableTemp::CivCurveTableTemp() :CivTableTemp()
{
setName(CURVETABLE);
TableField fileds;
addProperty(fileds.Label, CivTableTemp::FILED_VARCHAR);
addProperty(fileds.Type, CivTableTemp::FILED_VARCHAR);
addProperty(fileds.XCoord, CivTableTemp::FILED_DOUBLE);
addProperty(fileds.YCoord, CivTableTemp::FILED_DOUBLE);
addProperty(fileds.CurveName, CivTableTemp::FILED_VARCHAR64);
addProperty(fileds.CurveType, CivTableTemp::FILED_INTEGER);
addProperty(fileds.CurveData, CivTableTemp::FILED_VARCHAR256);
}
......@@ -29,6 +29,7 @@ public:
FILED_VARCHAR,
FILED_VARCHAR64,
FILED_VARCHAR128,
FILED_VARCHAR256,
FILED_DATETIME,
FILED_JSON,
FILED_DATE
......@@ -257,7 +258,6 @@ public:
class CivValveTableTemp :public CivTableTemp
{
public:
typedef struct TableFileds
{
Str id = "本点号";
......@@ -291,7 +291,6 @@ public:
class CivNodeResultTableTemp :public CivTableTemp
{
public:
typedef struct TableField
{
Str Number = "本点号";
......@@ -316,7 +315,6 @@ public:
class CivPipeResultTableTemp :public CivTableTemp
{
public:
typedef struct TableField
{
Str szNo = "编号";
......@@ -344,14 +342,18 @@ public:
class CivPatternTableTemp :public CivTableTemp
{
public:
typedef struct TableField
{
Str Name = "模式名";
Str Value = "系数";
Str time = "时段";
Str type = "类型";
Str modelName = "model_name";
Str modelType = "model_type";
Str modelData = "model_data";
} PatternTable;
enum PatternType
{
PATTERN_DEMAND,// 需水量模式
PATTERN_PRESS// 压力模式
};
explicit CivPatternTableTemp();
};
......@@ -361,7 +363,6 @@ public:
class CivParametorTableTemp :public CivTableTemp
{
public:
typedef struct TableField
{
Str name = "参数名";
......@@ -380,11 +381,19 @@ class CivCurveTableTemp :public CivTableTemp
public:
typedef struct TableField
{
Str Label = "曲线名";
Str XCoord = "x";
Str YCoord = "y";
Str Type = "类型";
Str CurveName = "curve_name";
Str CurveType = "curve_type";
Str CurveData = "curve_data";
}CurveTable;
// 曲线类型
enum CurveType
{
CURVE_ELEV,// 水泵扬程与流量
CURVE_EFFIC,//水泵效率与流量
CURVE_VOLUME,// 水池容积与水深
CURVE_HEADLOSS //常规阀门的水头损失与流量
};
explicit CivCurveTableTemp();
};
......
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