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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
42 deletions
+45
-42
main.cpp
funcDemo/main.cpp
+4
-4
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+0
-2
CivHydrCalc.h
pandaAnalysis/CivHydrCalc.h
+0
-0
CivNewInp.h
pandaAnalysis/CivNewInp.h
+4
-3
CivPgConn.cpp
pandaDbManager/CivPgConn.cpp
+6
-8
CivTableTemp.cpp
pandaDbManager/CivTableTemp.cpp
+9
-12
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[])
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"
;
/*
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
;
...
...
pandaAnalysis/CivHydrCalc.cpp
View file @
06584466
...
...
@@ -659,8 +659,6 @@ 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
;
...
...
pandaAnalysis/CivHydrCalc.h
View file @
06584466
pandaAnalysis/CivNewInp.h
View file @
06584466
...
...
@@ -39,13 +39,14 @@ public:
void
setSources
(
const
CivSources
&
sources
);
void
setMixing
(
const
CivMixing
&
mixing
);
// 选项和报表
/*void setReactions();
// 选项和报表 ,统一读取参数表
/*
void setReactions();
void setOptions();
void setTimes();
void setReport();
void setEnergy();
*/
*/
void
setParamter
(
const
CivParameter
&
params
,
const
std
::
string
&
type
);
...
...
pandaDbManager/CivPgConn.cpp
View file @
06584466
...
...
@@ -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
.
model
Name
.
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
);
...
...
pandaDbManager/CivTableTemp.cpp
View file @
06584466
...
...
@@ -6,9 +6,10 @@ 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_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
()
{
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
);
}
pandaDbManager/CivTableTemp.h
View file @
06584466
...
...
@@ -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
();
};
...
...
建模文档/水力模型产品规划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