@@ -228,6 +228,7 @@ public class RackModbusTcpServer { | |||||
RackModbusTcpServer.get().plcIsConnect = true; | RackModbusTcpServer.get().plcIsConnect = true; | ||||
Log.e("设备PLC", "设备PLC: 连接成功"); | Log.e("设备PLC", "设备PLC: 连接成功"); | ||||
RecordManager.getInstance().addLogRecord("设备异常日志","货架plc-连接成功"); | RecordManager.getInstance().addLogRecord("设备异常日志","货架plc-连接成功"); | ||||
ThreadManager.get().Stop("烤箱设备重连"); | |||||
} | } | ||||
@Override | @Override | ||||
@@ -246,6 +247,7 @@ public class RackModbusTcpServer { | |||||
}); | }); | ||||
Thread.sleep(3000); | Thread.sleep(3000); | ||||
} | } | ||||
ThreadManager.get().Stop("烤箱设备重连"); | |||||
}); | }); | ||||
} | } | ||||
@@ -122,6 +122,12 @@ public class RobotModbusTcpServer { | |||||
*/ | */ | ||||
public static void ConnectPLC() | public static void ConnectPLC() | ||||
{ | { | ||||
ThreadManager.get().execute(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
} | |||||
}); | |||||
ThreadManager.get().StartLong("机器人PLC重连", false, new IThread() { | ThreadManager.get().StartLong("机器人PLC重连", false, new IThread() { | ||||
@Override | @Override | ||||
public void Run() throws InterruptedException { | public void Run() throws InterruptedException { | ||||
@@ -139,7 +145,7 @@ public class RobotModbusTcpServer { | |||||
MessageLog.ShowInfo("机器人设备 " + ModbusCenter.robotAddress + " 连接成功"); | MessageLog.ShowInfo("机器人设备 " + ModbusCenter.robotAddress + " 连接成功"); | ||||
RobotModbusTcpServer.get().plcIsConnect = true; | RobotModbusTcpServer.get().plcIsConnect = true; | ||||
Log.e("机器人PLC", "机器人PLC: 连接成功"); | Log.e("机器人PLC", "机器人PLC: 连接成功"); | ||||
ThreadManager.get().Stop("机器人设备重连"); | |||||
ThreadManager.get().Stop("机器人PLC重连"); | |||||
ModbusCenter.Listening(); | ModbusCenter.Listening(); | ||||
RecordManager.getInstance().addLogRecord("设备异常日志","机器人PLC-连接成功"); | RecordManager.getInstance().addLogRecord("设备异常日志","机器人PLC-连接成功"); | ||||
} | } | ||||
@@ -98,7 +98,7 @@ public class Wok2ModbusTcpServer { | |||||
*/ | */ | ||||
public static void ConnectPLC() | public static void ConnectPLC() | ||||
{ | { | ||||
ThreadManager.get().StartLong("炒锅PLC重连", false, new IThread() { | |||||
ThreadManager.get().StartLong("炒锅2PLC重连", false, new IThread() { | |||||
@Override | @Override | ||||
public void Run() throws InterruptedException { | public void Run() throws InterruptedException { | ||||
while (!Wok2ModbusTcpServer.get().plcIsConnect){ | while (!Wok2ModbusTcpServer.get().plcIsConnect){ | ||||
@@ -115,7 +115,7 @@ public class Wok2ModbusTcpServer { | |||||
MessageLog.ShowInfo("炒锅设备 " + ModbusCenter.wokAddress + " 连接成功"); | MessageLog.ShowInfo("炒锅设备 " + ModbusCenter.wokAddress + " 连接成功"); | ||||
Wok2ModbusTcpServer.get().plcIsConnect = true; | Wok2ModbusTcpServer.get().plcIsConnect = true; | ||||
Log.e("炒锅设备PLC", "炒锅设备PLC: 连接成功"); | Log.e("炒锅设备PLC", "炒锅设备PLC: 连接成功"); | ||||
ThreadManager.get().Stop("炒锅设备重连"); | |||||
ThreadManager.get().Stop("炒锅2PLC重连"); | |||||
ModbusCenter.Listening(); | ModbusCenter.Listening(); | ||||
init(); | init(); | ||||
RecordManager.getInstance().addLogRecord("设备异常日志",2+"号炒锅-连接成功"); | RecordManager.getInstance().addLogRecord("设备异常日志",2+"号炒锅-连接成功"); | ||||
@@ -140,7 +140,7 @@ public class Wok2ModbusTcpServer { | |||||
throw new RuntimeException(e); | throw new RuntimeException(e); | ||||
} | } | ||||
} | } | ||||
ThreadManager.get().Stop("炒锅PLC重连"); | |||||
ThreadManager.get().Stop("炒锅2PLC重连"); | |||||
}}); | }}); | ||||
} | } | ||||
@@ -119,7 +119,7 @@ public class WokModbusTcpServer { | |||||
MessageLog.ShowInfo("炒锅设备 " + ModbusCenter.wokAddress + " 连接成功"); | MessageLog.ShowInfo("炒锅设备 " + ModbusCenter.wokAddress + " 连接成功"); | ||||
WokModbusTcpServer.get().plcIsConnect = true; | WokModbusTcpServer.get().plcIsConnect = true; | ||||
Log.e("炒锅设备PLC", "炒锅设备PLC: 连接成功"); | Log.e("炒锅设备PLC", "炒锅设备PLC: 连接成功"); | ||||
ThreadManager.get().Stop("炒锅设备重连"); | |||||
ThreadManager.get().Stop("炒锅PLC重连"); | |||||
ModbusCenter.Listening(); | ModbusCenter.Listening(); | ||||
RecordManager.getInstance().addLogRecord("设备异常日志",1+"号炒锅-连接成功"); | RecordManager.getInstance().addLogRecord("设备异常日志",1+"号炒锅-连接成功"); | ||||
init(); | init(); | ||||