| | |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | |
| | | import com.dy.aceMw.server.forMq.ToMqMessageCach; |
| | | import com.dy.common.mw.protocol.MidResult; |
| | | import com.dy.common.mw.protocol.MidResultAction; |
| | | import com.dy.common.mw.protocol.MidResultFromRtu; |
| | | import com.dy.common.mw.protocol.MidResultToRtu; |
| | | import com.dy.common.util.rtuMq.MessageType; |
| | | |
| | | public class MidResultActionFromRtu implements MidResultAction { |
| | | |
| | |
| | | private void sendResult(boolean reportOrResponse_trueOrFalse, MidResultFromRtu resFromRtu){ |
| | | try{ |
| | | String json = resFromRtu.data.toJson() ; |
| | | if(reportOrResponse_trueOrFalse){ |
| | | ToMqMessageCach.cachObj(MessageType.RtuAutoReport, json); |
| | | }else{ |
| | | ToMqMessageCach.cachObj(MessageType.RtuCmdResponse, json); |
| | | } |
| | | // if(reportOrResponse_trueOrFalse){ |
| | | // ToMqMessageCach.cachObj(MessageType.RtuAutoReport, json); |
| | | // }else{ |
| | | // ToMqMessageCach.cachObj(MessageType.RtuCmdResponse, json); |
| | | // } |
| | | }catch(Exception e){ |
| | | log.error(e.getMessage(), e); |
| | | } |