From 5bfa227109b90b20b09345722b3232fac77a1ab1 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期三, 11 九月 2024 11:41:53 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitCallbackInterface.java | 13 ++++ pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java | 6 +- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java | 6 +- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java | 6 +- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/RtuDataUnit.java | 6 +- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java | 21 ++++--- pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java | 6 +- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java | 4 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitInterface.java | 15 ++-- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java | 21 ------ pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java | 4 /dev/null | 10 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Down.java | 4 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/rmi/RmiUnit.java | 6 +- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java | 2 pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java | 4 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitAdapterInterface.java | 3 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java | 4 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java | 6 +- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/ResourceUnit.java | 6 +- pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java | 6 +- 21 files changed, 74 insertions(+), 85 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitAdapterInterface.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitAdapterInterface.java index 5a03972..b5957b2 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitAdapterInterface.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitAdapterInterface.java @@ -2,8 +2,7 @@ /** - * 妯″潡鍗曞厓閫傞厤鍣ㄦ帴鍙� - * + * 鍗曞厓閫傞厤鍣ㄦ帴鍙� */ public interface UnitAdapterInterface { } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitCallbackInterface.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitCallbackInterface.java new file mode 100644 index 0000000..260cb79 --- /dev/null +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitCallbackInterface.java @@ -0,0 +1,13 @@ +package com.dy.common.mw; + +/** + * 鍗曞厓鍚姩鎴栧仠姝㈠悗鍥炶皟鎺ュ彛 + */ +public interface UnitCallbackInterface { + /** + * 鍥炶皟鏂规硶 + * @param obj + * @throws Exception + */ + void call(Object obj) throws Exception ; +} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitInterface.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitInterface.java index 95ee7c0..8ffd22a 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitInterface.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitInterface.java @@ -1,7 +1,7 @@ package com.dy.common.mw; /** - * 妯″潡鍗曞厓鎺ュ彛 + * 鍗曞厓鎺ュ彛 * */ public interface UnitInterface { @@ -9,14 +9,15 @@ * 璁剧疆閫傞厤鍣� * @throws Exception */ - public void setAdapter(UnitAdapterInterface adapter) throws Exception ; + void setAdapter(UnitAdapterInterface adapter) throws Exception ; /** - * 鍚姩妯″潡 + * 鍚姩鍗曞厓杩愯 + * @throws Exception */ - public void start(UnitStartedCallbackInterface callback) throws Exception ; + void start(UnitCallbackInterface callback) throws Exception ; /** - * 鍋滄妯″潡杩愯 + * 鍋滄鍗曞厓杩愯 + * @throws Exception */ - public void stop(UnitStartedCallbackInterface callback) throws Exception ; - + void stop(UnitCallbackInterface callback) throws Exception ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitStartedCallbackInterface.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitStartedCallbackInterface.java deleted file mode 100644 index 0b2e44a..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/UnitStartedCallbackInterface.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dy.common.mw; - -public interface UnitStartedCallbackInterface { - /** - * 妯″潡鍚姩鍚庡洖璋� - * @param obj - * @throws Exception - */ - void call(Object obj) throws Exception ; -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/rmi/RmiUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/rmi/RmiUnit.java index 8720bcc..8117f66 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/rmi/RmiUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/rmi/RmiUnit.java @@ -7,7 +7,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 RmiUnit implements UnitInterface { @@ -46,7 +46,7 @@ /** * 鍚姩妯″潡 */ - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { if(!started){ started = true ; @@ -85,7 +85,7 @@ } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java index b359815..981d847 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/DataDecoder.java @@ -90,7 +90,7 @@ //鏂寘浜� return false ; }else if(dataStatus.isCompleted() || dataStatus.isAdjoined()){ - //鏈寘鏁版嵁宸茬粡鍏ㄩ儴鎺ユ敹锛屽苟涓斿彲鑳界矘鏈変笅鍖呮暟鎹� + //鏈寘鏁版嵁宸茬粡鍏ㄩ儴鎺ユ敹锛屾垨鍙兘绮樻湁涓嬪寘鏁版嵁 this.nextDeal(in, dataStatus.getDataLen(), out) ; if(dataStatus.isAdjoined()){ //璇存槑绮樺寘浜嗭紝杩樻湁鏁版嵁锛岄渶瑕佸杩欎簺鏁版嵁鍐嶆鎵цdoDecode_鏂规硶. diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java index 2b8d31a..422b87e 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpUnit.java @@ -13,7 +13,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; @SuppressWarnings("unused") public class TcpUnit implements UnitInterface { @@ -63,7 +63,7 @@ /** * 鍚姩妯″潡 */ - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { if(!started){ started = true ; /** @@ -95,16 +95,19 @@ //寰楀埌缃戠粶 閫氫俊鏁版嵁杩囨护鍣ㄩ摼 DefaultIoFilterChainBuilder chain = acceptor.getFilterChain() ; - //缂栬В鐮佽繃婊ゅ櫒 + //鐢熸垚缂栬В鐮佽繃婊ゅ櫒宸ュ巶绫� dataCodecFactory = new DataCodecFactory(this.adapter) ; + //璁剧疆鈥減rotocol鈥濓紝鍔犲叆缂栬В鐮佽繃婊ゅ櫒锛岃繃婊ゅ櫒鍦↖oProcessor绾跨▼涓墽琛� chain.addLast("protocol", new ProtocolCodecFilter(dataCodecFactory)); /* - * 涓�鑸珽xecutorFilter 閮借鏀惧湪ProtocolCodecFilter 杩囨护鍣ㄧ殑鍚庨潰锛� - * 涔熷氨鏄笉瑕佽缂栬В鐮佽繍琛屽湪鐙珛鐨勭嚎绋嬩笂锛岃�屾槸瑕佽繍琛屽湪IoProcessor 鎵�鍦ㄧ殑绾跨▼锛� - * 鍥犱负缂栬В鐮佸鐞嗙殑鏁版嵁閮芥槸鐢盜oProcessor 璇诲彇鍜屽彂閫佺殑锛屾病蹇呰寮�鍚柊鐨勭嚎绋嬶紝 - * 鍚﹀垯鎬ц兘鍙嶈�屼細涓嬮檷銆備竴鑸娇鐢‥xecutorFilter 鐨勫吀鍨嬪満鏅槸灏嗕笟鍔¢�昏緫锛堣濡傦細鑰楁椂鐨勬暟鎹簱鎿嶄綔锛� - * 鏀惧湪鍗曠嫭鐨勭嚎绋嬩腑杩愯锛屼篃灏辨槸璇翠笌IO 澶勭悊鏃犲叧鐨勬搷浣滃彲浠ヨ�冭檻浣跨敤ExecutorFilter 鏉ュ紓姝ユ墽琛屻�� + * 涓�鑸珽xecutorFilter 閮借鏀惧湪ProtocolCodecFilter杩囨护鍣ㄧ殑鍚庨潰锛� + * 涔熷氨鏄缂栬В鐮佽繍琛屽湪IoProcessor鎵�鍦ㄧ殑绾跨▼锛屽洜涓虹紪瑙g爜澶勭悊鐨勬暟鎹兘鏄� + * 鐢盜oProcessor璇诲彇鍜屽彂閫佺殑锛屾病蹇呰寮�鍚柊鐨勭嚎绋嬶紝鍚﹀垯鎬ц兘鍙嶈�屼細涓嬮檷銆� + * ExecutorFilter杩囩▼鍣ㄤ細鍚姩涓�涓嚎绋嬫睜锛屽鐞嗗悗缁唬鐮侀�昏緫銆� + * 涓�鑸娇鐢‥xecutorFilter鐨勫吀鍨嬪満鏅槸灏嗕笟鍔¢�昏緫锛堣濡傦細鑰楁椂鐨勬暟鎹簱鎿嶄綔锛� + * 鏀惧湪鍗曠嫭鐨勭嚎绋嬩腑杩愯锛屼篃灏辨槸璇翠笌IO澶勭悊鏃犲叧鐨勬搷浣滃彲浠ヨ�冭檻浣跨敤ExecutorFilter鏉ュ紓姝ユ墽琛屻�� + * 鏈鐢ㄦ硶锛屼娇ExecutorFilter绾跨▼姹犱腑鐨勭嚎绋嬪鐞咺OHandler锛圱cpIoHandler锛夋搷浣� */ chain.addLast("exceutor", new ExecutorFilter()); @@ -139,7 +142,7 @@ * @throws Exception */ @Override - public void stop(UnitStartedCallbackInterface callback) throws Exception { + public void stop(UnitCallbackInterface callback) throws Exception { this.tcpIoHandler.stop(); this.dataCodecFactory.stop(); this.adapter.newUnitStopCallback().callback(); diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java index 6fd31f7..d7c3261 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreUnit.java @@ -6,7 +6,7 @@ import com.dy.common.queue.Queue; 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 CoreUnit implements UnitInterface { @@ -64,7 +64,7 @@ } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { if(!started){ started = true ; CoreThread ct = CoreThread.getInstance() ; @@ -85,7 +85,7 @@ } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } 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 0e280fb..c33a3c3 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,7 +39,7 @@ /** * 鍚姩妯″潡 */ - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { //寰楀埌鍞竴瀹炰緥锛� 骞跺湪鐢熸垚鍞竴瀹炰緥鏃讹紝鎵弿娉ㄨВ绫� AnnotationScan.getIntance() ; @@ -75,7 +75,7 @@ } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } /* diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Down.java index e9d431f..909647d 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Down.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_81_Down.java @@ -47,10 +47,10 @@ byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode); if(para.param != null){ DataCd81Vo cdData = (DataCd81Vo)para.param ; - byte[] bs = new byte[8] ; + byte[] bs = new byte[3] ; bs[0] = (byte)(Integer.parseInt(cdData.getControllerType(), 16)); bs[1] = cdData.projectNo.byteValue() ; - GlCreate.createTp(bs, 2) ; + bs[2] = 0x01 ;//01:鎴愬姛 81:澶辫触 bytes = ByteUtil.bytesMerge(bytes, bs) ; }else{ throw new Exception("涓嬭鍛戒护鍙傛暟鎹负null") ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java index 9a0db38..d2ac976 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlCreate.java @@ -114,25 +114,8 @@ ByteUtil.string2BCD_BE(bs, DateTime.mm(), index + 1) ; ByteUtil.string2BCD_BE(bs, DateTime.HH(), index + 2) ; ByteUtil.string2BCD_BE(bs, DateTime.dd(), index + 3) ; - byte month = Byte.parseByte(DateTime.MM()) ; - byte week = (byte)(DateTime.week_Int().byteValue() << 1) ; - String month1 = "0" ; - String month2 = "0" ; - if(month < 10){ - month1 = "" + month ; - }else{ - if(month == 10){ - month1 = "0" ; - }else if(month == 11){ - month1 = "1" ; - }else if(month == 12){ - month1 = "2" ; - } - week = (byte)(week | 0x01) ; - } - month2 = "" + week ; - - ByteUtil.string2BCD_BE(bs, month2 + month1, index + 4) ; + //浠ヤ笅鍐欐硶鑷劧涔熸槸BCD + bs[index + 4] = (byte)((DateTime.week_Int().byteValue() << 5 | Byte.parseByte(DateTime.MM()))) ; ByteUtil.string2BCD_BE(bs, DateTime.yy(), index + 5) ; /* diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java index 3757b30..38cc9dd 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java @@ -4,7 +4,7 @@ import com.dy.common.threadPool.TreadPoolFactory; 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 SupportUnit implements UnitInterface { @@ -36,7 +36,7 @@ } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { if(!started){ started = true ; if(confVo.enableShortThreadPool) { @@ -65,7 +65,7 @@ } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } /* diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java index c5c1bc4..9a33cc5 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java @@ -423,7 +423,7 @@ case "鍛ㄥ洓" -> 4; case "鍛ㄤ簲" -> 5; case "鍛ㄥ叚" -> 6; - case "鍛ㄤ竷" -> 7; + case "鍛ㄤ竷" -> 0;//鏍规嵁鍗忚瑕佹眰鏄熸湡澶╀负0 default -> 0; }; }else{ @@ -434,7 +434,7 @@ case "Thu" -> 4; case "Fri" -> 5; case "Sat" -> 6; - case "Sun" -> 7; + case "Sun" -> 0;//鏍规嵁鍗忚瑕佹眰鏄熸湡澶╀负0 default -> 0; }; } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java index c8ea024..82a3037 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/Server.java @@ -284,7 +284,7 @@ //RTU鏃ュ織鏂囦欢瀛樺偍鐩綍(鐩稿鐩綍) resVo.rtuLogDir = conf.getSetAttrTxt(doc, "config.resource", "rtuLogDir", null, false, null) ; //RTU鏃ュ織鏂囦欢鏈�澶у瓧鑺傛暟(KB) - resVo.rtuLogFileMaxSize = conf.getSetAttrPlusInt(doc, "config.resource", "rtuLogFileMaxSize", null, 100000, 2000000, null) ; + resVo.rtuLogFileMaxSize = conf.getSetAttrPlusInt(doc, "config.resource", "rtuLogFileMaxSize", null, 10, 2000000, null) ; //RTU鏃ュ織鏂囦欢鏈�澶ф枃浠舵暟 resVo.rtuLogFileMaxCount = conf.getSetAttrPlusInt(doc, "config.resource", "rtuLogFileMaxCount", null, 1, 10, null) ; @@ -328,7 +328,7 @@ */ ///////////////// - //RTU涓婅鏁版嵁澶勭悊妯″潡 + //RTU涓婅鏁版嵁澶勭悊妯″潡锛堜换鍔℃爲锛� RtuDataUnitConfigVo rducVo = new RtuDataUnitConfigVo(); rducVo.resourceLoader = this.resourceLoader ; AdapterImp_RtuDataUnit rducAdap = new AdapterImp_RtuDataUnit(); diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/ResourceUnit.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/ResourceUnit.java index 69699fe..7660124 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/ResourceUnit.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/ResourceUnit.java @@ -12,7 +12,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; import com.dy.rtuMw.resource.rtuLog.RtuLogManager; import com.dy.common.util.DateTime; @@ -63,7 +63,7 @@ ResourceUnit.springContext = springContext ; } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { if(ResourceUnit.springContext == null){ throw new Exception("Spring涓婁笅鏂囧璞℃湭璁剧疆锛�") ; } @@ -72,7 +72,7 @@ } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitCallbackInterface callback) { } /** diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java index a2dfc3a..5b498e3 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/local/CommandInnerDeaLer.java @@ -1,6 +1,6 @@ package com.dy.rtuMw.server.local; -import com.dy.common.mw.UnitStartedCallbackInterface; +import com.dy.common.mw.UnitCallbackInterface; import com.dy.common.mw.channel.tcp.TcpUnit; import com.dy.common.mw.protocol.Command; import com.dy.rtuMw.server.local.localProtocol.*; @@ -67,7 +67,7 @@ * @throws Exception */ private Command stopTcpSv(Command command) throws Exception{ - TcpUnit.getInstance().stop(new UnitStartedCallbackInterface(){ + TcpUnit.getInstance().stop(new UnitCallbackInterface(){ public void call(Object obj) throws Exception { } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/RtuDataUnit.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/RtuDataUnit.java index c77c198..cada3ed 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/RtuDataUnit.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/RtuDataUnit.java @@ -2,7 +2,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 RtuDataUnit implements UnitInterface { @@ -33,14 +33,14 @@ * 鍒濆鍖栦笂琛屾暟鎹鐞嗕换鍔℃睜 */ @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { TaskPool.setTaskTreeCofig(new TreeParse().parseConfig(confVo.resourceLoader)); callback.call(null) ; System.out.println("RTU鏁版嵁澶勭悊妯″潡鎴愬姛鍚姩"); } @Override - public void stop(UnitStartedCallbackInterface callback) throws Exception { + public void stop(UnitCallbackInterface callback) throws Exception { } } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java index 4f9fdad..b534caf 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/RmiClUnit.java @@ -6,7 +6,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; import com.dy.common.mw.channel.rmi.RmiFrameWork; public class RmiClUnit implements UnitInterface { @@ -43,14 +43,14 @@ } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { System.out.println("Rmi Client妯″潡鎴愬姛鍚姩"); this.doStart(); callback.call(null) ; } @Override - public void stop(UnitStartedCallbackInterface callback) throws Exception { + public void stop(UnitCallbackInterface callback) throws Exception { callback.call(null); } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java index e2f8660..4537b10 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/tcpClient/TcpClUnit.java @@ -2,7 +2,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; import com.dy.common.threadPool.ThreadPool; import com.dy.common.threadPool.TreadPoolFactory; import com.dy.common.util.Callback; @@ -53,7 +53,7 @@ } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { pool = TreadPoolFactory.getThreadPoolLong() ; System.out.println("Tcp Client妯″潡鎴愬姛鍚姩"); this.doStart(); @@ -61,7 +61,7 @@ } @Override - public void stop(UnitStartedCallbackInterface callback) throws Exception { + public void stop(UnitCallbackInterface callback) throws Exception { callback.call(null); } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java index 823f420..2349a1a 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/Server.java @@ -9,7 +9,7 @@ import org.jdom2.Document; import com.dy.common.mw.UnitInterface; -import com.dy.common.mw.UnitStartedCallbackInterface; +import com.dy.common.mw.UnitCallbackInterface; import com.dy.common.mw.channel.rmi.RmiConfigVo; import com.dy.common.mw.channel.rmi.RmiUnit; import com.dy.common.util.NumUtil; @@ -154,7 +154,7 @@ rmiAdap.setConfig(rmiVo); RmiUnit rmiUnit = RmiUnit.getInstance(); rmiUnit.setAdapter(rmiAdap); - rmiUnit.start(new UnitStartedCallbackInterface(){ + rmiUnit.start(new UnitCallbackInterface(){ @Override public void call(Object obj) { } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java index 6d8eced..6fd95b1 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-rtu/src/main/java/com/dy/pipIrrMwTestRtu/tcpClient/TcpClUnit.java @@ -2,7 +2,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; import com.dy.common.util.Callback; import com.dy.pipIrrMwTestRtu.ServerProperties; import com.dy.pipIrrMwTestRtu.tcpClient.upData.UpData; @@ -42,14 +42,14 @@ } @Override - public void start(UnitStartedCallbackInterface callback) throws Exception { + public void start(UnitCallbackInterface callback) throws Exception { System.out.println("Tcp Client妯″潡鎴愬姛鍚姩"); this.doStart(); callback.call(null) ; } @Override - public void stop(UnitStartedCallbackInterface callback) throws Exception { + public void stop(UnitCallbackInterface callback) throws Exception { callback.call(null); } -- Gitblit v1.8.0