fix: 烘箱行架联调问题解决

This commit is contained in:
yanps
2024-03-28 08:39:43 +08:00
parent 5f8c856a09
commit 9ae98c1d25
3 changed files with 46 additions and 27 deletions

View File

@@ -43,7 +43,7 @@ public class HongXiangConveyorDefination implements OpcDeviceDriverDefination {
@Override
public List<DeviceType> getFitDeviceTypes() {
List<DeviceType> types = new LinkedList();
types.add(DeviceType.station);
types.add(DeviceType.conveyor);
return types;
}

View File

@@ -406,15 +406,22 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList<>();
Map map = new HashMap();
map.put("to_onset", start_addr);
map.put("to_target", next_addr);
map.put("to_task", instruction.getInstruction_code());
map.put("to_command", "1");
try {
this.writing(map);
} catch (Exception e) {
e.printStackTrace();
}
map.put("code", "to_onset");
map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0");
Map map1 = new HashMap();
map1.put("code", "to_target");
map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0");
Map map2 = new HashMap();
map2.put("code", "to_task");
map2.put("value", instruction.getInstruction_code());
Map map3 = new HashMap();
map3.put("code", "to_command");
map3.put("value", "1");
list.add(map);
list.add(map1);
list.add(map2);
list.add(map3);
this.writing(list);
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
@@ -776,6 +783,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else {
this.instruction_update_time = date;
ArrayList list = new ArrayList();
Map map = new HashMap();
//更改任务状态
if (task > 0) {
@@ -806,8 +814,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 1) {
if (this.getNow_steps_type() == 2) {
ArrayList list = new ArrayList();
map.put("to_command", "2");
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
this.writing(list);
this.setNow_steps_type(3);
@@ -834,8 +842,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 2) {
ArrayList list = new ArrayList();
map.put("to_command", "2");
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
this.writing(list);
this.setNow_steps_type(3);
@@ -873,8 +881,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
hongXiangConveyorDeviceDriver.writing(map);
}
if (this.getNow_steps_type() == 3) {
ArrayList list = new ArrayList();
map.put("to_command", "3");
map.put("code", "to_command");
map.put("value", "3");
list.add(map);
this.writing(list);
this.setNow_steps_type(4);
@@ -914,8 +922,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 0) {
if (this.getNow_steps_type() == 4) {
map.put("to_command", "4");
this.writing(map);
map.put("code", "to_command");
map.put("value", "4");
list.add(map);
this.writing(list);
this.setNow_steps_type(5);
} else {
feedMessage = "未反馈电气信号原因:当前步骤不为允许放货now_steps_type=4";
@@ -942,8 +952,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 4) {
map.put("to_command", "4");
this.writing(map);
map.put("code", "to_command");
map.put("value", "4");
list.add(map);
this.writing(list);
this.setNow_steps_type(5);
}
}
@@ -1012,8 +1024,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
map.put("to_command", "5");
this.writing(map);
map.put("code", "to_command");
map.put("value", "5");
list.add(map);
this.writing(list);
this.setNow_steps_type(6);
this.setNow_steps_type(0);
try {
@@ -1151,6 +1165,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
itemMap.put(to_param, json.getString("value"));
}
}
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发电气信号:" + itemMap)
.build();
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {
this.checkcontrol(itemMap);

View File

@@ -360,15 +360,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String type = "";
if (result2.getStatus() == 200) {
if (ObjectUtil.isNotEmpty(result2) && result2.getStatus() == 200) {
type = "info";
JSONObject jo = JSONObject.parseObject(result2.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
return result2;
} else {
type = "error";
}
JSONObject jo = JSONObject.parseObject(result2.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
return result2;
return null;
} finally {
MDC.remove(log_file_type);
}