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
6e13faf4
Commit
6e13faf4
authored
Jul 17, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
水力模型文档更新,数据库连接修复
parent
b5aaae5e
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
37 additions
and
24 deletions
+37
-24
CivHydrTest.cpp
funcDemo/CivHydrTest.cpp
+1
-1
CivGraph.h
pandaAlgorithm/CivGraph.h
+1
-1
CivBuilder.cpp
pandaAnalysis/CivBuilder.cpp
+2
-2
CivHydrFuncInter.cpp
pandaAnalysis/CivHydrFuncInter.cpp
+1
-0
CivHydrSimulation.cpp
pandaAnalysis/CivHydrSimulation.cpp
+13
-2
CivHydrSimulation.h
pandaAnalysis/CivHydrSimulation.h
+3
-1
CivDbConn.cpp
pandaDbManager/CivDbConn.cpp
+1
-0
CivPgConn.cpp
pandaDbManager/CivPgConn.cpp
+15
-17
建模文档.zip
建模文档.zip
+0
-0
水力模型产品研发计划.xlsx
建模文档/水力模型产品研发计划.xlsx
+0
-0
水力模型产品规划V1.0-UPDATE.xmind
建模文档/水力模型产品规划V1.0-UPDATE.xmind
+0
-0
No files found.
funcDemo/CivHydrTest.cpp
View file @
6e13faf4
...
...
@@ -36,7 +36,7 @@ void CivConTrackTest::test(char* uri)
*/
void
CivConGetDataTest
::
test
(
char
*
uri
)
{
const
char
*
date
=
"2020-07-1
3
"
;
const
char
*
date
=
"2020-07-1
7
"
;
char
*
dates
=
const_cast
<
char
*>
(
date
);
const
char
*
interval
=
"4"
;
...
...
pandaAlgorithm/CivGraph.h
View file @
6e13faf4
#pragma once
/*
/*
*
ͼ
*/
template
<
class
Item
>
...
...
pandaAnalysis/CivBuilder.cpp
View file @
6e13faf4
...
...
@@ -238,11 +238,11 @@ void CivInpBuilder::buildCurves()
{
ASSERT
(
mDbConn
,
mNewInp
)
CivCurves
curves
;
/*
CivCurves curves;
if (!mDbConn->getCurves(curves))
return;
mNewInp
->
setCurves
(
curves
);
mNewInp->setCurves(curves);
*/
}
void
CivInpBuilder
::
buildStatus
()
...
...
pandaAnalysis/CivHydrFuncInter.cpp
View file @
6e13faf4
...
...
@@ -57,6 +57,7 @@ bool DLLEXPORT getDataByInterval(char* uri, char* date, char* interval)
delete
dbConn
;
return
false
;
}
delete
dbConn
;
return
true
;
}
...
...
pandaAnalysis/CivHydrSimulation.cpp
View file @
6e13faf4
...
...
@@ -269,6 +269,7 @@ bool CivHydrSimulation::qualitySimulation()
bool
CivHydrSimulation
::
trackingSimulation
(
char
*
snNode
,
int
hour
)
{
CivSysLog
::
getInstance
()
->
error
(
"开始水质分析计算"
,
"qualitySimulation"
,
__FUNCTION__
);
setQualityAnalyType
(
ANALYSIS_TRACE
);
if
(
!
convertInp
(
ANALYSIS_TRACE
,
snNode
))
{
CivSysLog
::
getInstance
()
->
error
(
"写入inp文件失败"
,
"qualitySimulation"
,
__FUNCTION__
);
...
...
@@ -605,10 +606,15 @@ void CivHydrSimulation::getNodeQuality(short time)
// 编号
ENgetnodeid
(
i
,
No
);
float
*
quality
=
(
float
*
)
malloc
(
sizeof
(
float
));
// 水质
ENgetnodevalue
(
i
,
EN_QUALITY
,
quality
);
mResultCache
.
addNodeQuality
(
*
quality
,
time
,
No
);
int
trueQuality
=
*
quality
;
if
(
mQuaLityType
==
ANALYSIS_TRACE
)
trueQuality
*=
100
;
mResultCache
.
addNodeQuality
(
trueQuality
,
time
,
No
);
free
(
quality
);
}
}
...
...
@@ -633,7 +639,12 @@ void CivHydrSimulation::getLinkQuality(short time)
// 水质
ENgetlinkvalue
(
i
,
EN_LINKQUAL
,
quality
);
mResultCache
.
addLinkQuality
(
*
quality
,
time
,
lnkNo
);
int
trueQuality
=
*
quality
;
if
(
mQuaLityType
==
ANALYSIS_TRACE
)
trueQuality
*=
100
;
mResultCache
.
addLinkQuality
(
trueQuality
,
time
,
lnkNo
);
}
free
(
typeCode
);
free
(
quality
);
...
...
pandaAnalysis/CivHydrSimulation.h
View file @
6e13faf4
...
...
@@ -74,6 +74,8 @@ public:
*/
bool
brushingResult
();
void
setQualityAnalyType
(
QualityAnalyType
analyType
)
{
mQuaLityType
=
analyType
;
}
/*
inp文件名,输出文件名,二进制文件名设置和获取
*/
...
...
@@ -98,7 +100,7 @@ private:
private
:
CivDbConn
*
mDbConn
;
CivSimulResultCache
mResultCache
;
// 存储模拟结果缓存类
QualityAnalyType
mQuaLityType
=
ANALYSIS_RESERVE
;
std
::
string
mInpFile
;
// inp文件名
std
::
string
mRptFile
;
// 报告文件名
std
::
string
mBinFile
;
// 二进制文件名
...
...
pandaDbManager/CivDbConn.cpp
View file @
6e13faf4
...
...
@@ -4,6 +4,7 @@
CivDbConn
::
CivDbConn
()
{
mIsOpen
=
false
;
}
CivDbConn
::~
CivDbConn
()
...
...
pandaDbManager/CivPgConn.cpp
View file @
6e13faf4
...
...
@@ -14,7 +14,7 @@ CivPgConn::CivPgConn(char* uri)
CivPgConn
::~
CivPgConn
()
{
if
(
mConn
!=
NULL
)
if
(
mConn
!=
nullptr
)
{
PQfinish
(
mConn
);
}
...
...
@@ -22,9 +22,6 @@ CivPgConn::~CivPgConn()
bool
CivPgConn
::
deleteByField
(
StrQuote
table
,
StrQuote
filedName
,
StrQuote
fieldValue
)
{
if
(
!
isValid
())
return
false
;
char
delSql
[
256
]
=
"delete from public.
\"
"
;
strcat_s
(
delSql
,
table
.
c_str
());
strcat_s
(
delSql
,
"
\"
where "
);
...
...
@@ -47,9 +44,6 @@ bool CivPgConn::deleteByField(StrQuote table, StrQuote filedName, StrQuote field
bool
CivPgConn
::
updateNodeByInterval
(
StrQuote
currDate
,
StrQuote
interval
)
{
if
(
!
isValid
())
return
false
;
std
::
stringstream
os
;
NodeFieldName
filedNames
;
...
...
@@ -57,11 +51,14 @@ bool CivPgConn::updateNodeByInterval(StrQuote currDate, StrQuote interval)
<<
PIPENODE
<<
" AS tb1 set ("
<<
"总水头"
<<
","
<<
"压力"
<<
","
<<
"实际需水量"
<<
"实际需水量"
<<
","
<<
"水质"
<<
")=( "
<<
"tb2."
<<
filedNames
.
dHead
<<
","
<<
"tb2."
<<
filedNames
.
dPressure
<<
","
<<
"tb2."
<<
filedNames
.
dDemand
<<
")"
<<
" from "
<<
"tb2."
<<
filedNames
.
dDemand
<<
","
<<
"tb2."
<<
filedNames
.
dQuality
<<
")"
<<
" from "
<<
NODERESULTTABLE
<<
" AS tb2 where tb1."
<<
filedNames
.
Number
<<
"= tb2."
<<
filedNames
.
Number
<<
" AND tb2."
...
...
@@ -84,9 +81,6 @@ bool CivPgConn::updateNodeByInterval(StrQuote currDate, StrQuote interval)
bool
CivPgConn
::
updateLinkByInterval
(
StrQuote
currDate
,
StrQuote
interval
)
{
if
(
!
isValid
())
return
false
;
std
::
stringstream
os
;
LinkFiledName
filedNames
;
...
...
@@ -99,7 +93,8 @@ bool CivPgConn::updateLinkByInterval(StrQuote currDate, StrQuote interval)
<<
"摩擦水头损"
<<
","
<<
"上点水头"
<<
","
<<
"本点水头"
<<
","
<<
"局部水头损"
<<
"局部水头损"
<<
","
<<
"水质"
<<
")=( "
<<
"tb2."
<<
filedNames
.
dFlow
<<
","
<<
"tb2."
<<
filedNames
.
dVelocity
<<
","
...
...
@@ -108,7 +103,9 @@ bool CivPgConn::updateLinkByInterval(StrQuote currDate, StrQuote interval)
<<
"tb2."
<<
filedNames
.
dFrictionHeadloss
<<
","
<<
"tb2."
<<
filedNames
.
dFromNodHeadloss
<<
","
<<
"tb2."
<<
filedNames
.
dToNodHeadloss
<<
","
<<
"tb2."
<<
filedNames
.
dLocalHeadloss
<<
")"
<<
" from "
<<
"tb2."
<<
filedNames
.
dLocalHeadloss
<<
","
<<
" tb2."
<<
filedNames
.
dQuality
<<
")"
<<
" from "
<<
PIPERESULTTABLE
<<
" AS tb2 where tb1."
<<
filedNames
.
szNo
<<
"= tb2."
<<
filedNames
.
szNo
<<
" AND tb2."
...
...
@@ -324,8 +321,8 @@ bool CivPgConn::execSql(StrQuote sql)
if
(
sql
.
empty
())
return
false
;
if
(
!
open
())
return
false
;
if
(
!
isValid
())
open
()
;
mResult
=
PQexec
(
mConn
,
sql
.
c_str
());
char
*
error
=
PQresultErrorMessage
(
mResult
);
...
...
@@ -483,6 +480,7 @@ bool CivPgConn::getTank(CivTank& tank)
bool
CivPgConn
::
getValve
(
CivValve
&
valve
)
{
CivValveTableTemp
::
ValveTable
vaveTable
;
//;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
...
...
@@ -532,6 +530,7 @@ bool CivPgConn::getValve(CivValve& valve)
bool
CivPgConn
::
getPumps
(
CivPumps
&
pump
)
{
CivPumpTableTemp
::
PumpTable
pmTable
;
//;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
...
...
@@ -946,7 +945,6 @@ bool CivPgConn::getValuesFromTableByCondition(
void
CivPgConn
::
checkHyDrNetTable
()
{
// 创建曲线表
CivCurveTableTemp
temp
;
if
(
!
tableExist
(
temp
.
name
()))
...
...
建模文档.zip
deleted
100644 → 0
View file @
b5aaae5e
File deleted
建模文档/水力模型产品研发计划.xlsx
View file @
6e13faf4
No preview for this file type
建模文档/水力模型产品规划V1.0-UPDATE.xmind
View file @
6e13faf4
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