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
564481ba
Commit
564481ba
authored
Jun 08, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,建模文档
parent
bf0bd3c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
1 deletion
+51
-1
CivDbConnection.cpp
pandaDbManager/CivDbConnection.cpp
+44
-0
CivDbConnection.h
pandaDbManager/CivDbConnection.h
+7
-1
EPANET2_用户手册.pdf
建模文档/EPANET2_用户手册.pdf
+0
-0
水力模型产品规划V1.0.xmind
建模文档/水力模型产品规划V1.0.xmind
+0
-0
No files found.
pandaDbManager/CivDbConnection.cpp
View file @
564481ba
...
...
@@ -215,6 +215,50 @@ Componets CivDbConnection::getComponets(StrQuote tableName) const
return
nodes
;
}
Componets
CivDbConnection
::
getLikelyPipes
(
StrQuote
tableName
)
const
{
if
(
!
isValid
())
return
Nodes
();
// 查询点数据
std
::
string
sql
=
"select * from public.
\"
"
+
tableName
+
"
\"
"
;
PGresult
*
result
=
PQexec
(
mConn
,
sql
.
c_str
());
if
(
result
==
NULL
)
{
return
Nodes
();
}
// rows count
Componets
nodes
;
std
::
vector
<
std
::
string
>
codes
;
int
rows
=
PQntuples
(
result
);
int
columns
=
PQnfields
(
result
);
for
(
int
i
=
0
;
i
<
rows
;
i
++
)
{
Componet
node
;
for
(
int
j
=
0
;
j
<
columns
;
j
++
)
{
char
*
item
=
PQgetvalue
(
result
,
i
,
j
);
char
*
fieldName
=
PQfname
(
result
,
j
);
// 获取列表字段名
if
(
"code"
==
fieldName
)
{
codes
.
push_back
(
fieldName
);
}
std
::
string
itemStr
=
CivCommonUtils
::
UTF8_To_string
(
item
);
std
::
string
fieldStr
=
CivCommonUtils
::
UTF8_To_string
(
fieldName
);
node
.
insert
(
std
::
pair
<
std
::
string
,
std
::
string
>
(
fieldStr
,
itemStr
));
}
nodes
.
push_back
(
node
);
}
PQclear
(
result
);
std
::
string
sql2
=
"select * from public.
\"
管线
\"
"
;
return
nodes
;
}
bool
CivDbConnection
::
createTable
(
StrQuote
tableName
,
StrQuote
schema
)
{
return
true
;
...
...
pandaDbManager/CivDbConnection.h
View file @
564481ba
...
...
@@ -23,11 +23,17 @@ public:
Tables
getTables
(
StrQuote
netName
,
StrQuote
schema
=
"public"
)
const
;
/**
*@brief 获取管网组件数据:管线,节点,水源等(必须组件)
水泵,阀门(可选组件)
*@brief 获取管网组件数据:管线,节点,水源等(必须组件)
*@tableName: 组件表
*/
Componets
getComponets
(
StrQuote
tableName
)
const
;
/**
*@brief 水泵,阀门 (节点转换为管线)
*@tableName: 组件表
*/
Componets
getLikelyPipes
(
StrQuote
tableName
)
const
;
/**
*@brief 创建表格
*/
...
...
建模文档/EPANET2_用户手册.pdf
0 → 100644
View file @
564481ba
File added
建模文档/水力模型产品规划V1.0.xmind
0 → 100644
View file @
564481ba
File added
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