|
|
@@ -19,6 +19,7 @@ import com.example.bpa.db.mode.BPA_SUBORDER; |
|
|
|
import com.example.bpa.db.mode.BPA_USER; |
|
|
|
import com.example.bpa.helper.CrashHandler; |
|
|
|
import com.example.bpa.helper.MessageLog; |
|
|
|
import com.example.bpa.helper.ModbusTcpHelper; |
|
|
|
import com.example.bpa.helper.SdCart; |
|
|
|
import com.example.bpa.helper.ToastUtil; |
|
|
|
import com.example.bpa.service.BusinessServer; |
|
|
@@ -83,6 +84,17 @@ public class BootInit { |
|
|
|
MessageLog.MsgNotify = new IMessageLogNotify() { |
|
|
|
@Override |
|
|
|
public void ErrorMsg(String msg) { |
|
|
|
if(msg.contains("msg:com.serotonin.modbus4j.exception")) |
|
|
|
{ |
|
|
|
ModbusTcpHelper.get().release();//释放modbus |
|
|
|
DataBus.getInstance().PlcIsConnect=false; |
|
|
|
|
|
|
|
BPA_ALERTLOG log = new BPA_ALERTLOG(); |
|
|
|
log.userID = ConfigName.getInstance().user.userID; |
|
|
|
log.type=4; |
|
|
|
log.text = msg+"程序断开PLC,准备重连机制..."; |
|
|
|
QueryDB.AddAlertlog(log); |
|
|
|
} |
|
|
|
Log.e("Error", msg); |
|
|
|
} |
|
|
|
@Override |
|
|
|