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
7eeb415e
Commit
7eeb415e
authored
Jun 15, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1, 模型改进
parent
49d41dc4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
20 deletions
+29
-20
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+10
-12
CivDbConnection.cpp
pandaDbManager/CivDbConnection.cpp
+0
-0
CivDbConnection.h
pandaDbManager/CivDbConnection.h
+14
-5
CivTableTemp.cpp
pandaDbManager/CivTableTemp.cpp
+2
-0
CivTypes.h
pandaDbManager/CivTypes.h
+3
-3
~$水力模型.docx
建模文档/~$水力模型.docx
+0
-0
水力模型.docx
建模文档/水力模型.docx
+0
-0
No files found.
pandaAnalysis/CivHydrCalc.cpp
View file @
7eeb415e
...
@@ -48,18 +48,20 @@ bool CivHydrCalc::hydrSimulation(char* fileName, char* rptFile, char* binOutFile
...
@@ -48,18 +48,20 @@ bool CivHydrCalc::hydrSimulation(char* fileName, char* rptFile, char* binOutFile
return
false
;
return
false
;
}
}
float
dHStep
;
ENGetVal
(
4
,
&
dHStep
);
// 计算
// 计算
do
do
{
{
int
nLinkCount
;
int
nLinkCount
;
ENgetcount
(
EN_LINKCOUNT
,
&
nLinkCount
);
ENgetcount
(
EN_LINKCOUNT
,
&
nLinkCount
);
for
(
int
i
=
1
;
i
<=
nLinkCount
;
i
++
)
/*
for (int i = 1; i <= nLinkCount; i++)
{
{
int linkType;
int linkType;
char id[128] = "";
char id[128] = "";
ENgetlinktype(i, &linkType);
ENgetlinktype(i, &linkType);
ENgetlinkid(i, id);
ENgetlinkid(i, id);
}
}
*/
if
(
ENrunH
(
&
t
)
>
100
)
// errcode > 100 是错误
if
(
ENrunH
(
&
t
)
>
100
)
// errcode > 100 是错误
{
{
...
@@ -67,15 +69,13 @@ bool CivHydrCalc::hydrSimulation(char* fileName, char* rptFile, char* binOutFile
...
@@ -67,15 +69,13 @@ bool CivHydrCalc::hydrSimulation(char* fileName, char* rptFile, char* binOutFile
return
false
;
return
false
;
}
}
ENnextH
(
&
tstep
);
ENnextH
(
&
tstep
);
iTime
++
;
// 获取当前节点和管段数据
// 获取当前节点和管段数据
getNodeResult
(
t
);
getNodeResult
(
iTime
);
getLinkResult
(
t
);
getLinkResult
(
iTime
);
iTime
++
;
}
while
(
tstep
>
0
);
}
while
(
tstep
>
0
);
// 获取计算结果
return
true
;
return
true
;
}
}
...
@@ -142,8 +142,6 @@ bool CivHydrCalc::exportInp(char* fileName)
...
@@ -142,8 +142,6 @@ bool CivHydrCalc::exportInp(char* fileName)
void
CivHydrCalc
::
assemble
(
const
std
::
string
&
table
,
CivInp
&
inp
)
void
CivHydrCalc
::
assemble
(
const
std
::
string
&
table
,
CivInp
&
inp
)
{
{
// 根据组建类型解析字段
// 根据组建类型解析字段
if
(
PIPELINE
==
table
)
if
(
PIPELINE
==
table
)
{
{
...
@@ -307,7 +305,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
...
@@ -307,7 +305,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
// 水池数据
// 水池数据
CivItem
tankNode
;
CivItem
tankNode
;
tankNode
.
push_back
(
"P"
+
id
);
tankNode
.
push_back
(
id
);
tankNode
.
push_back
(
node1
);
tankNode
.
push_back
(
node1
);
tankNode
.
push_back
(
node2
);
tankNode
.
push_back
(
node2
);
...
@@ -391,7 +389,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
...
@@ -391,7 +389,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
// 阀门数据
// 阀门数据
CivItem
vavleNode
;
CivItem
vavleNode
;
vavleNode
.
push_back
(
"V"
+
id
);
vavleNode
.
push_back
(
id
);
vavleNode
.
push_back
(
node1
);
vavleNode
.
push_back
(
node1
);
vavleNode
.
push_back
(
node2
);
vavleNode
.
push_back
(
node2
);
vavleNode
.
push_back
(
diametor
);
vavleNode
.
push_back
(
diametor
);
...
...
pandaDbManager/CivDbConnection.cpp
View file @
7eeb415e
This diff is collapsed.
Click to expand it.
pandaDbManager/CivDbConnection.h
View file @
7eeb415e
...
@@ -30,13 +30,13 @@ public:
...
@@ -30,13 +30,13 @@ public:
*@brief 获取管网的所有表
*@brief 获取管网的所有表
*@netName: 管网名
*@netName: 管网名
*/
*/
Tables
getTables
(
StrQuote
netName
,
StrQuote
schema
=
"public"
)
const
;
Tables
getTables
(
StrQuote
netName
,
StrQuote
schema
=
"public"
);
/**
/**
*@brief 获取管网组件数据:管线,节点,水源等(必须组件)
*@brief 获取管网组件数据:管线,节点,水源等(必须组件)
*@tableName: 组件表
*@tableName: 组件表
*/
*/
Componets
getComponets
(
StrQuote
tableName
)
const
;
Componets
getComponets
(
StrQuote
tableName
);
/**
/**
*@brief 水泵,阀门 (节点转换为管线)
*@brief 水泵,阀门 (节点转换为管线)
...
@@ -81,19 +81,28 @@ private:
...
@@ -81,19 +81,28 @@ private:
*@table: 线表
*@table: 线表
*@code:
*@code:
*/
*/
Componets
getLineByCode
(
StrQuote
table
,
StrQuote
code
)
const
;
Componets
getLineByCode
(
StrQuote
table
,
StrQuote
code
);
Componets
getNodeByCode
(
StrQuote
table
,
StrQuote
code
)
const
;
Componets
getNodeByCode
(
StrQuote
table
,
StrQuote
code
);
/**
*@brief 执行sql语句
*@sql: 需要执行的sql语句
*/
bool
execSql
(
std
::
string
sql
);
void
clearResult
();
/**
/**
*@brief 从查询集取出数据
*@brief 从查询集取出数据
*@result: 查询结果集
*@result: 查询结果集
*@comp: 数据容器
*@comp: 数据容器
*/
*/
void
getData
(
PGresult
*
result
,
Componets
&
comp
)
const
;
void
getData
(
PGresult
*
result
,
Componets
&
comp
);
private
:
private
:
PGconn
*
mConn
;
PGconn
*
mConn
;
PGresult
*
mResult
;
bool
mIsOpen
=
false
;
bool
mIsOpen
=
false
;
char
*
mUri
;
char
*
mUri
;
...
...
pandaDbManager/CivTableTemp.cpp
View file @
7eeb415e
#include "CivTableTemp.h"
#include "CivTableTemp.h"
#include <fstream>
CivTableTemp
::
CivTableTemp
(
std
::
string
tableName
)
CivTableTemp
::
CivTableTemp
(
std
::
string
tableName
)
:
mTableName
(
tableName
)
:
mTableName
(
tableName
)
...
@@ -32,6 +33,7 @@ std::string CivTableTemp::createSql()
...
@@ -32,6 +33,7 @@ std::string CivTableTemp::createSql()
if
(
mPropertys
.
size
()
<=
0
)
if
(
mPropertys
.
size
()
<=
0
)
return
""
;
return
""
;
char
sql
[
512
]
=
"create table "
;
char
sql
[
512
]
=
"create table "
;
strcat_s
(
sql
,
mTableName
.
c_str
());
strcat_s
(
sql
,
mTableName
.
c_str
());
strcat_s
(
sql
,
"(id serial primary key"
);
strcat_s
(
sql
,
"(id serial primary key"
);
...
...
pandaDbManager/CivTypes.h
View file @
7eeb415e
...
@@ -179,11 +179,11 @@ struct LinkFiledName
...
@@ -179,11 +179,11 @@ struct LinkFiledName
Str
nFlowDirect
=
"流向"
;
Str
nFlowDirect
=
"流向"
;
Str
dVelocity
=
"流速"
;
Str
dVelocity
=
"流速"
;
Str
dHeadloss
=
"水头损失"
;
Str
dHeadloss
=
"水头损失"
;
Str
dUnitHeadloss
=
"单位水头损
失
"
;
Str
dUnitHeadloss
=
"单位水头损"
;
Str
dFromNodHeadloss
=
"上点水头"
;
Str
dFromNodHeadloss
=
"上点水头"
;
Str
dToNodHeadloss
=
"本点水头"
;
Str
dToNodHeadloss
=
"本点水头"
;
Str
dLocalHeadloss
=
"局部水头损
失
"
;
Str
dLocalHeadloss
=
"局部水头损"
;
Str
dFrictionHeadloss
=
"摩擦水头损
失
"
;
Str
dFrictionHeadloss
=
"摩擦水头损"
;
Str
szStatus
=
"状态"
;
Str
szStatus
=
"状态"
;
Str
lTime
=
"时间"
;
Str
lTime
=
"时间"
;
};
};
...
...
建模文档/~$水力模型.docx
View file @
7eeb415e
No preview for this file type
建模文档/水力模型.docx
View file @
7eeb415e
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