From 3c74551a7f5d9f2ead6cc4a22fe8a7ec4696d8f5 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期四, 30 十一月 2023 08:16:35 +0800
Subject: [PATCH] 完善主界面功能,添加手动任务到出片队列

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 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 31e5f05..fc93c23 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
@@ -80,11 +80,23 @@
       // System.out.println(stt);
       // List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12);
       // List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
-      Short[] values1 = { 1, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 };
+      Short[] values1 = { 1231, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 };
       List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
 
       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));
+
+      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;
+      }
 
       JSONObject jsonObject = new JSONObject();
       // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5}
@@ -92,6 +104,7 @@
 
       jsonObject.append("params", arraylist);
       jsonObject.append("state", state);
+      jsonObject.append("action", sholist);
       WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter");
       if (sendwServer != null) {
         sendwServer.sendMessage(jsonObject.toString());

--
Gitblit v1.8.0