Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
b33706cc
提交
b33706cc
authored
10月 17, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revisiting all TODOs
上级
e4c1e6c7
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
6 行增加
和
28 行删除
+6
-28
database.cpp
opencv-motion-detect/database.cpp
+1
-1
evcloudsvc.cpp
opencv-motion-detect/evcloudsvc.cpp
+3
-6
evdaemon.cpp
opencv-motion-detect/evdaemon.cpp
+0
-6
evmgr.cpp
opencv-motion-detect/evmgr.cpp
+0
-2
evmlmotion.cpp
opencv-motion-detect/evmlmotion.cpp
+0
-3
evpuller.cpp
opencv-motion-detect/evpuller.cpp
+1
-3
evpusher.cpp
opencv-motion-detect/evpusher.cpp
+0
-1
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+1
-4
utils.cpp
opencv-motion-detect/inc/utils.cpp
+0
-2
没有找到文件。
opencv-motion-detect/database.cpp
浏览文件 @
b33706cc
...
@@ -26,7 +26,7 @@ string _config_default_tmpl = "{\"time\":0,\"code\":0,\"data\":{\"<SN_MGR>\":{\"
...
@@ -26,7 +26,7 @@ string _config_default_tmpl = "{\"time\":0,\"code\":0,\"data\":{\"<SN_MGR>\":{\"
const
string
_sn_tmpl
[]
=
{
"<SN_MGR>"
,
"<SN_PULLER>"
,
"<SN_PUSHER>"
,
"<SN_SLICER>"
,
"<SN_ML>"
};
const
string
_sn_tmpl
[]
=
{
"<SN_MGR>"
,
"<SN_PULLER>"
,
"<SN_PUSHER>"
,
"<SN_SLICER>"
,
"<SN_ML>"
};
const
string
_addr_tmpl
[]
=
{
"<ADDR_CAMERA>"
};
const
string
_addr_tmpl
[]
=
{
"<ADDR_CAMERA>"
};
// TODO:
// TODO:
move to evcloudsvc ?
string
getStrRand
(
int
length
)
string
getStrRand
(
int
length
)
{
{
static
bool
bRand
=
false
;
static
bool
bRand
=
false
;
...
...
opencv-motion-detect/evcloudsvc.cpp
浏览文件 @
b33706cc
...
@@ -250,8 +250,8 @@ private:
...
@@ -250,8 +250,8 @@ private:
}
}
if
(
this
->
configMap
.
count
(
k
)
^
this
->
peerData
[
"config"
].
count
(
k
))
{
if
(
this
->
configMap
.
count
(
k
)
^
this
->
peerData
[
"config"
].
count
(
k
))
{
spdlog
::
warn
(
"evcloudsvc inconsistent configuration for cluster {}"
,
k
);
spdlog
::
warn
(
"evcloudsvc inconsistent configuration for cluster {}"
,
k
);
// TODO:
handle this situation gracefully.
// TODO:
improvements?
// r
me
ove both
// r
em
ove both
this
->
configMap
.
erase
(
k
);
this
->
configMap
.
erase
(
k
);
this
->
peerData
[
"config"
].
erase
(
k
);
this
->
peerData
[
"config"
].
erase
(
k
);
}
}
...
@@ -491,7 +491,6 @@ private:
...
@@ -491,7 +491,6 @@ private:
}
}
}
}
else
{
else
{
// TODO:
spdlog
::
warn
(
"evcloudsvc {} received unknown meta {} from {}"
,
devSn
,
meta
,
selfId
);
spdlog
::
warn
(
"evcloudsvc {} received unknown meta {} from {}"
,
devSn
,
meta
,
selfId
);
}
}
}
}
...
@@ -805,15 +804,13 @@ public:
...
@@ -805,15 +804,13 @@ public:
this
->
configMap
[
"mod2mgr"
].
erase
(
k
);
this
->
configMap
[
"mod2mgr"
].
erase
(
k
);
}
}
}
}
// TODO: clear peerData
this
->
configMap
.
erase
(
sn
);
this
->
configMap
.
erase
(
sn
);
this
->
peerData
.
erase
(
sn
);
this
->
peerData
.
erase
(
sn
);
spdlog
::
info
(
"evcloudsvc removed sn: {}"
,
sn
);
spdlog
::
info
(
"evcloudsvc removed sn: {}"
,
sn
);
// TODO: send config diff to sn
int
iret
=
LVDB
::
setValue
(
this
->
configMap
,
KEY_CONFIG_MAP
);
int
iret
=
LVDB
::
setValue
(
this
->
configMap
,
KEY_CONFIG_MAP
);
}
}
res
.
set_content
(
this
->
configMap
.
dump
(),
"text/json"
);
res
.
set_content
(
this
->
configMap
.
dump
(),
"text/json"
);
});
});
...
...
opencv-motion-detect/evdaemon.cpp
浏览文件 @
b33706cc
...
@@ -520,7 +520,6 @@ private:
...
@@ -520,7 +520,6 @@ private:
}
}
}
}
else
{
else
{
// TODO:
spdlog
::
warn
(
"evdaemon {} received unknown meta {} from {}"
,
devSn
,
meta
,
selfId
);
spdlog
::
warn
(
"evdaemon {} received unknown meta {} from {}"
,
devSn
,
meta
,
selfId
);
}
}
}
}
...
@@ -579,7 +578,6 @@ private:
...
@@ -579,7 +578,6 @@ private:
}
}
if
(
bBootstrap
)
{
if
(
bBootstrap
)
{
// TODO: wait for previous started modules to connecting
startSubSystems
();
startSubSystems
();
}
}
else
{
else
{
...
@@ -665,8 +663,6 @@ public:
...
@@ -665,8 +663,6 @@ public:
else
{
else
{
json
info
;
json
info
;
info
[
"sn"
]
=
sn
;
info
[
"sn"
]
=
sn
;
// TODO:
info
[
"lastboot"
]
=
chrono
::
duration_cast
<
chrono
::
seconds
>
(
chrono
::
system_clock
::
now
().
time_since_epoch
()).
count
();
info
[
"lastboot"
]
=
chrono
::
duration_cast
<
chrono
::
seconds
>
(
chrono
::
system_clock
::
now
().
time_since_epoch
()).
count
();
LVDB
::
setSn
(
info
);
LVDB
::
setSn
(
info
);
}
}
...
@@ -689,8 +685,6 @@ public:
...
@@ -689,8 +685,6 @@ public:
LVDB
::
setLocalConfig
(
newConfig
);
LVDB
::
setLocalConfig
(
newConfig
);
spdlog
::
info
(
"evmgr new config: {}"
,
newConfig
.
dump
());
spdlog
::
info
(
"evmgr new config: {}"
,
newConfig
.
dump
());
// TODO: restart other components
//
}
}
catch
(
exception
&
e
)
{
catch
(
exception
&
e
)
{
ret
.
clear
();
ret
.
clear
();
...
...
opencv-motion-detect/evmgr.cpp
浏览文件 @
b33706cc
...
@@ -112,8 +112,6 @@ private:
...
@@ -112,8 +112,6 @@ private:
addr
=
"tcp://*:"
+
to_string
(
config
[
"portRouter"
]);
addr
=
"tcp://*:"
+
to_string
(
config
[
"portRouter"
]);
// setup zmq
// setup zmq
// TODO: connect to cloud
// router service
// router service
pRouterCtx
=
zmq_ctx_new
();
pRouterCtx
=
zmq_ctx_new
();
pRouter
=
zmq_socket
(
pRouterCtx
,
ZMQ_ROUTER
);
pRouter
=
zmq_socket
(
pRouterCtx
,
ZMQ_ROUTER
);
...
...
opencv-motion-detect/evmlmotion.cpp
浏览文件 @
b33706cc
...
@@ -181,7 +181,6 @@ private:
...
@@ -181,7 +181,6 @@ private:
int
init
()
int
init
()
{
{
int
ret
=
0
;
int
ret
=
0
;
// TODO: req config
bool
found
=
false
;
bool
found
=
false
;
try
{
try
{
spdlog
::
info
(
"evmlmotion boot config: {} -> {}"
,
selfId
,
config
.
dump
());
spdlog
::
info
(
"evmlmotion boot config: {} -> {}"
,
selfId
,
config
.
dump
());
...
@@ -364,7 +363,6 @@ private:
...
@@ -364,7 +363,6 @@ private:
ret
=
z_send_multiple
(
pDealer
,
body
);
ret
=
z_send_multiple
(
pDealer
,
body
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
spdlog
::
error
(
"evmlmotion {} failed to send multiple: {}"
,
selfId
,
zmq_strerror
(
zmq_errno
()));
spdlog
::
error
(
"evmlmotion {} failed to send multiple: {}"
,
selfId
,
zmq_strerror
(
zmq_errno
()));
//TODO:
}
}
else
{
else
{
spdlog
::
info
(
"evmlmotion {} sent hello to router: {}"
,
selfId
,
mgrSn
);
spdlog
::
info
(
"evmlmotion {} sent hello to router: {}"
,
selfId
,
mgrSn
);
...
@@ -518,7 +516,6 @@ private:
...
@@ -518,7 +516,6 @@ private:
cv
::
absdiff
(
gray
,
avg
,
thresh
);
cv
::
absdiff
(
gray
,
avg
,
thresh
);
avg
=
gray
.
clone
();
avg
=
gray
.
clone
();
if
(
!
detect
||
fent
<
detPara
.
entropy
)
{
if
(
!
detect
||
fent
<
detPara
.
entropy
)
{
return
;
return
;
}
}
...
...
opencv-motion-detect/evpuller.cpp
浏览文件 @
b33706cc
...
@@ -116,7 +116,6 @@ private:
...
@@ -116,7 +116,6 @@ private:
{
{
int
ret
=
0
;
int
ret
=
0
;
{
{
// TODO: disable message response before openned input stream
unique_lock
<
mutex
>
lk
(
this
->
mutMsg
);
unique_lock
<
mutex
>
lk
(
this
->
mutMsg
);
this
->
cvMsg
.
wait
(
lk
,
[
this
]
{
return
this
->
gotFormat
;});
this
->
cvMsg
.
wait
(
lk
,
[
this
]
{
return
this
->
gotFormat
;});
}
}
...
@@ -124,7 +123,7 @@ private:
...
@@ -124,7 +123,7 @@ private:
spdlog
::
info
(
"evpuller {} got inputformat"
,
selfId
);
spdlog
::
info
(
"evpuller {} got inputformat"
,
selfId
);
try
{
try
{
// rep framectx
// rep framectx
// TODO: verify sender id
// TODO: verify sender id
?
string
sMeta
=
body2str
(
v
[
1
]);
string
sMeta
=
body2str
(
v
[
1
]);
string
peerId
=
body2str
(
v
[
0
]);
string
peerId
=
body2str
(
v
[
0
]);
auto
meta
=
json
::
parse
(
sMeta
);
auto
meta
=
json
::
parse
(
sMeta
);
...
@@ -414,7 +413,6 @@ protected:
...
@@ -414,7 +413,6 @@ protected:
free
(
pAVFmtCtxBytes
);
free
(
pAVFmtCtxBytes
);
}
}
// TODO:
if
(
ret
<
0
&&
!
bStopSig
)
{
if
(
ret
<
0
&&
!
bStopSig
)
{
// reconnect
// reconnect
}
}
...
...
opencv-motion-detect/evpusher.cpp
浏览文件 @
b33706cc
...
@@ -179,7 +179,6 @@ private:
...
@@ -179,7 +179,6 @@ private:
ret
=
z_send_multiple
(
pDealer
,
body
);
ret
=
z_send_multiple
(
pDealer
,
body
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
spdlog
::
error
(
"evpusher {} {} failed to send multiple: {}"
,
devSn
,
iid
,
zmq_strerror
(
zmq_errno
()));
spdlog
::
error
(
"evpusher {} {} failed to send multiple: {}"
,
devSn
,
iid
,
zmq_strerror
(
zmq_errno
()));
//TODO:
}
}
else
{
else
{
spdlog
::
info
(
"evpusher {} sent hello to router: {}"
,
selfId
,
mgrSn
);
spdlog
::
info
(
"evpusher {} sent hello to router: {}"
,
selfId
,
mgrSn
);
...
...
opencv-motion-detect/evslicer.cpp
浏览文件 @
b33706cc
...
@@ -394,7 +394,6 @@ private:
...
@@ -394,7 +394,6 @@ private:
ret
=
z_send_multiple
(
pDealer
,
body
);
ret
=
z_send_multiple
(
pDealer
,
body
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
spdlog
::
error
(
"evslicer {} failed to send multiple: {}"
,
selfId
,
zmq_strerror
(
zmq_errno
()));
spdlog
::
error
(
"evslicer {} failed to send multiple: {}"
,
selfId
,
zmq_strerror
(
zmq_errno
()));
//TODO:
}
}
else
{
else
{
spdlog
::
info
(
"evslicer {} sent hello to router: {}"
,
selfId
,
mgrSn
);
spdlog
::
info
(
"evslicer {} sent hello to router: {}"
,
selfId
,
mgrSn
);
...
@@ -929,7 +928,6 @@ public:
...
@@ -929,7 +928,6 @@ public:
auto
tse
=
jEvt
[
"end"
].
get
<
long
>
();
auto
tse
=
jEvt
[
"end"
].
get
<
long
>
();
long
offsetS
=
0
;
long
offsetS
=
0
;
long
offsetE
=
0
;
long
offsetE
=
0
;
// TODO: async
if
(
tss
<
this
->
bootTime
)
{
if
(
tss
<
this
->
bootTime
)
{
spdlog
::
warn
(
"evslicer {} should we discard old msg? {} < bootTime {}"
,
selfId
,
evt
,
this
->
bootTime
);
spdlog
::
warn
(
"evslicer {} should we discard old msg? {} < bootTime {}"
,
selfId
,
evt
,
this
->
bootTime
);
...
@@ -1004,8 +1002,7 @@ public:
...
@@ -1004,8 +1002,7 @@ public:
cvEvent
.
notify_one
();
cvEvent
.
notify_one
();
}
}
}
else
if
(
resp
[
"code"
]
==
6
)
{
}
else
if
(
resp
[
"code"
]
==
6
)
{
// cloud storage issue
// TODO: cloud storage issue. need stratigy policy
// TODO:
}
}
}
}
}
}
...
...
opencv-motion-detect/inc/utils.cpp
浏览文件 @
b33706cc
...
@@ -154,7 +154,6 @@ int getPeerId(string modName, json& modElem, string &peerId, string &peerName)
...
@@ -154,7 +154,6 @@ int getPeerId(string modName, json& modElem, string &peerId, string &peerName)
json
getModuleGidsFromCfg
(
string
sn
,
json
&
data
,
string
caller
,
int
ipcIdx
)
json
getModuleGidsFromCfg
(
string
sn
,
json
&
data
,
string
caller
,
int
ipcIdx
)
{
{
json
ret
;
json
ret
;
bool
hasError
=
false
;
ret
[
"code"
]
=
0
;
ret
[
"code"
]
=
0
;
ret
[
"msg"
]
=
"ok"
;
ret
[
"msg"
]
=
"ok"
;
ret
[
"data"
]
=
json
();
ret
[
"data"
]
=
json
();
...
@@ -162,7 +161,6 @@ json getModuleGidsFromCfg(string sn, json &data, string caller, int ipcIdx)
...
@@ -162,7 +161,6 @@ json getModuleGidsFromCfg(string sn, json &data, string caller, int ipcIdx)
try
{
try
{
// lock_guard<mutex> lock(cacheLock);
// lock_guard<mutex> lock(cacheLock);
string
peerId
;
string
peerId
;
pid_t
pid
;
for
(
auto
&
[
k
,
v
]
:
data
.
items
())
{
for
(
auto
&
[
k
,
v
]
:
data
.
items
())
{
if
(
v
.
count
(
"sn"
)
==
0
||
v
[
"sn"
].
size
()
==
0
||
v
.
count
(
"ipcs"
)
==
0
||
v
[
"ipcs"
].
size
()
==
0
)
{
if
(
v
.
count
(
"sn"
)
==
0
||
v
[
"sn"
].
size
()
==
0
||
v
.
count
(
"ipcs"
)
==
0
||
v
[
"ipcs"
].
size
()
==
0
)
{
msg
+=
fmt
::
format
(
"
\t\t
cluster {} has no sn/ipcs field {}:{}"
,
v
.
dump
(),
__FILE__
,
__LINE__
);
msg
+=
fmt
::
format
(
"
\t\t
cluster {} has no sn/ipcs field {}:{}"
,
v
.
dump
(),
__FILE__
,
__LINE__
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论