add comments
This commit is contained in:
@@ -2827,6 +2827,9 @@ bool compare_qvvr_and_file(const std::string& cfg_path, const std::vector<qvvr_d
|
||||
return false;
|
||||
}
|
||||
|
||||
//打印提取到的时间戳
|
||||
std::cout << "[调试] 提取到的起始时间戳: " << start_tm << ", 触发时间戳: " << trig_tm << "\n";
|
||||
|
||||
// 遍历所有暂态事件,查找与 trig_tm 匹配的
|
||||
for (const auto& data : data_list) {
|
||||
long long diff = static_cast<long long>(data.QVVR_time) - trig_tm;
|
||||
@@ -3067,6 +3070,9 @@ bool SendAllQvvrFiles(qvvr_file& qfile, std::string& out_wavepath) {
|
||||
//文件下载结束接口
|
||||
bool update_qvvr_file_download(const std::string& filename_with_mac, const std::string& terminal_id) {
|
||||
|
||||
std::cout << "[update_qvvr_file_download] filename_with_mac=" << filename_with_mac
|
||||
<< " terminal_id=" << terminal_id << std::endl;
|
||||
|
||||
//台账加锁
|
||||
std::lock_guard<std::mutex> lock(ledgermtx);
|
||||
|
||||
@@ -3093,8 +3099,31 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
|
||||
try {
|
||||
// 将监测点台账中的 logical_device_seq 转换为数字进行匹配
|
||||
ushort monitor_seq = static_cast<ushort>(std::stoi(monitor.logical_device_seq));
|
||||
if (monitor_seq != logical_seq) continue;
|
||||
} catch (...) {
|
||||
if (monitor_seq != logical_seq) {
|
||||
// ★新增:不匹配时对比打印
|
||||
std::cout << "[cmp-monitor-seq][NOT-MATCH]"
|
||||
<< " monitor_id=" << monitor.monitor_id
|
||||
<< " seq_in_ledger=\"" << seq_str << "\""
|
||||
<< " parsed=" << monitor_seq
|
||||
<< " target_seq=" << logical_seq
|
||||
<< std::endl;
|
||||
continue;
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
// ★新增:解析失败详细原因
|
||||
std::cout << "[cmp-monitor-seq][PARSE-FAIL]"
|
||||
<< " monitor_id=" << monitor.monitor_id
|
||||
<< " seq_in_ledger=\"" << monitor.logical_device_seq << "\""
|
||||
<< " err=" << e.what()
|
||||
<< std::endl;
|
||||
continue; // logical_device_seq 非法,跳过
|
||||
}catch (...) {
|
||||
// ★新增:未知异常
|
||||
std::cout << "[cmp-monitor-seq][PARSE-FAIL]"
|
||||
<< " monitor_id=" << monitor.monitor_id
|
||||
<< " seq_in_ledger=\"" << monitor.logical_device_seq << "\""
|
||||
<< " err=<unknown>"
|
||||
<< std::endl;
|
||||
continue; // logical_device_seq 非法,跳过
|
||||
}
|
||||
|
||||
@@ -3108,6 +3137,7 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
|
||||
if (it != qfile.file_name.end()) {
|
||||
// 添加到 file_download(记录完整路径,避免重复)
|
||||
if (std::find(qfile.file_download.begin(), qfile.file_download.end(), filename_with_mac) == qfile.file_download.end()) {
|
||||
std::cout << "[update_qvvr_file_download] Adding downloaded file: " << filename_with_mac << std::endl;
|
||||
qfile.file_download.push_back(filename_with_mac);
|
||||
}
|
||||
|
||||
@@ -3120,8 +3150,16 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
|
||||
s_down.insert(extract_filename1(path)); // 提取每个路径中的文件名
|
||||
}
|
||||
|
||||
//打印s_name和s_down内容
|
||||
std::cout << "[update_qvvr_file_download] Expected files (file_name): ";
|
||||
for (const auto& fn : s_name) std::cout << fn << " ";
|
||||
std::cout << std::endl;
|
||||
std::cout << "[update_qvvr_file_download] Downloaded files (file_download): ";
|
||||
for (const auto& fn : s_down) std::cout << fn << " ";
|
||||
|
||||
// 检查 file_download 是否与 file_name 完全一致(集合相同)
|
||||
if (s_name == s_down) {
|
||||
std::cout << "[update_qvvr_file_download] All files downloaded for qfile in logical_seq=" << logical_seq << std::endl;
|
||||
qfile.is_download = true; // 全部下载完成
|
||||
|
||||
// 找到其中的 .cfg 文件进行匹配
|
||||
@@ -3170,6 +3208,12 @@ bool update_qvvr_file_download(const std::string& filename_with_mac, const std::
|
||||
monitor.qvvrevent.qvvrdata.erase(it);
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cerr << "[update_qvvr_file_download] Failed to send qvvr files for logical_seq=" << logical_seq << std::endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "[update_qvvr_file_download] No matching qvvr_data found for cfg file: " << fpath << std::endl;
|
||||
}
|
||||
break; // 只处理第一个 cfg 文件
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ void process_received_message(string mac, string id,const char* data, size_t len
|
||||
cid, //<2F><EFBFBD><DFBC><EFBFBD><EFBFBD>豸ID<49><44>0-<2D><EFBFBD><DFBC>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1
|
||||
0x04, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<CDB9>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
1, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3>ޡ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʵʱ<CAB5><CAB1>1<EFBFBD><31><EFBFBD><EFBFBD>ͳ<EFBFBD>ơ<EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>
|
||||
1, //<2F><><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1
|
||||
2, //<2F><><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1
|
||||
arr //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
);
|
||||
//std::cout << js << std::en
|
||||
|
||||
Reference in New Issue
Block a user