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
a98c8cce
Commit
a98c8cce
authored
Jun 16, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1, 转inp文件逻辑漏洞修复
parent
cc3a6693
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
18 deletions
+31
-18
main.cpp
funcDemo/main.cpp
+1
-1
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+14
-9
CivInp.cpp
pandaAnalysis/CivInp.cpp
+1
-2
pandaAnalysis.vcxproj
pandaAnalysis/pandaAnalysis.vcxproj
+0
-1
pandaAnalysis.vcxproj.filters
pandaAnalysis/pandaAnalysis.vcxproj.filters
+0
-3
CivCommonUtils.cpp
pandaDbManager/CivCommonUtils.cpp
+7
-0
CivCommonUtils.h
pandaDbManager/CivCommonUtils.h
+7
-1
pandaDbManager.vcxproj
pandaDbManager/pandaDbManager.vcxproj
+1
-1
No files found.
funcDemo/main.cpp
View file @
a98c8cce
...
...
@@ -5,7 +5,7 @@
int
main
(
int
argc
,
char
*
argv
[])
{
const
char
*
uri
=
"host=192.168.12.7 port=5432 dbname=
2222
user=postgres password=admin"
;
const
char
*
uri
=
"host=192.168.12.7 port=5432 dbname=
liulele
user=postgres password=admin"
;
char
*
findUri
=
const_cast
<
char
*>
(
uri
);
char
net
[
128
];
...
...
pandaAnalysis/CivHydrCalc.cpp
View file @
a98c8cce
#include "CivHydrCalc.h"
#include "CivDbConnection.h"
#include "CivTypes.h"
#include "CivCommonUtils.h"
#include "Epanet2.h"
#include "CivInp.h"
...
...
@@ -113,15 +112,15 @@ bool CivHydrCalc::exportInp(char* fileName)
assemble
(
PIPELINE
,
civInp
);
// 设置模式
Componets
comp
s
=
mDbConn
->
getComponets
(
PATTERNTABLE
);
size_t
total
=
comp
s
.
size
();
for
(
int
i
=
0
;
i
<
total
;
i
++
)
Componets
pattern
s
=
mDbConn
->
getComponets
(
PATTERNTABLE
);
size_t
patternSize
=
pattern
s
.
size
();
for
(
int
i
=
0
;
i
<
patternSize
;
i
++
)
{
}
// 设置曲线
Componets
c
omp
s
=
mDbConn
->
getComponets
(
CURVETABLE
);
Componets
c
urve
s
=
mDbConn
->
getComponets
(
CURVETABLE
);
// 初始化参数
Options
options
;
...
...
@@ -172,10 +171,14 @@ void CivHydrCalc::assemble(const std::string& table, CivInp& inp)
// 过滤掉与阀门和水泵连接的管线
Str
number
=
comp
.
find
(
"id"
)
->
second
;
FiledFilter
filter
=
mDbConn
->
getFilter
();
auto
lineFilter
=
filter
.
find
(
PIPELINE
)
->
second
;
if
(
lineFilter
.
count
(
number
)
>
0
)
continue
;
auto
iter
=
filter
.
find
(
PIPELINE
);
if
(
iter
!=
filter
.
end
())
{
auto
lineFilter
=
filter
.
find
(
PIPELINE
)
->
second
;
if
(
lineFilter
.
count
(
number
)
>
0
)
continue
;
}
Str
id
=
comp
.
find
(
pipes
.
ID
)
->
second
;
Str
startNode
=
comp
.
find
(
pipes
.
Node1
)
->
second
;
Str
endNode
=
comp
.
find
(
pipes
.
Node2
)
->
second
;
...
...
@@ -187,6 +190,8 @@ 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
);
...
...
pandaAnalysis/CivInp.cpp
View file @
a98c8cce
#include "CivInp.h"
#include "CivCommonUtils.h"
#include<time.h>
CivInp
::
CivInp
(
TimeUnit
timetype
)
:
mTimeUnit
(
timetype
)
...
...
@@ -253,7 +252,7 @@ void CivInp::writeTitles()
{
writeString
(
"[TITLE]"
);
// дǩ
writeString
(
"Scenario: Base"
);
writeString
(
"Date:"
+
CivCommonUtils
::
currentTime
()
);
writeString
(
"Date:"
);
writeString
(
""
);
writeString
(
""
);
}
...
...
pandaAnalysis/pandaAnalysis.vcxproj
View file @
a98c8cce
...
...
@@ -152,7 +152,6 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile
Include=
"..\pandaDbManager\CivCommonUtils.cpp"
/>
<ClCompile
Include=
"CivComponent.cpp"
/>
<ClCompile
Include=
"CivHydrCalc.cpp"
/>
<ClCompile
Include=
"CivHydrFuncInter.cpp"
/>
...
...
pandaAnalysis/pandaAnalysis.vcxproj.filters
View file @
a98c8cce
...
...
@@ -21,9 +21,6 @@
<ClCompile
Include=
"CivInp.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"..\pandaDbManager\CivCommonUtils.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"CivComponent.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
...
...
pandaDbManager/CivCommonUtils.cpp
View file @
a98c8cce
...
...
@@ -47,6 +47,13 @@ std::string CivCommonUtils::UTF8_To_string(const std::string& str)
return
strRet
;
}
//std::map<std::string, std::string> CivCommonUtils::parseJson(std::string jsonStr)
//{
// std::map<std::string, std::string> map;
//
// return map;
//}
std
::
string
CivCommonUtils
::
currentTime
()
{
return
std
::
string
();
...
...
pandaDbManager/CivCommonUtils.h
View file @
a98c8cce
#pragma once
#include<string>
#include<map>
// #include<json/reader.h>
class
CivCommonUtils
{
public
:
// std:string转UTF8
...
...
@@ -22,4 +23,9 @@ public:
*@brief 获取系统当前时间
*/
static
std
::
string
currentTime
();
///**
//*@brief 将json字符串解析为
//*/
//static std::map<std::string, std::string> parseJson(std::string jsonStr);
};
pandaDbManager/pandaDbManager.vcxproj
View file @
a98c8cce
...
...
@@ -143,7 +143,7 @@
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<OptimizeReferences>
true
</OptimizeReferences>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<AdditionalDependencies>
libpq.lib;%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalDependencies>
libpq.lib;
json_vc71_libmt.lib;
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalLibraryDirectories>
$(OUTDIR)..\lib;%(AdditionalLibraryDirectories)
</AdditionalLibraryDirectories>
<ImportLibrary>
$(OutDir)..\lib\$(TargetName).lib
</ImportLibrary>
</Link>
...
...
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