项目初始化 放货点位管理 缓存点位管理 接口记录管理
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.schedule;
|
||||
|
||||
import com.ruoyi.schedule.plc.PlcRead;
|
||||
import com.ruoyi.schedule.plc.domain.SsjDevice;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
public class ScheduleThread {
|
||||
|
||||
public PlcRead plcRead;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
ConcurrentHashMap<String, SsjDevice> list = new ConcurrentHashMap<>();
|
||||
plcRead = new PlcRead(list);
|
||||
}
|
||||
|
||||
public void startAllThread(){
|
||||
Thread plcReadThread = new Thread(plcRead);
|
||||
plcReadThread.start();
|
||||
}
|
||||
|
||||
public void stopAllThread(){
|
||||
Thread plcReadThread = new Thread(plcRead);
|
||||
plcReadThread.start();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.schedule.plc;
|
||||
|
||||
import com.ruoyi.schedule.plc.domain.SsjDevice;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class PlcRead implements Runnable{
|
||||
|
||||
private final Map<String, SsjDevice> deviceMap;
|
||||
|
||||
public PlcRead(ConcurrentHashMap<String, SsjDevice> deviceMap) {
|
||||
this.deviceMap = deviceMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("PLC Read thread is running...");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.ruoyi.schedule.plc.domain;
|
||||
|
||||
public class SsjDevice {
|
||||
}
|
||||
Reference in New Issue
Block a user