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
7807280c
Commit
7807280c
authored
Jun 28, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1, 增加水质模拟
parent
7a2c9a7e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
24 deletions
+37
-24
epanet.c
EPNAET2/epanet.c
+12
-12
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+4
-2
CivHydrFuncInter.cpp
pandaAnalysis/CivHydrFuncInter.cpp
+3
-3
CivInpDirector.cpp
pandaAnalysis/CivInpDirector.cpp
+16
-0
CivDbConnection.cpp
pandaDbManager/CivDbConnection.cpp
+2
-7
No files found.
EPNAET2/epanet.c
View file @
7807280c
...
@@ -2892,18 +2892,18 @@ char* getTmpName(char* fname)
...
@@ -2892,18 +2892,18 @@ char* getTmpName(char* fname)
// --- if user supplied the name of a temporary directory,
// --- if user supplied the name of a temporary directory,
// then make it be the prefix of the full file name
// then make it be the prefix of the full file name
n
=
(
int
)
strlen
(
TmpDir
);
n
=
(
int
)
strlen
(
TmpDir
);
if
(
n
>
0
)
//
if ( n > 0 )
{
//
{
strcpy
(
fname
,
TmpDir
);
//
strcpy(fname, TmpDir);
if
(
fname
[
n
-
1
]
!=
'\\'
)
strcat
(
fname
,
"
\\
"
);
//
if ( fname[n-1] != '\\' ) strcat(fname, "\\");
}
//
}
// --- otherwise, use the relative path notation as the file name
//
//
--- otherwise, use the relative path notation as the file name
// prefix so that the file will be placed in the current directory
//
//
prefix so that the file will be placed in the current directory
else
//
else
{
//
{
strcpy
(
fname
,
".
\\
"
);
//
strcpy(fname, ".\\");
}
//
}
// --- now add the prefix to the file name
// --- now add the prefix to the file name
strcat
(
fname
,
name
);
strcat
(
fname
,
name
);
...
...
pandaAnalysis/CivHydrCalc.cpp
View file @
7807280c
...
@@ -121,7 +121,6 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
...
@@ -121,7 +121,6 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
return
false
;
return
false
;
}
}
// 根据类型 更改值
// 根据类型 更改值
errcode
=
ENinitH
(
EN_SAVE
);
errcode
=
ENinitH
(
EN_SAVE
);
if
(
errcode
>
0
)
if
(
errcode
>
0
)
...
@@ -192,7 +191,7 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
...
@@ -192,7 +191,7 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
ENclose
();
ENclose
();
// 更新数据
// 更新数据
if
(
mResultCache
.
updateToDb
(
mDbConn
))
if
(
!
mResultCache
.
updateToDb
(
mDbConn
))
return
false
;
return
false
;
...
@@ -214,6 +213,9 @@ bool CivHydrCalc::exportInp(char* fileName)
...
@@ -214,6 +213,9 @@ bool CivHydrCalc::exportInp(char* fileName)
bool
pattern
=
mDbConn
->
createTable
(
PATTERNTABLE
,
"public"
,
CivTableTemp
::
PATTERN_TABLE
);
bool
pattern
=
mDbConn
->
createTable
(
PATTERNTABLE
,
"public"
,
CivTableTemp
::
PATTERN_TABLE
);
bool
cii
=
mDbConn
->
createTable
(
OPTIONTTABLE
,
"public"
,
CivTableTemp
::
PARAMETER_TABLE
);
bool
cii
=
mDbConn
->
createTable
(
OPTIONTTABLE
,
"public"
,
CivTableTemp
::
PARAMETER_TABLE
);
bool
curve
=
mDbConn
->
createTable
(
CURVETABLE
,
"public"
,
CivTableTemp
::
CURVE_TABLE
);
bool
node
=
mDbConn
->
createTable
(
NODERESULTTABLE
,
"public"
,
CivTableTemp
::
NODE_TABLE
);
bool
link
=
mDbConn
->
createTable
(
PIPERESULTTABLE
,
"public"
,
CivTableTemp
::
PIPE_TABLE
);
// 获取表格
// 获取表格
Tables
tables
=
mDbConn
->
getTables
(
mNetname
);
Tables
tables
=
mDbConn
->
getTables
(
mNetname
);
...
...
pandaAnalysis/CivHydrFuncInter.cpp
View file @
7807280c
...
@@ -8,9 +8,9 @@ bool DLLEXPORT simulation(char* uri, char* netName, char* flag)
...
@@ -8,9 +8,9 @@ bool DLLEXPORT simulation(char* uri, char* netName, char* flag)
char
rptR
[
256
];
char
rptR
[
256
];
char
outBinFile
[
256
];
char
outBinFile
[
256
];
strcpy_s
(
fileName
,
"
E:
\\
work
\\
workspace
\\
hydraulicModelCode
\\
hydraulicModel
\\
funcDemo
\\
test.inp"
);
strcpy_s
(
fileName
,
"test.inp"
);
strcpy_s
(
rptR
,
"
E:
\\
work
\\
workspace
\\
hydraulicModelCode
\\
hydraulicModel
\\
funcDemo
\\
test.rpt"
);
strcpy_s
(
rptR
,
"test.rpt"
);
strcpy_s
(
outBinFile
,
"
E:
\\
work
\\
workspace
\\
hydraulicModelCode
\\
hydraulicModel
\\
funcDemo
\\
test.bin"
);
strcpy_s
(
outBinFile
,
"test.bin"
);
CivHydrCalc
*
calc
=
new
CivHydrCalc
(
uri
,
netName
);
CivHydrCalc
*
calc
=
new
CivHydrCalc
(
uri
,
netName
);
...
...
pandaAnalysis/CivInpDirector.cpp
View file @
7807280c
...
@@ -10,4 +10,19 @@ void CivInpDirector::create(CivBuilder* builder)
...
@@ -10,4 +10,19 @@ void CivInpDirector::create(CivBuilder* builder)
builder
->
buildPump
();
builder
->
buildPump
();
builder
->
buildVavle
();
builder
->
buildVavle
();
builder
->
buildEmitter
();
builder
->
buildEmitter
();
builder
->
buildPatterns
();
builder
->
buildParamter
();
builder
->
buildCoordnates
();
builder
->
buildVertices
();
builder
->
buildLabels
();
builder
->
buildTags
();
builder
->
buildBackDrop
();
builder
->
buildQuality
();
builder
->
buildSources
();
builder
->
buildMixing
();
builder
->
buildCurves
();
builder
->
buildStatus
();
builder
->
buildControls
();
builder
->
buildRules
();
builder
->
buildDemands
();
}
}
\ No newline at end of file
pandaDbManager/CivDbConnection.cpp
View file @
7807280c
...
@@ -109,8 +109,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
...
@@ -109,8 +109,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
std
::
stringstream
os
;
std
::
stringstream
os
;
NodeFieldName
filedNames
;
NodeFieldName
filedNames
;
if
(
createTable
(
NODERESULTTABLE
,
"public"
,
CivTableTemp
::
NODE_TABLE
))
{
os
<<
"INSERT INTO public."
<<
NODERESULTTABLE
<<
" ( "
;
os
<<
"INSERT INTO public."
<<
NODERESULTTABLE
<<
" ( "
;
os
<<
filedNames
.
Number
<<
","
;
os
<<
filedNames
.
Number
<<
","
;
os
<<
filedNames
.
dDemand
<<
","
;
os
<<
filedNames
.
dDemand
<<
","
;
...
@@ -164,7 +163,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
...
@@ -164,7 +163,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
os
.
str
(
""
);
os
.
str
(
""
);
if
(
!
execSql
(
sql
))
if
(
!
execSql
(
sql
))
return
false
;
return
false
;
}
return
true
;
return
true
;
}
}
...
@@ -177,8 +176,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
...
@@ -177,8 +176,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
std
::
stringstream
os
;
std
::
stringstream
os
;
LinkFiledName
filedNames
;
LinkFiledName
filedNames
;
std
::
string
currData
=
CurrentDate
;
std
::
string
currData
=
CurrentDate
;
if
(
createTable
(
PIPERESULTTABLE
,
"public"
,
CivTableTemp
::
PIPE_TABLE
))
{
os
<<
"INSERT INTO public."
<<
PIPERESULTTABLE
<<
"( "
;
os
<<
"INSERT INTO public."
<<
PIPERESULTTABLE
<<
"( "
;
os
<<
filedNames
.
szNo
<<
","
;
os
<<
filedNames
.
szNo
<<
","
;
...
@@ -238,8 +235,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
...
@@ -238,8 +235,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
if
(
!
execSql
(
sql
))
if
(
!
execSql
(
sql
))
return
false
;
return
false
;
}
return
true
;
return
true
;
}
}
...
...
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