From 3a9d54f7454c6085cdd9fde71ea8e321b9ac0402 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 12 九月 2025 11:50:01 +0800
Subject: [PATCH] 1.PanelDataReport事件上抛,以便上层检测到AOI 检测NG后停机; 2.CessetteSn种子数设定,保存到配置,以便程序关闭重开后,CessetteSn也能继续; 3.AOI增加工艺参数,修改解释规则;

---
 SourceCode/Bond/Servo/CPageGlassList.cpp |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/SourceCode/Bond/Servo/CPageGlassList.cpp b/SourceCode/Bond/Servo/CPageGlassList.cpp
index 38d93d3..fd107a7 100644
--- a/SourceCode/Bond/Servo/CPageGlassList.cpp
+++ b/SourceCode/Bond/Servo/CPageGlassList.cpp
@@ -340,6 +340,39 @@
     }
 }
 
+bool CopyUtf8ToClipboard(const std::string& utf8)
+{
+    // 1) UTF-8 -> UTF-16 闀垮害锛堝惈缁撳熬 '\0'锛�
+    int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, nullptr, 0);
+    if (wlen <= 0) return false;
+
+    // 2) 涓哄壀璐存澘鍒嗛厤鍏ㄥ眬鍙Щ鍔ㄥ唴瀛橈紙蹇呴』 GMEM_MOVEABLE锛�
+    SIZE_T bytes = static_cast<SIZE_T>(wlen) * sizeof(wchar_t);
+    HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, bytes);
+    if (!hMem) return false;
+
+    // 3) 濉厖 UTF-16 鏂囨湰
+    wchar_t* wbuf = static_cast<wchar_t*>(GlobalLock(hMem));
+    if (!wbuf) { GlobalFree(hMem); return false; }
+    MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, wbuf, wlen);
+    GlobalUnlock(hMem);
+
+    // 4) 鎵撳紑鍓创鏉垮苟璁剧疆鏁版嵁锛圕F_UNICODETEXT锛�
+    if (!OpenClipboard(nullptr)) { GlobalFree(hMem); return false; }
+    if (!EmptyClipboard()) { CloseClipboard(); GlobalFree(hMem); return false; }
+
+    // 鎴愬姛鍚庯紝鍐呭瓨鎵�鏈夋潈浜ょ粰鍓创鏉匡紝涓嶈兘鍐� GlobalFree
+    if (!SetClipboardData(CF_UNICODETEXT, hMem)) {
+        CloseClipboard();
+        GlobalFree(hMem);
+        return false;
+    }
+
+    CloseClipboard();
+    return true;
+}
+
+
 // CPageGlassList 瀵硅瘽妗�
 
 IMPLEMENT_DYNAMIC(CPageGlassList, CDialogEx)
@@ -673,7 +706,7 @@
     // -------- Phase 1: 鍏堝鐞嗏�滄湁 buddyId 鐨勮褰曗�濓紙鑳介厤灏遍厤锛涘崟鍚戜篃閰嶏級 ----------
     for (size_t i = 0; i < page.items.size(); ++i) {
         const auto& r = page.items[i];
-        AfxMessageBox(r.pretty.c_str());
+        // CopyUtf8ToClipboard(r.pretty);
         
         if (consumed.count(r.classId)) continue;
         if (r.buddyId.empty()) continue;

--
Gitblit v1.9.3