From 334b16b4abb4cbe3d1d4e4f211efd6f4468ae09f Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 19 九月 2025 15:12:52 +0800
Subject: [PATCH] 1.ControlJob和ProcessJob的中断操作,强制结批增加字符串描述原因,方便生产跟踪。
---
SourceCode/Bond/Servo/CPageGlassList.cpp | 63 ++++++++++++++++++++++++++-----
1 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/SourceCode/Bond/Servo/CPageGlassList.cpp b/SourceCode/Bond/Servo/CPageGlassList.cpp
index 38d93d3..4291a7e 100644
--- a/SourceCode/Bond/Servo/CPageGlassList.cpp
+++ b/SourceCode/Bond/Servo/CPageGlassList.cpp
@@ -8,12 +8,12 @@
#include "GlassJson.h"
#include "CServoUtilsTool.h"
#include "ToolUnits.h"
-
#include <optional>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <string>
+#include "CProcessDataListDlg.h"
#define PAGE_SIZE 50
#define PAGE_BACKGROUND_COLOR RGB(252, 252, 255)
@@ -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)
@@ -403,7 +436,7 @@
}
// ===== CPageGlassList 娑堟伅澶勭悊绋嬪簭 =====
-void CPageGlassList::InitRxWindow()
+void CPageGlassList::InitRxWindows()
{
// 璁㈤槄鏁版嵁
IRxWindows* pRxWindows = RX_GetRxWindows();
@@ -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;
@@ -833,8 +866,8 @@
CString headers[] = {
_T(""),
_T("id"),
- _T("Cassette Sequence No"),
- _T("Job Sequence No"),
+ _T("Cassette SN"),
+ _T("Job SN"),
_T("Class ID"),
_T("鐗╂枡绫诲瀷"),
_T("鐘舵��"),
@@ -913,7 +946,7 @@
{
if (nIDEvent == 1) {
KillTimer(1);
- InitRxWindow();
+ InitRxWindows();
}
else if (nIDEvent == 2) {
UpdateWipData(); // 鍙仛澧為噺锛屼笉閲嶅缓
@@ -1032,10 +1065,11 @@
{
auto* p = reinterpret_cast<NMC_ELC_SHOWFULLTEXT*>(pNMHDR);
- // 杩欓噷鏆傛椂鐢ㄦ秷鎭鏄剧ず锛涘悗缁彲鎹㈡垚浣犵殑璇︽儏椤�
- CString strNewMsg = p->text;
- strNewMsg.Replace(_T(","), _T("\n"));
- MessageBox(strNewMsg, _T("璇︾粏淇℃伅"), MB_OK | MB_ICONINFORMATION);
+ // 瀵硅瘽妗嗘樉绀哄伐鑹哄弬鏁�
+ CProcessDataListDlg dlg;
+ dlg.setRawText(p->text);
+ dlg.DoModal();
+
*pResult = 0;
}
@@ -1362,3 +1396,12 @@
return true;
}
+
+BOOL CPageGlassList::PreTranslateMessage(MSG* pMsg)
+{
+ if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) {
+ return TRUE;
+ }
+
+ return CDialogEx::PreTranslateMessage(pMsg);
+}
--
Gitblit v1.9.3