编辑设备类型和出入库调度
This commit is contained in:
@@ -12,12 +12,8 @@ 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.monit.MonitoringThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1BothWayInSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1BothWayOutSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1SingleSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.Floor2InOutSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.Floor2RoadWaySsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.LineSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.PortConvThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.RoadConvThread;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -27,7 +23,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -39,14 +34,11 @@ 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<Floor1BothWayInSsjThread> floor1BothWayInSsjCustomThread;
|
||||
public CustomThread<Floor1BothWayOutSsjThread> floor1BothWayOutSsjCustomThread;
|
||||
public CustomThread<Floor1SingleSsjThread> floor1SingleSsjCustomThread;
|
||||
public CustomThread<Floor2InOutSsjThread> floor2InSsjCustomThread;
|
||||
public CustomThread<Floor2RoadWaySsjThread> floor2OutSsjCustomThread;
|
||||
public CustomThread<LineSsjThread> lineSsjCustomThread;
|
||||
public CustomThread<MonitoringThread> monitoringCustomThread;
|
||||
public CustomThread<DdjThread> ddj1CustomThread;
|
||||
@Autowired
|
||||
@@ -80,23 +72,11 @@ public class ScheduleThread {
|
||||
MonitoringThread monitoringThread = new MonitoringThread();
|
||||
monitoringCustomThread = new CustomThread<MonitoringThread>(new Thread(monitoringThread), monitoringThread);
|
||||
|
||||
Floor1BothWayInSsjThread floor1BothWayInSsjThread = new Floor1BothWayInSsjThread();
|
||||
floor1BothWayInSsjCustomThread = new CustomThread<Floor1BothWayInSsjThread>(new Thread(floor1BothWayInSsjThread), floor1BothWayInSsjThread);
|
||||
PortConvThread portConvThread = new PortConvThread();
|
||||
portConvCustomThread = new CustomThread<PortConvThread>(new Thread(portConvThread), portConvThread);
|
||||
|
||||
Floor1BothWayOutSsjThread floor1BothWayOutSsjThread = new Floor1BothWayOutSsjThread();
|
||||
floor1BothWayOutSsjCustomThread = new CustomThread<Floor1BothWayOutSsjThread>(new Thread(floor1BothWayOutSsjThread), floor1BothWayOutSsjThread);
|
||||
|
||||
Floor1SingleSsjThread floor1SingleSsjThread = new Floor1SingleSsjThread();
|
||||
floor1SingleSsjCustomThread = new CustomThread<Floor1SingleSsjThread>(new Thread(floor1SingleSsjThread), floor1SingleSsjThread);
|
||||
|
||||
Floor2InOutSsjThread floor2InSsjThread = new Floor2InOutSsjThread();
|
||||
floor2InSsjCustomThread = new CustomThread<Floor2InOutSsjThread>(new Thread(floor2InSsjThread), floor2InSsjThread);
|
||||
|
||||
LineSsjThread lineSsjThread = new LineSsjThread();
|
||||
lineSsjCustomThread = new CustomThread<LineSsjThread>(new Thread(lineSsjThread), lineSsjThread);
|
||||
|
||||
Floor2RoadWaySsjThread floor2OutSsjThread = new Floor2RoadWaySsjThread();
|
||||
floor2OutSsjCustomThread = new CustomThread<Floor2RoadWaySsjThread>(new Thread(floor2OutSsjThread), floor2OutSsjThread);
|
||||
RoadConvThread roadConvThread = new RoadConvThread();
|
||||
roadConvCustomThread = new CustomThread<RoadConvThread>(new Thread(roadConvThread), roadConvThread);
|
||||
|
||||
DdjThread ddj1Thread = new DdjThread();
|
||||
ddj1CustomThread = new CustomThread<DdjThread>(new Thread(ddj1Thread), ddj1Thread);
|
||||
@@ -119,7 +99,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());
|
||||
@@ -131,13 +111,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +128,7 @@ public class ScheduleThread {
|
||||
public void startAllThread() {
|
||||
plcSsjReadCustomThread.getThread().start();
|
||||
plcDdj1ReadCustomThread.getThread().start();
|
||||
plcDdj2ReadCustomThread.getThread().start();
|
||||
// plcDdj2ReadCustomThread.getThread().start();
|
||||
isRun = true;
|
||||
}
|
||||
|
||||
@@ -157,12 +137,8 @@ public class ScheduleThread {
|
||||
*/
|
||||
public void startAllThread2() {
|
||||
monitoringCustomThread.thread.start();
|
||||
floor1BothWayInSsjCustomThread.thread.start();
|
||||
floor1BothWayOutSsjCustomThread.thread.start();
|
||||
floor1SingleSsjCustomThread.thread.start();
|
||||
floor2InSsjCustomThread.thread.start();
|
||||
lineSsjCustomThread.thread.start();
|
||||
floor2OutSsjCustomThread.thread.start();
|
||||
portConvCustomThread.thread.start();
|
||||
roadConvCustomThread.thread.start();
|
||||
ddj1CustomThread.thread.start();
|
||||
isRun2 = true;
|
||||
}
|
||||
@@ -173,7 +149,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;
|
||||
}
|
||||
@@ -183,12 +159,9 @@ public class ScheduleThread {
|
||||
*/
|
||||
public void stopAllThread2() {
|
||||
monitoringCustomThread.runnable.isRun = false;
|
||||
floor1BothWayInSsjCustomThread.runnable.isRun = false;
|
||||
floor1BothWayOutSsjCustomThread.runnable.isRun = false;
|
||||
floor1SingleSsjCustomThread.runnable.isRun = false;
|
||||
floor2InSsjCustomThread.runnable.isRun = false;
|
||||
lineSsjCustomThread.runnable.isRun = false;
|
||||
floor2OutSsjCustomThread.runnable.isRun = false;
|
||||
portConvCustomThread.runnable.isRun = false;
|
||||
roadConvCustomThread.runnable.isRun = false;
|
||||
|
||||
ddj1CustomThread.runnable.isRun = false;
|
||||
scheduleInit();
|
||||
isRun2 = false;
|
||||
@@ -219,11 +192,11 @@ public class ScheduleThread {
|
||||
|
||||
// String code = sendWeight("192.168.56.33", 2002);
|
||||
// System.err.println(code);
|
||||
String pp = "MODEL:EX-1203 COLOR:9005 SERIAL:QT25C1879 V:220 Hz:50 PH:1 N.W.:207kg G.W.:238kg @:9781C52TQ$S0T0T0T3T0U7T0$7005280MA0A@";
|
||||
String ss = "MODEL:TR-360 COLOR:7016 SERIAL:QT25C1899 V:380 Hz:50 PH:3 N.W.:231kg G.W.:261kg @:9981C52TQ$S0T0U5RDS2S3S6T0T3T0U7T0$4105230IF0A@";
|
||||
System.err.println(pp);
|
||||
System.err.println(pp.length());
|
||||
System.err.println(ss.length());
|
||||
// String pp = "MODEL:EX-1203 COLOR:9005 SERIAL:QT25C1879 V:220 Hz:50 PH:1 N.W.:207kg G.W.:238kg @:9781C52TQ$S0T0T0T3T0U7T0$7005280MA0A@";
|
||||
// String ss = "MODEL:TR-360 COLOR:7016 SERIAL:QT25C1899 V:380 Hz:50 PH:3 N.W.:231kg G.W.:261kg @:9981C52TQ$S0T0U5RDS2S3S6T0T3T0U7T0$4105230IF0A@";
|
||||
// System.err.println(pp);
|
||||
// System.err.println(pp.length());
|
||||
// System.err.println(ss.length());
|
||||
}
|
||||
|
||||
public static String sendWeight(String ip, int por) {
|
||||
|
||||
Reference in New Issue
Block a user