add comments

This commit is contained in:
lnk
2025-08-04 13:28:51 +08:00
parent 868de7a909
commit 0eab1e6fb5

View File

@@ -2833,21 +2833,21 @@ bool assign_qvvr_file_list(const std::string& id, ushort nCpuNo, const std::vect
// 2. 遍历终端
for (auto& dev : terminal_devlist) {
if (dev.terminal_id == id) {
if (dev.terminal_id == id) { //根据终端id匹配终端
for (auto& monitor : dev.line) {
try {
ushort monitor_seq = static_cast<ushort>(std::stoi(monitor.logical_device_seq));
if (monitor_seq == nCpuNo) {
if (monitor_seq == nCpuNo) { //根据监测点编号匹配监测点
// 构造 qvvr_file
qvvr_file qfile;
qfile.file_name.assign(file_names.begin(), file_names.end());
qfile.file_name.assign(file_names.begin(), file_names.end()); //终端文件列表
qfile.is_download = false;
qfile.is_pair = false;
qfile.file_time_count = 0; // 可后续补充
qfile.file_time_count = 0;
qfile.file_start =false;
// 添加到唯一的 qvvrevent
monitor.qvvrevent.qvvrfile.push_back(std::move(qfile));
monitor.qvvrevent.qvvrfile.push_back(std::move(qfile)); //记录暂态文件组
return true;
}
} catch (...) {
@@ -2871,7 +2871,7 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
size_t under_pos = filename.find('_');
if (under_pos == std::string::npos) return false;
std::string type_part = filename.substr(0, under_pos); // e.g. PQMonitor_PQM1
std::string type_part = filename.substr(0, under_pos); //PQMonitor_PQM1
size_t num_start = type_part.find_last_not_of("0123456789");
if (num_start == std::string::npos || num_start + 1 >= type_part.size()) return false;
@@ -2899,13 +2899,13 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
}
qfile.file_time_count = 0;
qfile.file_start = true;
qfile.file_start = true; //开始下载文件
// 检查 file_download 是否与 file_name 完全一致(集合相同)
// 检查 file_download 是否与 file_name 完全一致(集合相同)//每次下载都会对比
std::set<std::string> s_name(qfile.file_name.begin(), qfile.file_name.end());
std::set<std::string> s_down(qfile.file_download.begin(), qfile.file_download.end());
if (s_name == s_down) {
qfile.is_download = true;
qfile.is_download = true; //全部下载完成
// 找到其中的 .cfg 文件进行匹配
for (const auto& f : qfile.file_download) {
@@ -2913,7 +2913,9 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
if (compare_qvvr_and_file(f)) {//提取文件时标和监测点事件的时标匹配
qfile.is_pair = true;
//发送所有文件
//发送暂态事件
}
break; // 只处理第一个 cfg 文件
}