输送机读取数据初始化

This commit is contained in:
liuhanqing
2025-09-28 09:18:58 +08:00
parent aa6a19fc16
commit fd9b720fe6
3 changed files with 19 additions and 16 deletions

View File

@@ -111,7 +111,13 @@ public class ScheduleThread {
ConcurrentHashMap<String, MsgDdj> ddjList = new ConcurrentHashMap<>();
List<MsgDdj> msgDdjs = msgDdjService.selectMsgDdjList(new MsgDdj());
for (MsgDdj msgDdj : msgDdjs) {
ddjList.put("ddj"+msgDdj.getId(), msgDdj);
switch (msgDdj.getId()){
case 1:
msgDdj.setPlcDbReadAddress("DB40.0");
case 2:
msgDdj.setPlcDbReadAddress("DB41.0");
}
ddjList.put("ddj" + msgDdj.getId(), msgDdj);
}
PlcDdjRead plcDdjRead = new PlcDdjRead(ddjList, new PlcConnectInfo("127.0.0.1", 102));
Thread plcDdjReadThread = new Thread(plcDdjRead);