Commit 5bc2edc1 by “liusq”

修改实时更新远程配置01

parent eb684c5f
......@@ -195,6 +195,7 @@ bool MainWindow::getDeviceStatus(int UserId) {
}
return devStatus;
}
void MainWindow::divParameterUpdate(vides_data::responseConfig &cloudConfig,QString &httpUrl,QString &serialNumber ){
bool faceAlgorithm = false, licensePlateAlgorithm = false, uniformAlgorithm = false, timeChange = false;
AlgorithmTaskManage &algorithmTaskManage= AlgorithmTaskManage::getInstance();
......@@ -585,22 +586,9 @@ void MainWindow::startCamera(const QString &httpurl){
qInfo()<<"盒子获取mac失败";
}
reStatus.mac=std::move(is_mac);
realTimeUpdateDivConfig(nonConstHttpUrl,serialNumber);
HttpService httpService(httpurl);
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){
//本次搜索到设备列表
......@@ -625,6 +613,20 @@ void MainWindow::startCamera(const QString &httpurl){
instace.deleteObj(res_config);
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);
divParameterUpdate(cloudConfig,nonConstHttpUrl,serialNumber);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment