| | |
| | | |
| | | 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; |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | |
| | | new Thread(new Runnable(){ |
| | | @Override |
| | | public void run() { |
| | | while(true){ |
| | | if(ServerProperties.onlyOneHeartBeat){ |
| | | try { |
| | | UpHeartBeat.upCd02Data(ServerProperties.rtuAddr); |
| | | Thread.sleep(30000L); |
| | | //Thread.sleep(30000000L); |
| | | }catch (Exception e){ |
| | | continue; |
| | | } |
| | | }else{ |
| | | while(true){ |
| | | try { |
| | | UpHeartBeat.upCd02Data(ServerProperties.rtuAddr); |
| | | Thread.sleep(30000L); |
| | | //Thread.sleep(30000000L); |
| | | }catch (Exception e){ |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |