From 3c89dbf9bd3d064787f34d52e8ef29a803945e85 Mon Sep 17 00:00:00 2001 From: admin <52323@qq.com> Date: 星期五, 15 九月 2023 11:37:26 +0800 Subject: [PATCH] 测试加密 --- springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java | 25 ++++++++++++++----------- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java index b641602..c7f169c 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java @@ -16,19 +16,22 @@ } List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.DBX0.0", 58); + if (plclist == null) { - JSONObject jsonObject = new JSONObject(); - // jsonObject3.append("sig", - // new short[] { 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - // 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, - // 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - // }); - jsonObject.append("sig", plclist); - WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign"); - if (sendwServer3 != null) { - sendwServer3.sendMessage(jsonObject.toString()); + } else { + JSONObject jsonObject = new JSONObject(); + // jsonObject3.append("sig", + // new short[] { 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + // 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + // 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + // }); + jsonObject.append("sig", plclist); + WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign"); + if (sendwServer3 != null) { + sendwServer3.sendMessage(jsonObject.toString()); + } + } - } } } -- Gitblit v1.8.0