From c13207a19a92c845fcb8c356e01f073142d9084e Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期五, 19 一月 2024 14:32:42 +0800 Subject: [PATCH] 测试后代码更新 --- springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java index fda114a..b270a74 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java @@ -1,5 +1,6 @@ package com.example.springboot.component; +import java.time.LocalDateTime; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import com.example.springboot.service.JdbcConnections; @@ -29,6 +30,7 @@ // \\ TODO Auto-generated catch block e.printStackTrace(); } + // if (S7control.getinstance().CheckConnected() == false) { spianService = WebSocketServer.applicationContext.getBean(SpianService.class); spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); @@ -82,6 +84,8 @@ if (outstate == true) {// 褰撳嚭鐗囪溅绌洪棽鏃�,涓斿嚭鐗囧惎鍔ㄤ负1鏃讹紝浠诲姟鍚姩鏀逛负0 if (outstate1 == true) { S7control.getinstance().WriteWord("DB105.18", (short) 0);// 鍑虹墖浠诲姟鍚姩鏀逛负0 + System.out.println("鍏抽棴鍚姩"+LocalDateTime.now()); + } } } @@ -99,22 +103,31 @@ // 褰撹繘鐗囧皬杞﹀畬鎴愪换鍔℃椂 if (B01backs == true) { - // 褰揃01灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬� 涓�1 + //鍒ゆ柇鏄惁姹囨姤姝g‘鐨刬d + int HB=spianMapper.SelectHB(B01glassid.toString()); + if(HB>0){ + // 褰揃01灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬� 涓�1 spianService.overtask(B01glassid.toString());// 瀹屾垚浠诲姟 S7control.getinstance().WriteWord("DB106.60", (short) 0);// 鎭㈠B01灏忚溅搴旂瓟鏀逛负0 boolean yingda = spianService.listbool("DB106.60");// b01姹囨姤 System.out.println("姹囨姤鏃禕01|绗�" + aaa + "娆�" + B01glassid + "搴旂瓟" + yingda); aaa += 1; + } + } // 褰撳嚭鐗囧皬杞﹀畬鎴愪换鍔℃椂 if (B02backs == true) { + //鍒ゆ柇鏄惁姹囨姤姝g‘鐨刬d + int HB=spianMapper.SelectHB(B02glassid.toString()); + if(HB>0){ // 褰揃02灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬佷负0 spianService.overtask(B02glassid.toString());// 瀹屾垚浠诲姟 S7control.getinstance().WriteWord("DB106.62", (short) 0);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负0 System.out.println("姹囨姤鏃禕02|" + B02glassid); boolean yingda = spianService.listbool("DB106.62");// b02姹囨姤 System.out.println("姹囨姤鏃禕02|绗�" + aaa + "娆�" + B02glassid + "搴旂瓟" + yingda); + } } // 鑾峰彇DO1鏁版嵁 -- Gitblit v1.8.0