From c049c2fdf2f5722e460d0dc5c7597bf819f2e2e5 Mon Sep 17 00:00:00 2001
From: LWQ <1806950222@qq.com>
Date: 星期四, 07 八月 2025 18:18:56 +0800
Subject: [PATCH] 添加缺陷原图保存功能

---
 EdgeInspector_App/WebSocket/WebSocketClient.cpp |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/EdgeInspector_App/WebSocket/WebSocketClient.cpp b/EdgeInspector_App/WebSocket/WebSocketClient.cpp
index 84ef4b0..8f03469 100644
--- a/EdgeInspector_App/WebSocket/WebSocketClient.cpp
+++ b/EdgeInspector_App/WebSocket/WebSocketClient.cpp
@@ -1,13 +1,13 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
 #include "WebSocketClient.h"
 
 //WebSocketClient::WebSocketClient() : m_connected(false), m_reconnect(true), m_close_done(false), m_message_received(false), m_heartbeat_interval(5) {
-//    // 清除之前的客户端配置并重新初始化
+//    // 娓呴櫎涔嬪墠鐨勫鎴风閰嶇疆骞堕噸鏂板垵濮嬪寲
 //    m_client.clear_access_channels(websocketpp::log::alevel::all);
 //    m_client.clear_error_channels(websocketpp::log::elevel::all);
 //    m_client.init_asio();
 //
-//    // 设置事件回调
+//    // 璁剧疆浜嬩欢鍥炶皟
 //    m_client.set_open_handler([this](websocketpp::connection_hdl hdl) { on_open(hdl); });
 //    m_client.set_message_handler([this](websocketpp::connection_hdl hdl, message_ptr msg) { on_message(hdl, msg); });
 //    m_client.set_close_handler([this](websocketpp::connection_hdl hdl) { on_close(hdl); });
@@ -27,7 +27,7 @@
 //        m_client.clear_access_channels(websocketpp::log::alevel::all);
 //        m_client.clear_error_channels(websocketpp::log::elevel::all);
 //
-//        std::lock_guard<std::mutex> lock(m_mutex);  // 保护共享资源
+//        std::lock_guard<std::mutex> lock(m_mutex);  // 淇濇姢鍏变韩璧勬簮
 //        auto con = m_client.get_connection(uri, ec);
 //
 //        if (ec) {
@@ -39,7 +39,7 @@
 //        m_client.connect(con);
 //    }
 //
-//    // 启动工作线程
+//    // 鍚姩宸ヤ綔绾跨▼
 //    m_thread = std::thread(&WebSocketClient::run, this);
 //}
 //
@@ -95,9 +95,9 @@
 //        std::string message = m_message_queue.front();
 //        m_message_queue.pop();
 //
-//        send(message); // 发送消息
+//        send(message); // 鍙戦�佹秷鎭�
 //
-//        set_busy(false); // 设置为空闲状态,并处理下一个
+//        set_busy(false); // 璁剧疆涓虹┖闂茬姸鎬侊紝骞跺鐞嗕笅涓�涓�
 //        process_next_message();
 //    }
 //}
@@ -108,9 +108,9 @@
 //        std::vector<char> binary_data = m_binary_queue.front();
 //        m_binary_queue.pop();
 //
-//        send_binary(binary_data); // 发送二进制数据
+//        send_binary(binary_data); // 鍙戦�佷簩杩涘埗鏁版嵁
 //
-//        set_busy(false); // 设置为空闲状态,并处理下一个
+//        set_busy(false); // 璁剧疆涓虹┖闂茬姸鎬侊紝骞跺鐞嗕笅涓�涓�
 //        process_next_binary();
 //    }
 //}
@@ -120,7 +120,7 @@
 //    m_message_received = false;
 //
 //    if (m_connected.load()) {
-//        // 发送消息
+//        // 鍙戦�佹秷鎭�
 //        websocketpp::lib::error_code ec;
 //        m_client.send(m_hdl, message, websocketpp::frame::opcode::text, ec);
 //        if (ec) {
@@ -128,7 +128,7 @@
 //            return false;
 //        }
 //
-//        // 等待消息或超时
+//        // 绛夊緟娑堟伅鎴栬秴鏃�
 //        if (m_cv.wait_for(lock, std::chrono::milliseconds(timeout_ms), [this]() { return m_message_received; })) {
 //            std::cout << "Server response received." << std::endl;
 //            return true;
@@ -148,7 +148,7 @@
 //    m_message_received = false;
 //
 //    if (m_connected.load()) {
-//        // 发送消息
+//        // 鍙戦�佹秷鎭�
 //        websocketpp::lib::error_code ec;
 //        m_client.send(m_hdl, binary_data.data(), binary_data.size(), websocketpp::frame::opcode::binary, ec);
 //        if (ec) {
@@ -156,7 +156,7 @@
 //            return false;
 //        }
 //
-//        // 等待消息或超时
+//        // 绛夊緟娑堟伅鎴栬秴鏃�
 //        if (m_cv.wait_for(lock, std::chrono::milliseconds(timeout_ms), [this]() { return m_message_received; })) {
 //            std::cout << "Server response received." << std::endl;
 //            return true;
@@ -275,29 +275,29 @@
 //    }
 //
 //    m_message_received = true;
-//    m_cv.notify_one();  // 唤醒等待线程
+//    m_cv.notify_one();  // 鍞ら啋绛夊緟绾跨▼
 //}
 //
 //void WebSocketClient::on_close(connection_hdl hdl) {
 //    std::cout << "Connection closed." << std::endl;
 //    std::lock_guard<std::mutex> lock(m_mutex);
 //
-//    m_hdl.reset();  // 清空连接句柄
+//    m_hdl.reset();  // 娓呯┖杩炴帴鍙ユ焺
 //    m_connected.store(false);
 //    if (m_close_handler) {
 //        m_close_handler();
 //    }
 //
-//    // 如果需要重连
+//    // 濡傛灉闇�瑕侀噸杩�
 //    if (m_reconnect.load()) {
 //
-//        // 停止当前运行的事件循环
+//        // 鍋滄褰撳墠杩愯鐨勪簨浠跺惊鐜�
 //        //m_client.stop();
 //        //if (m_thread.joinable()) {
 //        //    m_thread.join();
 //        //}
 //        std::cerr << "Connection lost. Attempting to reconnect..." << std::endl;
-//        //reconnect();  // 启动重连机制
+//        //reconnect();  // 鍚姩閲嶈繛鏈哄埗
 //    }
 //    else {
 //        m_cv.notify_one();

--
Gitblit v1.9.3