From 08b6a55a3a111aaee9842999b85afa60b6d61dc3 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期四, 14 十一月 2024 15:29:38 +0800 Subject: [PATCH] 大华及海康摄像头截图功能开发 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/collector/OpcUaCollector.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/collector/OpcUaCollector.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/collector/OpcUaCollector.java index 306e4b2..4eeff2e 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/collector/OpcUaCollector.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/collector/OpcUaCollector.java @@ -64,9 +64,15 @@ return opcUaClient; } - public String getTagValue(String sourceId, String tagNo) throws Exception { - OpcUaClient opcUaClient = this.getClient(sourceId); - String value = OpcUaUtils.readNode(opcUaClient, tagNo); + public String getTagValue(String sourceId, String tagNo) { + String value = CommonConstant.BAD_VALUE.toString(); + try{ + OpcUaClient opcUaClient = this.getClient(sourceId); + value = OpcUaUtils.readNode(opcUaClient, tagNo); + }catch (Exception ex){ + ex.printStackTrace(); + return value; + } return value; } -- Gitblit v1.9.3