Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
61bccc25
提交
61bccc25
authored
9月 05, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new feature entropy filter to ignore gray frame without iframe
上级
5c329844
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
10 行删除
+59
-10
settings.json
.vscode/settings.json
+3
-1
database.cpp
opencv-motion-detect/database.cpp
+21
-0
evcloudsvc.cpp
opencv-motion-detect/evcloudsvc.cpp
+33
-9
database.h
opencv-motion-detect/inc/database.h
+2
-0
没有找到文件。
.vscode/settings.json
浏览文件 @
61bccc25
...
@@ -4,5 +4,6 @@
...
@@ -4,5 +4,6 @@
"files.associations"
:
{
"files.associations"
:
{
"chrono"
:
"cpp"
,
"chrono"
:
"cpp"
,
"optional"
:
"cpp"
"optional"
:
"cpp"
}
},
"C_Cpp.errorSquiggles"
:
"Disabled"
}
}
\ No newline at end of file
opencv-motion-detect/database.cpp
浏览文件 @
61bccc25
...
@@ -208,6 +208,27 @@ namespace LVDB {
...
@@ -208,6 +208,27 @@ namespace LVDB {
int
clearDB
(
string
fileName
)
{
int
clearDB
(
string
fileName
)
{
return
0
;
return
0
;
}
}
vector
<
string
>
getKeys
(
string
fileName
)
{
DB
*
pdb
=
NULL
;
if
(
fileName
.
empty
())
{
fileName
=
LVDB_FILE_GENERAL
;
}
vector
<
string
>
vec
;
int
ret
=
0
;
ret
=
_getDB
(
fileName
,
&
pdb
);
if
(
ret
<
0
)
{
//
}
else
{
Iterator
*
it
=
pdb
->
NewIterator
(
leveldb
::
ReadOptions
());
for
(
it
->
SeekToFirst
();
it
->
Valid
();
it
->
Next
())
{
vec
.
push_back
(
it
->
key
().
ToString
());
}
delete
it
;
delete
pdb
;
}
return
vec
;
}
int
getValue
(
string
&
value
,
string
key
,
string
fileName
,
cb_verify_str
cb
)
{
int
getValue
(
string
&
value
,
string
key
,
string
fileName
,
cb_verify_str
cb
)
{
int
ret
=
0
;
int
ret
=
0
;
...
...
opencv-motion-detect/evcloudsvc.cpp
浏览文件 @
61bccc25
...
@@ -159,14 +159,18 @@ class HttpSrv{
...
@@ -159,14 +159,18 @@ class HttpSrv{
if
(
sn
.
empty
()
||
module
.
empty
()){
if
(
sn
.
empty
()
||
module
.
empty
()){
throw
StrException
(
"no para sn/module"
);
throw
StrException
(
"no para sn/module"
);
}
}
string
modname
=
module
.
substr
(
0
,
4
);
if
(
modname
==
"evml"
)
{
modname
=
"evml:"
+
module
.
substr
(
4
,
module
.
size
());
}
else
{
modname
=
module
;
}
string
key
=
sn
+
":"
+
modname
;
string
key
,
modname
;
if
(
module
==
"evmgr"
)
{
key
=
sn
;
}
else
{
if
(
modname
==
"evml"
)
{
modname
=
"evml:"
+
module
.
substr
(
4
,
module
.
size
());
}
else
{
modname
=
module
;
}
key
=
sn
+
":"
+
modname
;
}
if
(
this
->
configMap
.
count
(
key
)
==
0
){
if
(
this
->
configMap
.
count
(
key
)
==
0
){
//
//
...
@@ -181,7 +185,7 @@ class HttpSrv{
...
@@ -181,7 +185,7 @@ class HttpSrv{
// TODO: calc md5
// TODO: calc md5
int
r
;
int
r
;
ret
[
"code"
]
=
0
;
ret
[
"code"
]
=
0
;
ret
[
"msg"
]
=
"
ok
"
;
ret
[
"msg"
]
=
"
all ready exist
"
;
string
dk
=
this
->
configMap
[
key
];
string
dk
=
this
->
configMap
[
key
];
json
data
;
json
data
;
r
=
LVDB
::
getLocalConfig
(
data
,
dk
);
r
=
LVDB
::
getLocalConfig
(
data
,
dk
);
...
@@ -230,7 +234,7 @@ class HttpSrv{
...
@@ -230,7 +234,7 @@ class HttpSrv{
if
(
!
key
.
empty
())
{
if
(
!
key
.
empty
())
{
json
config
;
json
config
;
int
iret
=
LVDB
::
getLocalConfig
(
config
,
key
);
int
iret
=
LVDB
::
getLocalConfig
(
config
,
this
->
configMap
[
key
]
);
if
(
iret
<
0
)
{
if
(
iret
<
0
)
{
ret
[
"code"
]
=
1
;
ret
[
"code"
]
=
1
;
ret
[
"msg"
]
=
"evcloud failed to get config with k, v:"
+
key
+
" "
+
this
->
configMap
[
key
].
get
<
string
>
();
ret
[
"msg"
]
=
"evcloud failed to get config with k, v:"
+
key
+
" "
+
this
->
configMap
[
key
].
get
<
string
>
();
...
@@ -257,6 +261,26 @@ class HttpSrv{
...
@@ -257,6 +261,26 @@ class HttpSrv{
});
});
svr
.
Get
(
"/keys"
,
[](
const
Request
&
req
,
Response
&
res
){
string
fileName
=
req
.
get_param_value
(
"filename"
);
auto
v
=
LVDB
::
getKeys
(
fileName
);
json
ret
=
v
;
res
.
set_content
(
ret
.
dump
(),
"text/json"
);
});
svr
.
Get
(
"/value"
,
[](
const
Request
&
req
,
Response
&
res
){
string
key
=
req
.
get_param_value
(
"key"
);
string
filename
=
req
.
get_param_value
(
"filename"
);
json
j
;
int
ret
=
LVDB
::
getValue
(
j
,
key
,
filename
);
if
(
ret
<
0
)
{
j
[
"code"
]
=
1
;
}
else
{
j
[
"code"
]
=
0
;
}
res
.
set_content
(
j
.
dump
(),
"text/json"
);
});
svr
.
listen
(
"0.0.0.0"
,
8089
);
svr
.
listen
(
"0.0.0.0"
,
8089
);
}
}
...
...
opencv-motion-detect/inc/database.h
浏览文件 @
61bccc25
...
@@ -34,6 +34,8 @@ namespace LVDB {
...
@@ -34,6 +34,8 @@ namespace LVDB {
json
*
findConfigModule
(
json
&
config
,
string
sn
,
string
moduleName
,
int
iid
);
json
*
findConfigModule
(
json
&
config
,
string
sn
,
string
moduleName
,
int
iid
);
//
//
int
delValue
(
string
key
,
string
fileName
);
int
delValue
(
string
key
,
string
fileName
);
//
vector
<
string
>
getKeys
(
string
fileName
=
""
);
// sn, updatetime, boottime
// sn, updatetime, boottime
int
setSn
(
json
&
info
,
string
fileName
=
LVDB_FILE_GENERAL
);
int
setSn
(
json
&
info
,
string
fileName
=
LVDB_FILE_GENERAL
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论