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
94f736d7
Commit
94f736d7
authored
Jul 01, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,水质模拟数据处理
parent
4db5b9f4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
19 deletions
+26
-19
main.cpp
funcDemo/main.cpp
+8
-8
CivBuilder.cpp
pandaAnalysis/CivBuilder.cpp
+1
-1
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+15
-8
CivDbConnection.cpp
pandaDbManager/CivDbConnection.cpp
+2
-2
No files found.
funcDemo/main.cpp
View file @
94f736d7
...
...
@@ -18,21 +18,21 @@ int main(int argc, char* argv[])
char
net
[
128
];
char
flag
[
128
];
const
char
*
file
=
"test.inp"
;
const
char
netName
[
128
]
=
"
管网水力模型
"
;
const
char
netName
[
128
]
=
"
水力模型管网
"
;
strcpy_s
(
net
,
"
管网水力模型
"
);
strcpy_s
(
flag
,
"
HD
Y"
);
strcpy_s
(
net
,
"
水力模型管网
"
);
strcpy_s
(
flag
,
"
QUALIT
Y"
);
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-6-29
";
const
char
*
date
=
"2020-07-01
"
;
char
*
dates
=
const_cast
<
char
*>
(
date
);
const char* interval = "
1
3";
const
char
*
interval
=
"3"
;
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/CivBuilder.cpp
View file @
94f736d7
...
...
@@ -81,7 +81,7 @@ void CivInpBuilder::buildEmitter()
CivNewInp
*
CivInpBuilder
::
getNewInp
()
{
return
mNewInp
;
}
void
CivInpBuilder
::
buildPatterns
()
...
...
pandaAnalysis/CivHydrCalc.cpp
View file @
94f736d7
...
...
@@ -311,6 +311,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
CivItem
civItem
;
if
(
id
==
""
||
id
.
empty
())
id
=
"GD"
+
comp
.
find
(
"id"
)
->
second
;
civItem
.
push_back
(
id
);
civItem
.
push_back
(
startNode
);
civItem
.
push_back
(
endNode
);
...
...
@@ -335,6 +336,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
Civitems
jounItems
;
Civitems
nodeCoordItems
;
Civitems
patternItems
;
Civitems
initQaulityItems
;
int
total
=
comps
.
size
();
std
::
set
<
Str
>
patterNams
;
...
...
@@ -370,6 +372,13 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
patterNams
.
insert
(
pattern
);
}
// 初始水质
Str
initQual
=
comp
.
find
(
jontionFields
.
InitQual
)
->
second
;
CivItem
initQualItem
;
initQualItem
.
push_back
(
id
);
initQualItem
.
push_back
(
initQual
);
initQaulityItems
.
push_back
(
initQualItem
);
}
Componets
patterns
=
mDbConn
->
getComponets
(
PATTERNTABLE
);
...
...
@@ -390,6 +399,7 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
inp
.
writeComponet
(
jounItems
,
_JUNCTIONS
);
inp
.
writeComponet
(
nodeCoordItems
,
_COORDS
);
inp
.
writeComponet
(
patternItems
,
_PATTERNS
);
inp
.
writeComponet
(
initQaulityItems
,
_QUALITY
);
}
else
if
(
RESIVOIR
==
table
)
// 水源
{
...
...
@@ -704,27 +714,24 @@ void CivHydrCalc::getLinkQuality(short time)
{
int
nLinkCount
;
ENgetcount
(
EN_LINKCOUNT
,
&
nLinkCount
);
int
*
typeCode
=
(
int
*
)
malloc
(
sizeof
(
int
));
float
*
quality
=
(
float
*
)
malloc
(
sizeof
(
float
));
for
(
int
i
=
1
;
i
<=
nLinkCount
;
i
++
)
{
int
*
typeCode
=
(
int
*
)
malloc
(
sizeof
(
int
));
ENgetlinktype
(
i
,
typeCode
);
if
(
*
typeCode
!=
EN_PIPE
)
{
free
(
typeCode
);
continue
;
}
free
(
typeCode
);
char
lnkNo
[
35
];
// 编号
ENgetlinkid
(
i
,
lnkNo
);
float
*
quality
=
(
float
*
)
malloc
(
sizeof
(
float
));
// 水质
ENgetlinkvalue
(
i
,
EN_LINKQUAL
,
quality
);
mResultCache
.
addLinkQuality
(
*
quality
,
time
,
lnkNo
);
free
(
quality
);
}
free
(
typeCode
);
free
(
quality
);
}
pandaDbManager/CivDbConnection.cpp
View file @
94f736d7
...
...
@@ -255,8 +255,8 @@ bool CivDbConnection::updateNodeByInterval(StrQuote currDate, StrQuote interval)
<<
")=( "
<<
"tb2."
<<
TransUTFCoding
(
filedNames
.
dHead
)
<<
","
<<
"tb2."
<<
TransUTFCoding
(
filedNames
.
dPressure
)
<<
","
<<
"tb2."
<<
TransUTFCoding
(
filedNames
.
d
Quality
)
<<
","
<<
"tb2."
<<
TransUTFCoding
(
filedNames
.
d
Demand
)
<<
")"
<<
" from "
<<
"tb2."
<<
TransUTFCoding
(
filedNames
.
d
Demand
)
<<
","
<<
"tb2."
<<
TransUTFCoding
(
filedNames
.
d
Quality
)
<<
")"
<<
" from "
<<
TransUTFCoding
(
NODERESULTTABLE
)
<<
" AS tb2 where tb1."
<<
TransUTFCoding
(
filedNames
.
Number
)
<<
"= tb2."
<<
TransUTFCoding
(
filedNames
.
Number
)
<<
" AND tb2."
...
...
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