| | |
| | | package com.dy.rtuMw.server.mqtt; |
| | | |
| | | import com.dy.common.mw.protocol4Mqtt.status.DevRunSt; |
| | | import com.dy.common.mw.protocol4Mqtt.status.DevRunInfo; |
| | | import com.dy.rtuMw.server.forTcp.RtuLogDealer; |
| | | import com.dy.rtuMw.server.local.localProtocol.RtuOnLineStateStatisticsVo; |
| | | |
| | |
| | | return rsMap ; |
| | | } |
| | | } |
| | | |
| | | public static Boolean oneOnLine(String devId){ |
| | | synchronized (map){ |
| | | DevStatus st = map.get(devId) ; |
| | | if(st != null){ |
| | | return st.onLine ; |
| | | } |
| | | return false ; |
| | | } |
| | | } |
| | | /** |
| | | * 统计在线与不在线情况 |
| | | */ |
| | |
| | | Map.Entry<String, DevStatus> entry = null ; |
| | | while(it.hasNext()){ |
| | | entry = it.next() ; |
| | | if(((DevStatus)entry).onLine != null && ((DevStatus)entry).onLine.booleanValue()){ |
| | | if((entry.getValue()).onLine != null && (entry.getValue()).onLine.booleanValue()){ |
| | | vo.onLineNum++ ; |
| | | }else{ |
| | | vo.offLineNum++ ; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void setStatus(String devId, DevRunSt st){ |
| | | public static void setStatus(String devId, DevRunInfo st){ |
| | | DevStatus vo = map.get(devId) ; |
| | | if(vo != null) { |
| | | if(st.stirRunning != null){ |