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
e7a421fe
Commit
e7a421fe
authored
Jun 22, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1, 代码改造
parent
15675189
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
258 additions
and
101 deletions
+258
-101
CivAssembly.cpp
pandaAnalysis/CivAssembly.cpp
+42
-0
CivAssembly.h
pandaAnalysis/CivAssembly.h
+105
-0
CivComponent.cpp
pandaAnalysis/CivComponent.cpp
+0
-12
CivComponent.h
pandaAnalysis/CivComponent.h
+0
-30
CivHydrCalc.cpp
pandaAnalysis/CivHydrCalc.cpp
+8
-9
CivHydrCalc.h
pandaAnalysis/CivHydrCalc.h
+0
-6
CivInpBuilder.cpp
pandaAnalysis/CivInpBuilder.cpp
+0
-0
CivInpBuilder.h
pandaAnalysis/CivInpBuilder.h
+62
-0
CivInpExporter.cpp
pandaAnalysis/CivInpExporter.cpp
+0
-12
CivInpExporter.h
pandaAnalysis/CivInpExporter.h
+0
-19
CivNewInp.h
pandaAnalysis/CivNewInp.h
+22
-0
pandaAnalysis.vcxproj
pandaAnalysis/pandaAnalysis.vcxproj
+5
-4
pandaAnalysis.vcxproj.filters
pandaAnalysis/pandaAnalysis.vcxproj.filters
+10
-7
CivPgConn.h
pandaDbManager/CivPgConn.h
+2
-1
pandaDbManager.vcxproj
pandaDbManager/pandaDbManager.vcxproj
+2
-1
No files found.
pandaAnalysis/CivAssembly.cpp
0 → 100644
View file @
e7a421fe
#include "CivAssembly.h"
CivAssembly
::
CivAssembly
()
{
}
CivNode
::
CivNode
()
{
}
CivPipe
::
CivPipe
()
{
}
CivTank
::
CivTank
()
{
}
CivValve
::
CivValve
()
{
}
CivPumps
::
CivPumps
()
{
}
CivReservoirs
::
CivReservoirs
()
{
}
CivEmitters
::
CivEmitters
()
{
}
\ No newline at end of file
pandaAnalysis/CivAssembly.h
0 → 100644
View file @
e7a421fe
#ifndef CIVASSEMBLY_H
#define CIVASSEMBLY_H
#include "CivTypes.h"
class
CivAssembly
;
class
CivNode
;
class
CivPipe
;
class
CivTank
;
class
CivValve
;
class
CivPumps
;
class
CivEmitters
;
/**
管网基本组件
*/
class
CivAssembly
{
public
:
CivAssembly
();
protected
:
};
/**
节点类型
*/
class
CivNode
:
public
CivAssembly
{
public
:
CivNode
();
private
:
};
/**
* 管线类型
*/
class
CivPipe
:
public
CivAssembly
{
public
:
CivPipe
();
private
:
Str
mID
;
// id号
CivNode
*
mStartNode
=
nullptr
;
// 上点号
CivNode
*
mStopNode
=
nullptr
;
// 本点号
};
/*
水池类型
*/
class
CivTank
:
public
CivAssembly
{
public
:
CivTank
();
};
/*
阀门
*/
class
CivValve
:
public
CivAssembly
{
public
:
CivValve
();
};
/**
水泵
*/
class
CivPumps
:
public
CivAssembly
{
public
:
CivPumps
();
};
/*
水源
*/
class
CivReservoirs
:
public
CivAssembly
{
public
:
CivReservoirs
();
};
/**
EMITTERS将模拟节点定义为扩散器(喷嘴或者孔口)。
*/
class
CivEmitters
:
public
CivAssembly
{
public
:
CivEmitters
();
};
#endif // !CIVASSEMBLY_H
pandaAnalysis/CivComponent.cpp
deleted
100644 → 0
View file @
15675189
#include "CivComponent.h"
CivNode
::
CivNode
()
{
}
CivPipe
::
CivPipe
()
{
}
\ No newline at end of file
pandaAnalysis/CivComponent.h
deleted
100644 → 0
View file @
15675189
#pragma once
#include "CivTypes.h"
class
CivNode
;
class
CivPipe
;
/**
* 节点类型
*/
class
CivNode
{
public
:
CivNode
();
private
:
};
/**
* 管线类型
*/
class
CivPipe
{
public
:
CivPipe
();
private
:
Str
mID
;
// id号
CivNode
*
mStartNode
=
nullptr
;
// 上点号
CivNode
*
mStopNode
=
nullptr
;
// 本点号
};
pandaAnalysis/CivHydrCalc.cpp
View file @
e7a421fe
...
...
@@ -95,22 +95,22 @@ bool CivHydrCalc::hydrSimulation(char* fileName, char* rptFile, char* binOutFile
bool
CivHydrCalc
::
qualitySimulation
(
char
*
inpFile
,
char
*
rptFile
,
char
*
binOutFile
)
{
if
(
!
hydrSimulation
(
inpFile
,
rptFile
,
binOutFile
))
{
return
false
;
}
// 运行水质运算需要先进行水力运算
,没有直接采用ENSolveH 是为了考虑减压阀的压力曲线设置
// 运行水质运算需要先进行水力运算
int
errcode
=
0
;
// 进行水质分析
ENopenQ
();
ENinitQ
(
1
);
t
=
0
;
tstep
=
0
;
iTime
=
0
;
long
t
(
0
),
tstep
(
0
);
int
iTime
(
0
);
int
errcode
=
0
;
do
{
errcode
=
ENrunQ
(
&
t
);
// errcode > 100 是错误
...
...
@@ -121,8 +121,7 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
return
;
}
HydResultCache
::
GetInstance
()
->
SetHydNodQualityResultTblAi
(
iTime
);
HydResultCache
::
GetInstance
()
->
SetHydLinQualityResultTblAi
(
iTime
);
// 存储水质计算结果
ENstepQ
(
&
tstep
);
...
...
@@ -180,8 +179,8 @@ bool CivHydrCalc::exportInp(char* fileName)
if
(
!
mDbConn
->
open
())
return
false
;
bool
pattern
=
mDbConn
->
createTable
(
PATTERNTABLE
,
"public"
,
Civ
DbConnection
::
PATTERN_TABLE
);
bool
cii
=
mDbConn
->
createTable
(
OPTIONTTABLE
,
"public"
,
Civ
DbConnection
::
PARAMETER_TABLE
);
bool
pattern
=
mDbConn
->
createTable
(
PATTERNTABLE
,
"public"
,
Civ
TableTemp
::
PATTERN_TABLE
);
bool
cii
=
mDbConn
->
createTable
(
OPTIONTTABLE
,
"public"
,
Civ
TableTemp
::
PARAMETER_TABLE
);
// 获取表格
Tables
tables
=
mDbConn
->
getTables
(
mNetname
);
...
...
pandaAnalysis/CivHydrCalc.h
View file @
e7a421fe
...
...
@@ -58,15 +58,9 @@ private:
*/
void
getLinkResult
(
short
time
);
/**
*@brief 获取运行过程产生的错误
*/
std
::
string
getLastError
()
{
return
mLastError
;
}
private
:
CivDbConnection
*
mDbConn
;
std
::
string
mNetname
;
std
::
string
mLastError
;
};
pandaAnalysis/CivInpBuilder.cpp
0 → 100644
View file @
e7a421fe
This diff is collapsed.
Click to expand it.
pandaAnalysis/CivInpBuilder.h
0 → 100644
View file @
e7a421fe
#ifndef _CIVINPEXPOTER_H
#define _CIVINPEXPOTER_H
#include "CivPgConn.h"
#include "CivInp.h"
#include "CivNewInp.h"
/**
* 抽象建造者
*/
class
CivAbsBuilder
{
public
:
virtual
void
buildNode
()
=
0
;
virtual
void
buildPipe
()
=
0
;
virtual
void
buildTank
()
=
0
;
virtual
void
buildVavle
()
=
0
;
virtual
void
buildPump
()
=
0
;
virtual
void
buildReservoir
()
=
0
;
virtual
void
buildEmitter
()
=
0
;
virtual
CivNewInp
*
getNewInp
()
=
0
;
};
/**
* 导出inp文件类
*/
class
CivInpBuilder
:
public
CivAbsBuilder
{
public
:
CivInpBuilder
();
CivInpBuilder
(
CivDbConn
*
dbConn
);
~
CivInpBuilder
();
// 注册数据库连接
void
registDb
(
CivDbConn
*
dbConn
);
/**
*@brief 导出inp文件
*/
bool
exportInp
(
char
*
fileName
);
/**
*@brief 解析表字段名,按顺序写入
*@table:表
*@inp: inp文件对象
*/
void
assemble
(
StrQuote
table
,
CivInp
&
inp
);
virtual
void
buildNode
();
virtual
void
buildPipe
();
virtual
void
buildTank
()
;
virtual
void
buildVavle
();
virtual
void
buildPump
();
virtual
void
buildReservoir
()
;
virtual
void
buildEmitter
();
virtual
CivNewInp
*
getNewInp
();
private
:
CivDbConn
*
mDbConn
;
};
#endif // !_CIVINPEXPOTER_H
pandaAnalysis/CivInpExporter.cpp
deleted
100644 → 0
View file @
15675189
#include "CivInpExporter.h"
CivInpExporter
::
CivInpExporter
()
{
}
CivInpExporter
::~
CivInpExporter
()
{
}
\ No newline at end of file
pandaAnalysis/CivInpExporter.h
deleted
100644 → 0
View file @
15675189
#ifndef _CIVINPEXPOTER_H
#define _CIVINPEXPOTER_H
/**
* inpļ
*/
class
CivInpExporter
{
public
:
CivInpExporter
();
~
CivInpExporter
();
private
:
};
#endif // !_CIVINPEXPOTER_H
pandaAnalysis/CivNewInp.h
0 → 100644
View file @
e7a421fe
#ifndef CIVNEWINP_H
#define CIVNEWINP_H
#include "CivAssembly.h"
class
CivNewInp
{
public
:
CivNewInp
();
~
CivNewInp
();
private
:
//
CivNode
mNode
;
// 节点
CivPipe
mPipes
;
// 管线
CivTank
mTanks
;
// 水池
CivValve
mValves
;
// 阀门
CivPumps
mPumps
;
// 水泵
CivEmitters
mEmitters
;
// 喷嘴
};
#endif // !CIVNEWINP_H
pandaAnalysis/pandaAnalysis.vcxproj
View file @
e7a421fe
...
...
@@ -153,18 +153,19 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile
Include=
"..\pandaDbManager\CivCommonUtils.cpp"
/>
<ClCompile
Include=
"Civ
Component
.cpp"
/>
<ClCompile
Include=
"Civ
Assembly
.cpp"
/>
<ClCompile
Include=
"CivHydrCalc.cpp"
/>
<ClCompile
Include=
"CivHydrFuncInter.cpp"
/>
<ClCompile
Include=
"CivInp.cpp"
/>
<ClCompile
Include=
"CivInp
Export
er.cpp"
/>
<ClCompile
Include=
"CivInp
Build
er.cpp"
/>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"Civ
Component
.h"
/>
<ClInclude
Include=
"Civ
Assembly
.h"
/>
<ClInclude
Include=
"CivHydrCalc.h"
/>
<ClInclude
Include=
"CivHydrFuncInter.h"
/>
<ClInclude
Include=
"CivInp.h"
/>
<ClInclude
Include=
"CivInpExporter.h"
/>
<ClInclude
Include=
"CivInpBuilder.h"
/>
<ClInclude
Include=
"CivNewInp.h"
/>
</ItemGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ImportGroup
Label=
"ExtensionTargets"
>
...
...
pandaAnalysis/pandaAnalysis.vcxproj.filters
View file @
e7a421fe
...
...
@@ -21,16 +21,16 @@
<ClCompile
Include=
"CivInp.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"CivComponent.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"CivHydrFuncInter.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"..\pandaDbManager\CivCommonUtils.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"CivInpExporter.cpp"
>
<ClCompile
Include=
"CivAssembly.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"CivInpBuilder.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
</ItemGroup>
...
...
@@ -41,13 +41,16 @@
<ClInclude
Include=
"CivInp.h"
>
<Filter>
头文件
</Filter>
</ClInclude>
<ClInclude
Include=
"Civ
Component
.h"
>
<ClInclude
Include=
"Civ
HydrFuncInter
.h"
>
<Filter>
头文件
</Filter>
</ClInclude>
<ClInclude
Include=
"CivHydrFuncInter.h"
>
<ClInclude
Include=
"CivAssembly.h"
>
<Filter>
头文件
</Filter>
</ClInclude>
<ClInclude
Include=
"CivInpBuilder.h"
>
<Filter>
头文件
</Filter>
</ClInclude>
<ClInclude
Include=
"Civ
InpExporter
.h"
>
<ClInclude
Include=
"Civ
NewInp
.h"
>
<Filter>
头文件
</Filter>
</ClInclude>
</ItemGroup>
...
...
pandaDbManager/CivPgConn.h
View file @
e7a421fe
...
...
@@ -4,10 +4,11 @@
#include "CivDbConn.h"
#include <libpq-fe.h>
#define DBEXPORT __declspec(dllexport)
/**
postgress 数据库
*/
class
CivPgConn
:
public
CivDbConn
class
DBEXPORT
CivPgConn
:
public
CivDbConn
{
public
:
CivPgConn
(
char
*
uri
);
...
...
pandaDbManager/pandaDbManager.vcxproj
View file @
e7a421fe
...
...
@@ -151,7 +151,8 @@
<PostBuildEvent>
<Command>
copy CivDbConnection.h $(OutDir)..\include /y
copy CivTypes.h $(OutDir)..\include /y
</Command>
copy CivPgConn.h $(OutDir)..\include /y
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
...
...
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