New file |
| | |
| | | package com.dy.rtuMw.server.forTcp; |
| | | |
| | | import org.apache.logging.log4j.*; |
| | | |
| | | import com.dy.common.mw.protocol.MidResult; |
| | | import com.dy.common.mw.protocol.MidResultAction; |
| | | import com.dy.common.mw.protocol.MidResultToRtu; |
| | | |
| | | public class MidResultActionToRtu implements MidResultAction { |
| | | |
| | | private static Logger log = LogManager.getLogger(MidResultActionToRtu.class.getName()) ; |
| | | |
| | | @Override |
| | | public void doAction(MidResult result) { |
| | | if(result != null && result instanceof MidResultToRtu){ |
| | | try { |
| | | MidResultToRtu resToRtu = (MidResultToRtu)result ; |
| | | TcpDownCommandCache.cacheCommand(resToRtu); |
| | | log.info("下行命令(toRtu,id=" + resToRtu.commandId + ")" + resToRtu.downCode + "中间数据(MidResult)已经放入下行命令缓存中"); |
| | | } catch (Exception e) { |
| | | log.error(e); |
| | | } |
| | | } |
| | | } |
| | | } |