From c3682d3c5951e84cdf085c62263af4c64e232f58 Mon Sep 17 00:00:00 2001 From: whycq <whycq> Date: 星期五, 18 三月 2022 09:55:00 +0800 Subject: [PATCH] # 导航栏动画 背景颜色 --- src/main/java/com/zy/core/thread/SiemensDevpThread.java | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java index 8880b46..17a3e4a 100644 --- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java +++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java @@ -12,6 +12,7 @@ import com.zy.core.DevpThread; import com.zy.core.cache.MessageQueue; import com.zy.core.cache.OutputQueue; +import com.zy.core.enums.IoModeType; import com.zy.core.enums.SlaveType; import com.zy.core.model.DevpSlave; import com.zy.core.model.Task; @@ -50,6 +51,8 @@ add(180);add(181);add(182);add(183);add(184);add(185);add(186);add(187);add(188);add(189); add(190);add(191);add(192); }}; + + public IoModeType ioMode = IoModeType.NONE; public SiemensDevpThread(DevpSlave slave) { this.slave = slave; @@ -111,6 +114,8 @@ * 璇诲彇鐘舵�� ====> 鏁村潡plc */ private void read() throws InterruptedException { +// // 鏇存柊鍏ュ嚭搴撴ā寮� +// updateIoMode(); OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) 186); if (result.IsSuccess) { for (int i = 0; i < 83; i++) { @@ -160,6 +165,11 @@ } } +// OperateResultExOne<Short> result2 = siemensS7Net.ReadInt16("DB200.0"); +// if (result2.IsSuccess) { +// this.ioMode = IoModeType.get(result2.Content); +// } + if (result.IsSuccess && result0.IsSuccess && result1.IsSuccess) { OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId())); @@ -211,6 +221,16 @@ } } + // 鏇存柊鍏ュ嚭搴撴ā寮� + private void updateIoMode() throws InterruptedException { + if (this.ioMode != IoModeType.NONE) { + if (!siemensS7Net.Write("DB200", this.ioMode.id).IsSuccess) { + OutputQueue.DEVP.offer(MessageFormat.format("銆恵0}銆戝啓鍏ヨ緭閫佺嚎1F鍏ュ嚭搴撴ā寮忓け璐ャ�傝緭閫佺嚎plc缂栧彿={1}", slave.getId())); + log.error("鍐欏叆杈撻�佺嚎1F鍏ュ嚭搴撴ā寮忓け璐ャ�傝緭閫佺嚎plc缂栧彿={}", slave.getId()); + } + } + } + /** * 蹇冭烦 */ -- Gitblit v1.9.1