From d9765e031e100e1d8eea34e086cb9c81766e1a00 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 21 二月 2025 09:52:14 +0800 Subject: [PATCH] 针对王江海制定的协议: 1、优化相关注释; 2、优化代码; 3、协议中报警信息有变化:外门报警改为电池电压报警、增加阀门开关状态、增加阀门堵转报警等。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java index 71dea2a..1e26b29 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java @@ -5,7 +5,7 @@ import com.dy.common.mw.UnitAdapterInterface; import com.dy.common.mw.UnitInterface; -import com.dy.common.mw.UnitStartedCallbackInterface; +import com.dy.common.mw.UnitCallbackInterface; public class ProtocolUnit implements UnitInterface { @@ -39,22 +39,23 @@ /** * 鍚姩妯″潡 */ - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { //寰楀埌鍞竴瀹炰緥锛� 骞跺湪鐢熸垚鍞竴瀹炰緥鏃讹紝鎵弿娉ㄨВ绫� AnnotationScan.getIntance() ; //鍚勪釜鍗忚椹卞姩绫绘壂鎻忚嚜宸辩殑鍔熻兘鐮佹敞瑙� - HashMap<String, AnnotationDriverVo> drivers = ProtocolCach.getDriverMap() ; - Collection<String> colDrivers = drivers.keySet() ; + HashMap<String, AnnotationDriverVo> drivers = ProtocolCache.getDriverMap() ; + Collection<String> keys = drivers.keySet() ; StringBuilder totalProtocols = new StringBuilder() ; - for(String protocolName : colDrivers){ + for(String protocolNameVersion : keys){ if(!totalProtocols.isEmpty()){ totalProtocols.append("锛�") ; } - totalProtocols.append(protocolName) ; - Driver dri = ProtocolCach.getDriver(protocolName) ; + totalProtocols.append(protocolNameVersion) ; + Driver dri = ProtocolCache.getDriver(protocolNameVersion) ; if(dri != null){ dri.scanAnnotationCode(); + dri.setNotify(adapter.getSingleRtuInfoNotify(protocolNameVersion)); } } if(adapter.getConfig().showStartInfo){ @@ -70,12 +71,12 @@ */ @SuppressWarnings("unused") public boolean isOnlyOneProtocol(){ - HashMap<String, AnnotationDriverVo> drivers = ProtocolCach.getDriverMap() ; + HashMap<String, AnnotationDriverVo> drivers = ProtocolCache.getDriverMap() ; return drivers.size() == 1 ; } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } /* -- Gitblit v1.8.0