添加装置重启功能和控制位写入功能

This commit is contained in:
lnk
2026-05-14 16:16:16 +08:00
parent 2f584fda30
commit c6ca57a204
8 changed files with 664 additions and 172 deletions

View File

@@ -4204,6 +4204,18 @@ int terminal_ledger_web(QMap<QString, terminal_dev*>* terminal_dev_map,
return 0; // 确保函数有返回值
}
static void init_oper_type_cache(ied_usr_t *ied_usr)
{
if (ied_usr == NULL)
return;
ied_usr->oper_type_cache.inited = SD_FALSE;
ied_usr->oper_type_cache.ledrs_oper_type_id = -1;
ied_usr->oper_type_cache.reboot_oper_type_id = -1;
ied_usr->oper_type_cache.reset_oper_type_id = -1;
}
int parse_device_cfg_web()
{
std::cout << "parse_device_cfg_web" << endl;
@@ -4437,6 +4449,10 @@ int parse_device_cfg_web()
apr_snprintf(ied_usr->dev_key, sizeof(ied_usr->dev_key), "%s", "");//DEV_Key
cout << "defalut dev_key:" << ied_usr->dev_key << endl;
}
//lnk20260512
init_oper_type_cache(ied_usr);
//lnk20260304
ied_usr->log_level = log_level;//日志等级
cout << "ied_usr->log_level:" << ied_usr->log_level << endl;
@@ -5600,6 +5616,15 @@ int DownloadFileWeb(const std::string& strUrl,
return -1;
}
if (chmod(localpath, 0777) != 0)
{
std::cerr << "chmod 777 failed: " << localpath << std::endl;
}
else
{
std::cout << "chmod 777 success: " << localpath << std::endl;
}
return 0;
}
@@ -5733,6 +5758,9 @@ int update_one_terminal_ledger(terminal* update, int i,ied_t* ied,int terminal_i
chnl_usr->m_state = CHANNEL_DISCONNECTED;
chnl_usr->m_ClosedMsTime = NEXT_CONNECT_TIME * (-1);
//lnk20260512
init_oper_type_cache(ied_usr);
// 将 monitorData 中的数据写入到 LD_info 中
int count_real_monitor = 0; //遍历监测点台账的计数器
int j;