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
f5ef1766
Commit
f5ef1766
authored
Sep 26, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1, 代码优化
parent
f1ea02ef
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
14 deletions
+19
-14
CIvProjSimulResHelper.h
pandaDbManager/CIvProjSimulResHelper.h
+8
-4
CivConnection.h
pandaDbManager/CivConnection.h
+7
-6
CivProjInpDbHelper.cpp
pandaDbManager/CivProjInpDbHelper.cpp
+2
-1
CivProjInpDbHelper.h
pandaDbManager/CivProjInpDbHelper.h
+1
-1
CivCommonUtils.cpp
pandaLog/CivCommonUtils.cpp
+0
-1
StringUtils.h
pandaLog/StringUtils.h
+1
-1
No files found.
pandaDbManager/CIvProjSimulResHelper.h
View file @
f5ef1766
...
@@ -10,7 +10,7 @@ class CivConnection;
...
@@ -10,7 +10,7 @@ class CivConnection;
/**
/**
*@brief 方案模拟结果操作类型
*@brief 方案模拟结果操作类型
*/
*/
class
PANDADBMANAGER_API
CIvProjSimulResHelper
:
public
CivSimulResHelperAbs
class
PANDADBMANAGER_API
CIvProjSimulResHelper
:
public
CivSimulResHelperAbs
{
{
public
:
public
:
explicit
CIvProjSimulResHelper
(
const
std
::
string
&
uri
);
explicit
CIvProjSimulResHelper
(
const
std
::
string
&
uri
);
...
@@ -18,17 +18,21 @@ public:
...
@@ -18,17 +18,21 @@ public:
/**
/**
*@brief 保存方案模拟的节点数据
*@brief 保存方案模拟的节点数据
*@param [
ProjNodeResultItem
] nodeItem 模拟的节点值
*@param [
in
] nodeItem 模拟的节点值
*/
*/
virtual
void
saveNodeToDb
(
const
std
::
vector
<
ProjNodeResultItem
>&
nodeItem
);
virtual
void
saveNodeToDb
(
const
std
::
vector
<
ProjNodeResultItem
>&
nodeItem
);
/**
/**
*@brief 保存方案模拟的管段数据
*@brief 保存方案模拟的管段数据
*@param [
PorjPipeResultItem
] nodeItem 模拟的节点值
*@param [
in
] nodeItem 模拟的节点值
*/
*/
virtual
void
savePipeToDb
(
const
std
::
vector
<
PorjPipeResultItem
>&
pipeItem
);
virtual
void
savePipeToDb
(
const
std
::
vector
<
PorjPipeResultItem
>&
pipeItem
);
// 根据时间点字段删除数据
/**
*@brief 根据时间点字段删除数据
*@param [in] time 整点时间
*@param [in] projCode 方案编码
*/
void
deleteByTimeAndPorjcode
(
const
std
::
string
&
time
,
const
std
::
string
&
projCode
);
void
deleteByTimeAndPorjcode
(
const
std
::
string
&
time
,
const
std
::
string
&
projCode
);
private
:
private
:
...
...
pandaDbManager/CivConnection.h
View file @
f5ef1766
...
@@ -19,8 +19,8 @@ public:
...
@@ -19,8 +19,8 @@ public:
virtual
bool
connect
(
const
std
::
string
&
url
)
=
0
;
virtual
bool
connect
(
const
std
::
string
&
url
)
=
0
;
/**
/**
*@brief 关闭数据,与具体的数据有关子类实现
*@brief 关闭数据,与具体的数据有关子类实现
*/
*/
virtual
bool
disconnect
()
=
0
;
virtual
bool
disconnect
()
=
0
;
/**
/**
...
@@ -36,6 +36,7 @@ public:
...
@@ -36,6 +36,7 @@ public:
virtual
bool
queryResult
(
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>&
result
)
=
0
;
virtual
bool
queryResult
(
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>&
result
)
=
0
;
virtual
bool
beginTransaction
()
=
0
;
virtual
bool
beginTransaction
()
=
0
;
virtual
bool
commitTransaction
()
=
0
;
virtual
bool
commitTransaction
()
=
0
;
/**
/**
*@brief 删除数据
*@brief 删除数据
...
@@ -64,10 +65,10 @@ public:
...
@@ -64,10 +65,10 @@ public:
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
result
);
const
std
::
vector
<
std
::
vector
<
std
::
string
>>&
result
);
/**
/**
*@brief 执行查询操作,与具体的数据有关子类实现
*@brief 执行查询操作,与具体的数据有关子类实现
*@param table 待查询的表名
*@param
[in]
table 待查询的表名
*@param fields 需要查询的字段
*@param
[in]
fields 需要查询的字段
*@param result 查询结果
*@param
[in]
result 查询结果
*@param where 查询条件语句,默认
*@param
[in]
where 查询条件语句,默认
*/
*/
bool
query
(
const
std
::
string
&
table
,
bool
query
(
const
std
::
string
&
table
,
const
std
::
vector
<
std
::
string
>&
fields
,
const
std
::
vector
<
std
::
string
>&
fields
,
...
...
pandaDbManager/CivProjInpDbHelper.cpp
View file @
f5ef1766
...
@@ -21,6 +21,7 @@ void CivProjInpDbHelper::setProjCode(const std::string& projCode)
...
@@ -21,6 +21,7 @@ void CivProjInpDbHelper::setProjCode(const std::string& projCode)
void
CivProjInpDbHelper
::
handlePump
()
void
CivProjInpDbHelper
::
handlePump
()
{
{
// 处理水泵连接的管段
// 处理水泵连接的管段
}
}
void
CivProjInpDbHelper
::
sortProjDeatil
()
void
CivProjInpDbHelper
::
sortProjDeatil
()
...
@@ -197,7 +198,7 @@ void CivProjInpDbHelper::handleValve()
...
@@ -197,7 +198,7 @@ void CivProjInpDbHelper::handleValve()
WHERE vnode.
\"
终止节点
\"
= va.
\"
本点号
\"
and va.
\"
方案编码
\"
= '"
+
mPorjCode
+
"'"
;
WHERE vnode.
\"
终止节点
\"
= va.
\"
本点号
\"
and va.
\"
方案编码
\"
= '"
+
mPorjCode
+
"'"
;
if
(
!
mDbConn
->
execSql
(
startSql
))
if
(
!
mDbConn
->
execSql
(
startSql
))
return
;
return
;
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
valvesVec
;
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
valvesVec
;
mDbConn
->
queryResult
(
valvesVec
);
mDbConn
->
queryResult
(
valvesVec
);
...
...
pandaDbManager/CivProjInpDbHelper.h
View file @
f5ef1766
...
@@ -14,7 +14,7 @@ public:
...
@@ -14,7 +14,7 @@ public:
void
handlePump
()
override
;
void
handlePump
()
override
;
void
handleValve
()
override
;
void
handleValve
()
override
;
bool
getNode
(
CivNode
&
node
)
override
;
bool
getNode
(
CivNode
&
node
)
override
;
bool
getPipe
(
CivPipe
&
pipe
)
override
;
bool
getPipe
(
CivPipe
&
pipe
)
override
;
bool
getTank
(
CivTank
&
tank
)
override
;
bool
getTank
(
CivTank
&
tank
)
override
;
bool
getValve
(
CivValve
&
valve
)
override
;
bool
getValve
(
CivValve
&
valve
)
override
;
...
...
pandaLog/CivCommonUtils.cpp
View file @
f5ef1766
...
@@ -69,7 +69,6 @@ void CivCommonUtils::genSeqNo(const std::string& prefix, int size,std::vector<st
...
@@ -69,7 +69,6 @@ void CivCommonUtils::genSeqNo(const std::string& prefix, int size,std::vector<st
res
=
prefix
+
res
.
substr
(
1
,
res
.
length
());
res
=
prefix
+
res
.
substr
(
1
,
res
.
length
());
resVec
.
push_back
(
res
);
resVec
.
push_back
(
res
);
}
}
}
}
std
::
string
CivCommonUtils
::
currentTime
()
std
::
string
CivCommonUtils
::
currentTime
()
...
...
pandaLog/StringUtils.h
View file @
f5ef1766
...
@@ -12,7 +12,7 @@ class PANDALOG_API StringUtils
...
@@ -12,7 +12,7 @@ class PANDALOG_API StringUtils
public
:
public
:
/**
/**
*@brief 将字符串按照分隔符分割成字符串数组
*@brief 将字符串按照分隔符分割成字符串数组
*@param [in] sourceStr源字符串
*@param [in] sourceStr
源字符串
*@param [in] res 分割后的字符串数组
*@param [in] res 分割后的字符串数组
*@param [in] delim 分割符,默认空格分割
*@param [in] delim 分割符,默认空格分割
*/
*/
...
...
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