From 8fa931b74e07ea783fa453367174f8b012e7bc52 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 10 十月 2024 19:18:56 +0800 Subject: [PATCH] 取图片、点位导入 --- ycl-server/src/main/java/com/ycl/api/YS/YSInit.java | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/api/YS/YSInit.java b/ycl-server/src/main/java/com/ycl/api/YS/YSInit.java index 7bb5de6..3d84792 100644 --- a/ycl-server/src/main/java/com/ycl/api/YS/YSInit.java +++ b/ycl-server/src/main/java/com/ycl/api/YS/YSInit.java @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import javax.swing.*; import java.io.File; @Component @@ -18,11 +19,12 @@ @Value("${spring.profiles.active}") private String activeEnv; - public static NetDEVSDKLib netdevsdk = NetDEVSDKLib.NETDEVSDK_INSTANCE; + public static NetDEVSDKLib netdevsdk; public static String strPicturePath = "."+File.separator+"Picture"+File.separator; @PostConstruct void init() { if("prod".equals(activeEnv)) { + netdevsdk = NetDEVSDKLib.NETDEVSDK_INSTANCE; String strLogPath = "./sdklog/"; boolean bRet = netdevsdk.NETDEV_SetLogPath(strLogPath); if(false == bRet){ @@ -34,17 +36,25 @@ System.out.printf("Initialize failed:%d", netdevsdk.NETDEV_GetLastError()); return; } - try { - Common.updateStructureByReferenceMethod = Structure.class.getDeclaredMethod("updateStructureByReference", Class.class, Structure.class, Pointer.class); - Common.updateStructureByReferenceMethod.setAccessible(true); - } catch (Exception e) { - throw new RuntimeException(e); - } +// try { +// Common.updateStructureByReferenceMethod = Structure.class.getDeclaredMethod("updateStructureByReference", Class.class, Structure.class, Pointer.class); +// Common.updateStructureByReferenceMethod.setAccessible(true); +// } catch (Exception e) { +// throw new RuntimeException(e); +// } - File file=new File(strPicturePath); - if(!file.exists()){ - file.mkdir(); - } +// File file=new File(strPicturePath); +// if(!file.exists()){ +// file.mkdir(); +// } + + NetDEVSDKLib.NETDEV_REV_TIMEOUT_S pstRevTimeout=new NetDEVSDKLib.NETDEV_REV_TIMEOUT_S(); + pstRevTimeout.dwRevTimeOut=3; + pstRevTimeout.dwFileReportTimeOut=30; + pstRevTimeout.write(); + boolean rbet1=netdevsdk.NETDEV_SetRevTimeOut(pstRevTimeout); + boolean rbet2=netdevsdk.NETDEV_SetConnectTime(3, 1); + } } -- Gitblit v1.8.0