Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liusq
gamera_videos_no_ui
Commits
c5b71a6e
Commit
c5b71a6e
authored
Feb 20, 2025
by
guof
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-1007583' into 'release'
Feature 1007583 See merge request
!96
parents
aa008706
5bc2edc1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
25 deletions
+38
-25
mainwindow.cpp
+36
-25
mainwindow.h
+2
-0
No files found.
mainwindow.cpp
View file @
c5b71a6e
...
@@ -30,23 +30,9 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -30,23 +30,9 @@ MainWindow::MainWindow():isResetting(false)
}
else
{
}
else
{
httpurl
=
qSetting
->
value
(
"cloudservice/pro_http"
).
toString
();
httpurl
=
qSetting
->
value
(
"cloudservice/pro_http"
).
toString
();
}
}
Common
&
instace
=
Common
::
getInstance
();
QString
serialNumber
;
QString
serialNumber
;
findLocalSerialNumber
(
serialNumber
);
realTimeUpdateDivConfig
(
httpurl
,
serialNumber
);
bool
configFetched
=
false
;
while
(
!
configFetched
)
{
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
res
=
httpService
.
httpDeviceConfig
(
serialNumber
,
config
);
if
(
res
->
code
!=
0
)
{
qInfo
()
<<
"请求远程商户配置失败,重试中..."
;
instace
.
deleteObj
(
res
);
QThread
::
sleep
(
5
);
// 等待5秒后重试
}
else
{
instace
.
deleteObj
(
res
);
configFetched
=
true
;
}
}
initCommon
();
initCommon
();
...
@@ -143,6 +129,26 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -143,6 +129,26 @@ MainWindow::MainWindow():isResetting(false)
this
->
mqttConfig
=
config
.
mqttConfig
;
this
->
mqttConfig
=
config
.
mqttConfig
;
runOrRebootMqtt
(
mqttConfig
,
httpurl
,
serialNumber
);
runOrRebootMqtt
(
mqttConfig
,
httpurl
,
serialNumber
);
}
}
void
MainWindow
::
realTimeUpdateDivConfig
(
QString
&
httpurl
,
QString
&
serialNumber
){
Common
&
instace
=
Common
::
getInstance
();
findLocalSerialNumber
(
serialNumber
);
bool
configFetched
=
false
;
while
(
!
configFetched
)
{
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
res
=
httpService
.
httpDeviceConfig
(
serialNumber
,
config
);
if
(
res
->
code
!=
0
)
{
qInfo
()
<<
"请求远程商户配置失败,重试中..."
;
instace
.
deleteObj
(
res
);
QThread
::
sleep
(
5
);
// 等待5秒后重试
}
else
{
instace
.
deleteObj
(
res
);
configFetched
=
true
;
}
}
}
void
MainWindow
::
runOrRebootMqtt
(
vides_data
::
MqttConfig
&
mqtt_config
,
QString
&
httpUrl
,
QString
&
serialNumber
){
void
MainWindow
::
runOrRebootMqtt
(
vides_data
::
MqttConfig
&
mqtt_config
,
QString
&
httpUrl
,
QString
&
serialNumber
){
MqttSubscriber
*
subscriber
=
MqttSubscriber
::
getInstance
(
this
);
MqttSubscriber
*
subscriber
=
MqttSubscriber
::
getInstance
(
this
);
subscriber
->
init
(
mqtt_config
,
httpUrl
,
serialNumber
);
subscriber
->
init
(
mqtt_config
,
httpUrl
,
serialNumber
);
...
@@ -189,6 +195,7 @@ bool MainWindow::getDeviceStatus(int UserId) {
...
@@ -189,6 +195,7 @@ bool MainWindow::getDeviceStatus(int UserId) {
}
}
return
devStatus
;
return
devStatus
;
}
}
void
MainWindow
::
divParameterUpdate
(
vides_data
::
responseConfig
&
cloudConfig
,
QString
&
httpUrl
,
QString
&
serialNumber
){
void
MainWindow
::
divParameterUpdate
(
vides_data
::
responseConfig
&
cloudConfig
,
QString
&
httpUrl
,
QString
&
serialNumber
){
bool
faceAlgorithm
=
false
,
licensePlateAlgorithm
=
false
,
uniformAlgorithm
=
false
,
timeChange
=
false
;
bool
faceAlgorithm
=
false
,
licensePlateAlgorithm
=
false
,
uniformAlgorithm
=
false
,
timeChange
=
false
;
AlgorithmTaskManage
&
algorithmTaskManage
=
AlgorithmTaskManage
::
getInstance
();
AlgorithmTaskManage
&
algorithmTaskManage
=
AlgorithmTaskManage
::
getInstance
();
...
@@ -582,16 +589,6 @@ void MainWindow::startCamera(const QString &httpurl){
...
@@ -582,16 +589,6 @@ void MainWindow::startCamera(const QString &httpurl){
HttpService
httpService
(
httpurl
);
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
re
=
httpService
.
httpFindCameras
(
serialNumber
,
devices
);
vides_data
::
response
*
re
=
httpService
.
httpFindCameras
(
serialNumber
,
devices
);
if
(
config
.
nvrConfig
.
isOn
&&
!
getDeviceStatus
(
hk_Device
)
){
int
res
=
loginNetDvr
(
config
.
nvrConfig
.
ip
,
config
.
nvrConfig
.
username
,
config
.
nvrConfig
.
password
,
config
.
nvrConfig
.
port
);
if
(
res
<
0
){
nvr_status
=
false
;
}
else
{
nvr_status
=
true
;
}
}
else
if
(
!
config
.
nvrConfig
.
isOn
){
nvr_status
=
false
;
}
if
(
re
->
code
==
0
||
re
->
code
==
20004
){
if
(
re
->
code
==
0
||
re
->
code
==
20004
){
//本次搜索到设备列表
//本次搜索到设备列表
...
@@ -616,6 +613,20 @@ void MainWindow::startCamera(const QString &httpurl){
...
@@ -616,6 +613,20 @@ void MainWindow::startCamera(const QString &httpurl){
instace
.
deleteObj
(
res_config
);
instace
.
deleteObj
(
res_config
);
return
;
return
;
}
}
config
.
nvrConfig
=
cloudConfig
.
nvrConfig
;
if
(
config
.
nvrConfig
.
isOn
&&
!
getDeviceStatus
(
hk_Device
)
){
int
res
=
loginNetDvr
(
config
.
nvrConfig
.
ip
,
config
.
nvrConfig
.
username
,
config
.
nvrConfig
.
password
,
config
.
nvrConfig
.
port
);
if
(
res
<
0
){
nvr_status
=
false
;
}
else
{
nvr_status
=
true
;
}
}
else
if
(
!
config
.
nvrConfig
.
isOn
){
nvr_status
=
false
;
}
instace
.
deleteObj
(
res_config
);
instace
.
deleteObj
(
res_config
);
divParameterUpdate
(
cloudConfig
,
nonConstHttpUrl
,
serialNumber
);
divParameterUpdate
(
cloudConfig
,
nonConstHttpUrl
,
serialNumber
);
...
...
mainwindow.h
View file @
c5b71a6e
...
@@ -53,6 +53,8 @@ public:
...
@@ -53,6 +53,8 @@ public:
CameraHandle
*
findHandle
(
QString
sn
);
CameraHandle
*
findHandle
(
QString
sn
);
void
realTimeUpdateDivConfig
(
QString
&
httpurl
,
QString
&
serialNumber
);
bool
getDeviceStatus
(
int
UserId
);
bool
getDeviceStatus
(
int
UserId
);
void
modifySnMapIp
(
QString
&
sn
,
QString
&
ip
);
void
modifySnMapIp
(
QString
&
sn
,
QString
&
ip
);
...
...
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