Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hydraulicModel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘乐
hydraulicModel
Commits
06584466
Commit
06584466
authored
Jul 06, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,水力模型更改
parent
e95c0cca
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
51 deletions
+54
-51
main.cpp
funcDemo/main.cpp
+5
-5
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+1
-3
CivHydrCalc.h
pandaAnalysis/CivHydrCalc.h
+1
-1
CivNewInp.h
pandaAnalysis/CivNewInp.h
+8
-7
CivPgConn.cpp
pandaDbManager/CivPgConn.cpp
+6
-8
CivTableTemp.cpp
pandaDbManager/CivTableTemp.cpp
+11
-14
CivTableTemp.h
pandaDbManager/CivTableTemp.h
+22
-13
水力模型产品规划V1.0.xmind
建模文档/水力模型产品规划V1.0.xmind
+0
-0
No files found.
funcDemo/main.cpp
View file @
06584466
...
@@ -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
;
...
...
pandaAnalysis/CivHydrCalc.cpp
View file @
06584466
...
@@ -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
;
// 放到缓存类中
// 放到缓存类中
...
...
pandaAnalysis/CivHydrCalc.h
View file @
06584466
...
@@ -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
;
/**
/**
...
...
pandaAnalysis/CivNewInp.h
View file @
06584466
...
@@ -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
);
...
...
pandaDbManager/CivPgConn.cpp
View file @
06584466
...
@@ -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
.
model
Name
.
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
);
...
...
pandaDbManager/CivTableTemp.cpp
View file @
06584466
...
@@ -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
);
}
}
pandaDbManager/CivTableTemp.h
View file @
06584466
...
@@ -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
();
};
};
...
...
建模文档/水力模型产品规划V1.0.xmind
View file @
06584466
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment