From 536ba9c36bc53201cfbafb7a1063f119a2ee3a1d Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期四, 30 十一月 2023 09:40:44 +0800 Subject: [PATCH] 更新主界面 --- springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java index fc93c23..08e7f66 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java @@ -86,17 +86,18 @@ Short[] values2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; List<Short> state = new ArrayList<>(Arrays.asList(values2)); - Boolean[] values = { false, true, true, true, true, true, true, true, true, - true, true, true, true, true, true, true, true, true, true, true, true, true, true, - true, false, true }; - List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values)); + // Boolean[] values = { false, true, true, true, true, true, true, true, true, + // true, true, true, true, true, true, true, true, true, true, true, true, true, + // true, + // true, false, true }; + // List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values)); - short[] sholist = new short[paramlist.size()]; + // short[] sholist = new short[paramlist.size()]; - for (int i = 0; i < paramlist.size(); i++) { - boolean value = paramlist.get(i); - sholist[i] = value ? (short) 1 : (short) 0; - } + // for (int i = 0; i < paramlist.size(); i++) { + // boolean value = paramlist.get(i); + // sholist[i] = value ? (short) 1 : (short) 0; + // } JSONObject jsonObject = new JSONObject(); // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5} @@ -104,7 +105,7 @@ jsonObject.append("params", arraylist); jsonObject.append("state", state); - jsonObject.append("action", sholist); + // jsonObject.append("action", sholist); WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter"); if (sendwServer != null) { sendwServer.sendMessage(jsonObject.toString()); @@ -136,7 +137,7 @@ } // 灏嗘秷鎭�煎啓鍏� PLC -// S7control.getinstance().WriteWord(addressList, messageValues); + // S7control.getinstance().WriteWord(addressList, messageValues); System.out.println("messageValues锛�" + messageValues); System.out.println("addressList锛�" + addressList); // 娓呯┖娑堟伅鍒楄〃 -- Gitblit v1.8.0