fix comtrade file pair
This commit is contained in:
@@ -3320,7 +3320,11 @@ bool update_qvvr_file_download(const std::string& filename_with_mac_in, const st
|
|||||||
// 找到其中的 .cfg 文件进行匹配
|
// 找到其中的 .cfg 文件进行匹配
|
||||||
for (const auto& fpath : qfile.file_download) {
|
for (const auto& fpath : qfile.file_download) {
|
||||||
std::string fname = extract_filename1(fpath);
|
std::string fname = extract_filename1(fpath);
|
||||||
if (fname.size() >= 4 && fname.substr(fname.size() - 4) == ".cfg") {
|
if (fname.size() >= 4) {
|
||||||
|
std::string ext = fname.substr(fname.size() - 4);
|
||||||
|
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
|
||||||
|
if (ext == ".cfg") {
|
||||||
|
//if (fname.size() >= 4 && fname.substr(fname.size() - 4) == ".cfg") {
|
||||||
// 提取文件时标和监测点事件的时标匹配
|
// 提取文件时标和监测点事件的时标匹配
|
||||||
qvvr_data matched;
|
qvvr_data matched;
|
||||||
if (compare_qvvr_and_file(fpath, monitor.qvvrevent.qvvrdata,matched)) {
|
if (compare_qvvr_and_file(fpath, monitor.qvvrevent.qvvrdata,matched)) {
|
||||||
@@ -3404,9 +3408,14 @@ bool update_qvvr_file_download(const std::string& filename_with_mac_in, const st
|
|||||||
else {
|
else {
|
||||||
std::cout << "[update_qvvr_file_download] No matching qvvr_data found for cfg file: " << fpath << std::endl;
|
std::cout << "[update_qvvr_file_download] No matching qvvr_data found for cfg file: " << fpath << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
break; // 只处理第一个 cfg 文件
|
break; // 只处理第一个 cfg 文件
|
||||||
|
}//end if ext==.cfg
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
std::cout << "[update_qvvr_file_download] Filename too short to check extension: " << fname << std::endl;
|
||||||
}
|
}
|
||||||
|
}//end for file_download
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
std::cout << "qvvr file still imcomplete!!!" << std::endl;
|
std::cout << "qvvr file still imcomplete!!!" << std::endl;
|
||||||
@@ -3414,12 +3423,12 @@ bool update_qvvr_file_download(const std::string& filename_with_mac_in, const st
|
|||||||
lock.unlock();
|
lock.unlock();
|
||||||
return true; // 当前文件处理成功
|
return true; // 当前文件处理成功
|
||||||
}
|
}
|
||||||
}
|
}//end for qvvrfile
|
||||||
|
|
||||||
std::cout << "file name doesnt match any file in this monitor!!!" << std::endl;
|
std::cout << "file name doesnt match any file in this monitor!!!" << std::endl;
|
||||||
|
|
||||||
}
|
}//end for monitor
|
||||||
}
|
}//end for dev
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
return false; // 未匹配到终端ID或逻辑序号对应的监测点
|
return false; // 未匹配到终端ID或逻辑序号对应的监测点
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user