|
|
@@ -6,6 +6,7 @@ import com.bonait.bnframework.common.constant.ConfigName; |
|
|
|
import com.bonait.bnframework.common.db.res.UserLogEnum; |
|
|
|
import com.bonait.bnframework.common.helper.I.IThread; |
|
|
|
import com.bonait.bnframework.common.helper.MessageLog; |
|
|
|
import com.bonait.bnframework.common.helper.TTrig; |
|
|
|
import com.bonait.bnframework.common.helper.ThreadManager; |
|
|
|
import com.bonait.bnframework.common.modbus.IOperateResult; |
|
|
|
import com.bonait.bnframework.common.modbus.ModbusMaster; |
|
|
@@ -279,6 +280,8 @@ public abstract class ControlBase { |
|
|
|
|
|
|
|
public IStatusNotify statusNotify; |
|
|
|
|
|
|
|
boolean[] First = new boolean[4]; |
|
|
|
|
|
|
|
/** |
|
|
|
* 设备心跳监听 |
|
|
|
*/ |
|
|
@@ -291,13 +294,25 @@ public abstract class ControlBase { |
|
|
|
|
|
|
|
for (int i=0;i<4;i++){ |
|
|
|
|
|
|
|
if (!MbSlave.ReadBoolean(GetAddress(i+1,AddressData.Heartbeat))){ |
|
|
|
StartTime[i]=System.currentTimeMillis(); |
|
|
|
if(StartTime[i]==0&&!First[i]){ |
|
|
|
MbSlave.WriteBoolean(GetAddress(i+1,AddressData.Heartbeat),true); |
|
|
|
First[i]=true; |
|
|
|
} |
|
|
|
if((System.currentTimeMillis()-StartTime[i])>=2000) |
|
|
|
|
|
|
|
if(TTrig.get("心跳检测"+String.valueOf(i)).Start(MbSlave.ReadBoolean(GetAddress(i+1,AddressData.Heartbeat)))){ |
|
|
|
StartTime[i]=System.currentTimeMillis(); |
|
|
|
MbSlave.WriteBoolean(GetAddress(i+1,AddressData.Heartbeat),true); |
|
|
|
} |
|
|
|
|
|
|
|
HeartbeatStatus[i]=StartTime[i]>0&&(System.currentTimeMillis()-StartTime[i])<=TimeOut; |
|
|
|
|
|
|
|
HeartbeatStatus[i]=(System.currentTimeMillis()-StartTime[i])<=TimeOut; |
|
|
|
// if (!MbSlave.ReadBoolean(GetAddress(i+1,AddressData.Heartbeat))){ |
|
|
|
// StartTime[i]=System.currentTimeMillis(); |
|
|
|
// } |
|
|
|
// if((System.currentTimeMillis()-StartTime[i])>=2000) |
|
|
|
// MbSlave.WriteBoolean(GetAddress(i+1,AddressData.Heartbeat),true); |
|
|
|
// |
|
|
|
// HeartbeatStatus[i]=(System.currentTimeMillis()-StartTime[i])<=TimeOut; |
|
|
|
|
|
|
|
if ( HeartbeatStatus[i]&&MbSlave.ReadBoolean(GetAddress(i+1,AddressData.FryingPanHide))){ |
|
|
|
status[i]="空闲中"; |
|
|
|