现场调试修改
This commit is contained in:
@@ -7,9 +7,12 @@ import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.common.domain.PlcConnectInfo;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj1Read;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj2Read;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.common.domain.CustomThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.DdjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.DdjThread_1;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.DdjThread_2;
|
||||
import com.ruoyi.schedule.scheduleTask.monit.MonitoringThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.PortConvThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.RoadConvThread;
|
||||
@@ -33,19 +36,22 @@ public class ScheduleThread {
|
||||
|
||||
public CustomThread<PlcSsjRead> plcSsjReadCustomThread;
|
||||
public CustomThread<PlcDdj1Read> plcDdj1ReadCustomThread;
|
||||
// public CustomThread<PlcDdj2Read> plcDdj2ReadCustomThread;
|
||||
public CustomThread<PlcDdj2Read> plcDdj2ReadCustomThread;
|
||||
|
||||
public CustomThread<PortConvThread> portConvCustomThread;
|
||||
public CustomThread<RoadConvThread> roadConvCustomThread;
|
||||
|
||||
public CustomThread<MonitoringThread> monitoringCustomThread;
|
||||
public CustomThread<DdjThread> ddj1CustomThread;
|
||||
public CustomThread<DdjThread> ddjCustomThread;
|
||||
public CustomThread<DdjThread_1> ddj1CustomThread;
|
||||
public CustomThread<DdjThread_2> ddj2CustomThread;
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
@Autowired
|
||||
private IMsgDdjService msgDdjService;
|
||||
|
||||
private boolean isRun = false;
|
||||
// private boolean isRun1 = false;
|
||||
private boolean isRun2 = false;
|
||||
|
||||
/**
|
||||
@@ -77,8 +83,10 @@ public class ScheduleThread {
|
||||
RoadConvThread roadConvThread = new RoadConvThread();
|
||||
roadConvCustomThread = new CustomThread<RoadConvThread>(new Thread(roadConvThread), roadConvThread);
|
||||
|
||||
DdjThread ddj1Thread = new DdjThread();
|
||||
ddj1CustomThread = new CustomThread<DdjThread>(new Thread(ddj1Thread), ddj1Thread);
|
||||
DdjThread_1 ddj1Thread = new DdjThread_1();
|
||||
DdjThread_2 ddj2Thread = new DdjThread_2();
|
||||
ddj1CustomThread = new CustomThread<DdjThread_1>(new Thread(ddj1Thread), ddj1Thread);
|
||||
ddj2CustomThread = new CustomThread<DdjThread_2>(new Thread(ddj2Thread), ddj2Thread);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +106,7 @@ public class ScheduleThread {
|
||||
|
||||
//获取堆垛机
|
||||
ConcurrentHashMap<String, MsgDdj> ddj1List = new ConcurrentHashMap<>();
|
||||
// ConcurrentHashMap<String, MsgDdj> ddj2List = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<String, MsgDdj> ddj2List = new ConcurrentHashMap<>();
|
||||
List<MsgDdj> msgDdjs = msgDdjService.selectMsgDdjList(new MsgDdj());
|
||||
for (MsgDdj msgDdj : msgDdjs) {
|
||||
msgDdj.setPlcDbReadAddress(msgDdj.getPlcDbReadAddress());
|
||||
@@ -110,13 +118,13 @@ public class ScheduleThread {
|
||||
ddj1List.put("ddj1", msgDdj);
|
||||
PlcDdj1Read.deviceDdjMap = ddj1List;
|
||||
break;
|
||||
// case 2:
|
||||
// PlcDdj2Read plcDdj2Read = new PlcDdj2Read(msgDdj, new PlcConnectInfo(msgDdj.getIp(), Convert.toInt(msgDdj.getPort())));
|
||||
// Thread plcDdj2ReadThread = new Thread(plcDdj2Read);
|
||||
// plcDdj2ReadCustomThread = new CustomThread<PlcDdj2Read>(plcDdj2ReadThread, plcDdj2Read);
|
||||
// ddj2List.put("ddj2", msgDdj);
|
||||
// PlcDdj2Read.deviceDdjMap = ddj2List;
|
||||
// break;
|
||||
case 2:
|
||||
PlcDdj2Read plcDdj2Read = new PlcDdj2Read(msgDdj, new PlcConnectInfo(msgDdj.getIp(), Convert.toInt(msgDdj.getPort())));
|
||||
Thread plcDdj2ReadThread = new Thread(plcDdj2Read);
|
||||
plcDdj2ReadCustomThread = new CustomThread<PlcDdj2Read>(plcDdj2ReadThread, plcDdj2Read);
|
||||
ddj2List.put("ddj2", msgDdj);
|
||||
PlcDdj2Read.deviceDdjMap = ddj2List;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,7 +135,7 @@ public class ScheduleThread {
|
||||
public void startAllThread() {
|
||||
plcSsjReadCustomThread.getThread().start();
|
||||
plcDdj1ReadCustomThread.getThread().start();
|
||||
// plcDdj2ReadCustomThread.getThread().start();
|
||||
plcDdj2ReadCustomThread.getThread().start();
|
||||
isRun = true;
|
||||
}
|
||||
|
||||
@@ -139,6 +147,7 @@ public class ScheduleThread {
|
||||
portConvCustomThread.thread.start();
|
||||
roadConvCustomThread.thread.start();
|
||||
ddj1CustomThread.thread.start();
|
||||
ddj2CustomThread.thread.start();
|
||||
isRun2 = true;
|
||||
}
|
||||
|
||||
@@ -148,7 +157,7 @@ public class ScheduleThread {
|
||||
public void stopAllThread() {
|
||||
plcSsjReadCustomThread.runnable.isRun = false;
|
||||
plcDdj1ReadCustomThread.runnable.isRun = false;
|
||||
// plcDdj2ReadCustomThread.runnable.isRun = false;
|
||||
plcDdj2ReadCustomThread.runnable.isRun = false;
|
||||
plcReadInit();
|
||||
isRun = false;
|
||||
}
|
||||
@@ -162,6 +171,7 @@ public class ScheduleThread {
|
||||
roadConvCustomThread.runnable.isRun = false;
|
||||
|
||||
ddj1CustomThread.runnable.isRun = false;
|
||||
ddj2CustomThread.runnable.isRun = false;
|
||||
scheduleInit();
|
||||
isRun2 = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user