From c8c780b97726264b39ceae192239c4cd46380134 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 29 八月 2024 12:00:18 +0800
Subject: [PATCH] 工单取图片多线程
---
ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java b/ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java
index 3b81c95..5ad0cbb 100644
--- a/ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java
+++ b/ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java
@@ -2,14 +2,14 @@
import com.sun.jna.Native;
import com.sun.jna.Pointer;
+import com.sun.jna.ptr.IntByReference;
import com.ycl.api.DH.lib.NetSDKLib;
import com.ycl.api.DH.lib.NetSDKLib.LLong;
import com.ycl.api.DH.lib.NetSDKLib.NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY;
import com.ycl.api.DH.lib.NetSDKLib.NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY;
import com.ycl.api.DH.lib.ToolKits;
-import com.ycl.api.DH.lib.structure.NET_CFG_GBMODE_INFO;
-import com.ycl.api.DH.lib.structure.NET_GBMODE_CUSTOMTITLE_INFO;
-import com.ycl.api.DH.lib.structure.NET_TITLE_OSD_INFO;
+import com.ycl.api.DH.lib.structure.*;
+import com.ycl.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
@@ -166,31 +166,28 @@
System.err.println("CLIENT_QueryDeviceTime Failed!" + ToolKits.getErrorCodePrint());
return null;
}
- NetSDKLib.NET_OSD_CUSTOM_TITLE custom_title = new NetSDKLib.NET_OSD_CUSTOM_TITLE();
String date = deviceTime.toStringTime();
date = date.replace("/", "-");
log.info("鎴愬姛鑾峰彇妫�娴媜sd鏃堕棿" + date);
+
+ NET_CFG_GBMODE_INFO reserve = new NET_CFG_GBMODE_INFO();
+
NET_CFG_GBMODE_INFO osdInfo = new NET_CFG_GBMODE_INFO();
osdInfo.write();
- Pointer pointer = osdInfo.getPointer();
- boolean b = netsdk.CLIENT_GetConfig(m_hLoginHandle, NET_EM_CFG_CUSTOMTITLE, 0, custom_title.getPointer(), 1024, 3000, null);
-// log.info("osd缁撴灉,鑷畾涔夋爣棰樹俊鎭湁鏁堜釜鏁帮細{}锛屾槸鍚﹀彔鍔犲埌棰勮鏄剧ず{}锛屾槸鍚﹀彔鍔犲埌涓荤爜娴佽棰戠紪鐮亄}" ,osdInfo.nCustomTitleNum,osdInfo.bPreviewBlend,osdInfo.bEncodeBlend);
- if(!b){
- log.info("璋冪敤澶辫触");
- }else {
+ boolean b = netsdk.CLIENT_GetConfig(m_hLoginHandle, NET_EM_CFG_GBMODE, 0, osdInfo.getPointer(), osdInfo.size(), 3000, reserve.getPointer());
+ if (!b) {
+ log.info(("CLIENT_GetConfig Failed!" + ToolKits.getErrorCodePrint()));
+ } else {
osdInfo.read();
- log.info("osd缁撴灉,鑷畾涔夋爣棰樹俊鎭湁鏁堜釜鏁帮細{}锛屾槸鍚﹀彔鍔犲埌棰勮鏄剧ず{}锛屾槸鍚﹀彔鍔犲埌涓荤爜娴佽棰戠紪鐮亄}" ,osdInfo.nCustomTitleNum,osdInfo.bPreviewBlend,osdInfo.bEncodeBlend);
NET_GBMODE_CUSTOMTITLE_INFO[] stuCustomTitle = osdInfo.stuCustomTitle;
for (NET_GBMODE_CUSTOMTITLE_INFO title : stuCustomTitle) {
NET_TITLE_OSD_INFO[] stuOSD = title.stuOSD;
for (NET_TITLE_OSD_INFO osd : stuOSD) {
String osdStr = null;
- log.info("----->"+ Arrays.toString(osd.szText));
- try {
- osdStr = new String(osd.szText, "GBK");
- } catch (UnsupportedEncodingException e) {
+ osdStr = new String(osd.szText, StandardCharsets.UTF_8);
+ if (!StringUtils.isEmpty(osdStr)) {
+ log.info("osd浜岀骇鏂囨湰" + osdStr);
}
- log.info("osd浜岀骇鏂囨湰" + osd+osdStr);
}
}
}
--
Gitblit v1.8.0