Commit 06584466 authored by 刘乐's avatar 刘乐

1,水力模型更改

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