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
eb7a6b12
Commit
eb7a6b12
authored
Aug 03, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,
parent
6d82f512
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
12 deletions
+86
-12
CivHydrTest.cpp
funcDemo/CivHydrTest.cpp
+7
-0
CivHydrTest.h
funcDemo/CivHydrTest.h
+7
-0
main.cpp
funcDemo/main.cpp
+5
-2
CivHydrFuncInter.cpp
pandaAnalysis/CivHydrFuncInter.cpp
+10
-0
CivHydrFuncInter.h
pandaAnalysis/CivHydrFuncInter.h
+2
-0
CivPgConn.cpp
pandaDbManager/CivPgConn.cpp
+45
-0
CivTableTemp.cpp
pandaDbManager/CivTableTemp.cpp
+8
-8
CivTypes.h
pandaDbManager/CivTypes.h
+2
-2
No files found.
funcDemo/CivHydrTest.cpp
View file @
eb7a6b12
...
...
@@ -10,6 +10,13 @@ void CivConHydrTest::test(char* uri)
std
::
cout
<<
"测试结果:"
<<
succ
<<
std
::
endl
;
}
// 模型维护
void
CivModelHydrTest
::
test
(
char
*
uri
)
{
int
succ
=
modelMatation
(
uri
);
std
::
cout
<<
"测试结果:"
<<
succ
<<
std
::
endl
;
}
// 水质测试
void
CivConQuaTest
::
test
(
char
*
uri
)
{
...
...
funcDemo/CivHydrTest.h
View file @
eb7a6b12
...
...
@@ -7,6 +7,13 @@ public:
virtual
void
test
(
char
*
uri
)
=
0
;
};
// 模型监测和维护
class
CivModelHydrTest
:
public
CivHydrTest
{
public
:
virtual
void
test
(
char
*
uri
);
};
// 水力测试
class
CivConHydrTest
:
public
CivHydrTest
{
...
...
funcDemo/main.cpp
View file @
eb7a6b12
...
...
@@ -23,10 +23,13 @@ int main(int argc, char* argv[])
/*CivTestContext context(new CivConQuaTest());
context.contextTest(findUri);*/
// 测试追踪分析
CivTestContext
context
(
new
CivConTrackTest
());
CivTestContext
context
(
new
CivModelHydrTest
());
context
.
contextTest
(
findUri
);
// 测试追踪分析
/*CivTestContext context(new CivConTrackTest());
context.contextTest(findUri);*/
// 测试根据时段获取值
/*CivTestContext context(new CivConGetDataTest());
context.contextTest(findUri);*/
...
...
pandaAnalysis/CivHydrFuncInter.cpp
View file @
eb7a6b12
...
...
@@ -31,6 +31,16 @@ bool FUNEXPORT getDataByInterval(char* uri, char* date, char* interval)
return
true
;
}
bool
FUNEXPORT
modelMatation
(
char
*
uri
)
{
// 创建数据库连接
CivDbConn
*
pgConn
=
new
CivPgConn
(
uri
);
pgConn
->
checkHyDrNetTable
();
delete
pgConn
;
return
true
;
}
bool
FUNEXPORT
hdyrSimulation
(
char
*
uri
)
{
// 创建数据库连接
...
...
pandaAnalysis/CivHydrFuncInter.h
View file @
eb7a6b12
...
...
@@ -7,6 +7,8 @@
extern
"C"
{
#endif
bool
FUNEXPORT
modelMatation
(
char
*
uri
);
/**
*@brief 上游追踪
*@param uri 数据库连接地址
...
...
pandaDbManager/CivPgConn.cpp
View file @
eb7a6b12
...
...
@@ -982,5 +982,50 @@ void CivPgConn::checkHyDrNetTable()
{
createTable
(
pipeTemp
);
}
// 方案电表
CivProjNodeTableTemp
projeNodeTemp
;
if
(
!
tableExist
(
projeNodeTemp
.
name
()))
{
createTable
(
projeNodeTemp
);
}
//方案线表
CivProjPipeTableTemp
projPipeTemp
;
if
(
!
tableExist
(
projPipeTemp
.
name
()))
{
createTable
(
projPipeTemp
);
}
// 方案表
CivProjTableTemp
projTemp
;
if
(
!
tableExist
(
projTemp
.
name
()))
{
createTable
(
projTemp
);
}
// 监测点压力
CivMonitorPressureTableTemp
pressureTemp
;
if
(
!
tableExist
(
pressureTemp
.
name
()))
{
createTable
(
pressureTemp
);
}
// 监测点流量
CivMonitorFlowTableTemp
flowTemp
;
if
(
!
tableExist
(
flowTemp
.
name
()))
{
createTable
(
flowTemp
);
}
// 监测点水质表
CivMonitorQualityTableTemp
qualityTemp
;
if
(
!
tableExist
(
qualityTemp
.
name
()))
{
createTable
(
qualityTemp
);
}
}
pandaDbManager/CivTableTemp.cpp
View file @
eb7a6b12
...
...
@@ -35,20 +35,20 @@ Str CivTableTemp::createSql()
if
(
mPropertys
.
size
()
<=
0
)
return
Str
();
char
sql
[
512
]
=
"create table "
;
std
::
string
sql
=
"create table "
;
sql
.
append
(
mTableName
);
sql
.
append
(
"(id serial primary key"
);
strcat_s
(
sql
,
mTableName
.
c_str
());
strcat_s
(
sql
,
"(id serial primary key"
);
size_t
total
=
mPropertys
.
size
();
for
(
int
i
=
0
;
i
<
total
;
i
++
)
{
FieldProperty
property
=
mPropertys
[
i
];
strcat_s
(
sql
,
","
);
strcat_s
(
sql
,
property
.
mFiledName
.
c_str
()
);
strcat_s
(
sql
,
" "
);
strcat_s
(
sql
,
property
.
mFieldType
.
c_str
()
);
sql
.
append
(
","
);
sql
.
append
(
"
\"
"
+
property
.
mFiledName
+
"
\"
"
);
sql
.
append
(
" "
);
sql
.
append
(
property
.
mFieldType
);
}
strcat_s
(
sql
,
")"
);
sql
.
append
(
")"
);
return
sql
;
}
...
...
pandaDbManager/CivTypes.h
View file @
eb7a6b12
...
...
@@ -35,8 +35,8 @@ typedef const std::string& StrQuote;
监测点表系列
*/
#define PRESSURETABLE Str("__monitor_pressure__")
#define FLOWTABLE Str("__monitor_flow
__")
#define QUALITYTABLE Str("__monitor_quality
__")
#define FLOWTABLE Str("__monitor_flow__")
#define QUALITYTABLE Str("__monitor_quality__")
#define PRV_TYPE Str("稳压阀")
...
...
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