fix: 联调
This commit is contained in:
@@ -170,6 +170,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
int to_container_type = 0;
|
||||
int last_to_container_type = 0;
|
||||
|
||||
int to_height_level = 0;
|
||||
int last_to_height_level = 0;
|
||||
|
||||
String barcode = null;
|
||||
|
||||
|
||||
@@ -237,6 +240,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
to_target = this.itemProtocol.getTotarget();
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
to_container_no = this.itemProtocol.getContainer_direction();
|
||||
to_height_level = this.itemProtocol.getTo_height_level();
|
||||
|
||||
|
||||
if (mode != last_mode) {
|
||||
|
||||
@@ -63,6 +63,11 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_to_target = "to_target";
|
||||
|
||||
/**
|
||||
* 下发高度等级
|
||||
*/
|
||||
public static String item_to_height_level = "to_height_level";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -124,7 +129,9 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_container_type);
|
||||
}
|
||||
|
||||
|
||||
public int getTo_height_level(){
|
||||
return this.getOpcIntegerValue(item_to_height_level);
|
||||
}
|
||||
Boolean isonline;
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
@@ -180,6 +187,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB102.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB102.D1"));
|
||||
list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB102.B5"));
|
||||
list.add(new ItemDto(item_to_height_level, "下发高度等级", "DB2.W10"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
int to_container_type = 0;
|
||||
int last_to_container_type = 0;
|
||||
|
||||
int to_height_level = 0;
|
||||
int last_to_height_level = 0;
|
||||
|
||||
//托盘类型
|
||||
int container_type = 0;
|
||||
int last_container_type = 0;
|
||||
@@ -224,6 +227,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
weight = this.itemProtocol.getWeight();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
material_barcode = this.itemProtocol.getMaterialBarcode();
|
||||
to_height_level = this.itemProtocol.getTo_height_level();
|
||||
|
||||
if (mode != last_mode) {
|
||||
JSONObject param = new JSONObject();
|
||||
|
||||
@@ -79,6 +79,11 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_to_container_type = "to_container_type";
|
||||
|
||||
/**
|
||||
* 下发高度等级
|
||||
*/
|
||||
public static String item_to_height_level = "to_height_level";
|
||||
|
||||
private ConveyorWithScannerWeightDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(ConveyorWithScannerWeightDeviceDriver driver){
|
||||
@@ -147,7 +152,9 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_container_type);
|
||||
}
|
||||
|
||||
|
||||
public int getTo_height_level(){
|
||||
return this.getOpcIntegerValue(item_to_height_level);
|
||||
}
|
||||
Boolean isonline;
|
||||
|
||||
|
||||
@@ -210,6 +217,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6"));
|
||||
list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB2.W8"));
|
||||
list.add(new ItemDto(item_to_height_level, "下发高度等级", "DB2.W10"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.device_driver.one_conveyor.box_subvolumes_conveyor.BoxSubvolumesConveyorDeviceDriver;
|
||||
@@ -369,8 +368,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Map<String, Object> map8 = new HashMap<>();
|
||||
Map<String, Object> map9 = new HashMap<>();
|
||||
Map<String, Object> map10 = new HashMap<>();
|
||||
Map<String, Object> map11 = new HashMap<>();
|
||||
try {
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instruction.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10);
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instruction.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10,map11);
|
||||
} catch (Exception e) {
|
||||
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
@@ -453,8 +453,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Map<String, Object> map8 = new HashMap<>();
|
||||
Map<String, Object> map9 = new HashMap<>();
|
||||
Map<String, Object> map10 = new HashMap<>();
|
||||
Map<String, Object> map11 = new HashMap<>();
|
||||
try {
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instdto.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10);
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instdto.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10, map11);
|
||||
} catch (Exception e) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
@@ -475,7 +476,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
}
|
||||
|
||||
private void pushPLC(Map<String, Object> map1, Map<String, Object> map2, String next_addr, Map<String, Object> map3, String start_addr, Map<String, Object> map4, String task, InteractionJsonDTO interactionJsonDTO, Map<String, Object> map5, Map<String, Object> map6, Map<String, Object> map7, Map<String, Object> map8,Map<String, Object> map9,Map<String, Object> map10) {
|
||||
private void pushPLC(Map<String, Object> map1, Map<String, Object> map2, String next_addr, Map<String, Object> map3, String start_addr, Map<String, Object> map4, String task, InteractionJsonDTO interactionJsonDTO, Map<String, Object> map5, Map<String, Object> map6, Map<String, Object> map7, Map<String, Object> map8,Map<String, Object> map9,Map<String, Object> map10,Map<String, Object> map11) {
|
||||
List list = new ArrayList();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 1);
|
||||
@@ -517,6 +518,11 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
map10.put("value", interactionJsonDTO.getLen());
|
||||
list.add(map10);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getHeightLevel())) {
|
||||
map11.put("code", "to_height_level");
|
||||
map11.put("value", interactionJsonDTO.getHeightLevel());
|
||||
list.add(map11);
|
||||
}
|
||||
}
|
||||
this.writing(list);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,9 @@ public class InteractionJsonDTO {
|
||||
* 托盘类型
|
||||
*/
|
||||
private String containerType;
|
||||
|
||||
/**
|
||||
* 高度等级
|
||||
*/
|
||||
private String heightLevel;
|
||||
}
|
||||
|
||||
@@ -473,6 +473,12 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
map10.put("value", interactionJsonDTO.getContainerType());
|
||||
list.add(map10);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getHeightLevel())) {
|
||||
Map<String, Object> map11 = new HashMap<>();
|
||||
map11.put("code", "to_height_level");
|
||||
map11.put("value", interactionJsonDTO.getHeightLevel());
|
||||
list.add(map11);
|
||||
}
|
||||
}
|
||||
this.writing(list);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,11 @@ public class InteractionJsonDTO {
|
||||
*/
|
||||
private String containerType;
|
||||
|
||||
/**
|
||||
* 高度等级
|
||||
*/
|
||||
private String heightLevel;
|
||||
|
||||
/**
|
||||
* 是否拔轴
|
||||
*/
|
||||
|
||||
@@ -393,7 +393,6 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||
|
||||
@@ -580,17 +580,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
if (error == 5 && count < WcsConfig.stacker_error_in_count) {
|
||||
//清警
|
||||
cleanErro();
|
||||
applyUpdatePointCode(StandarStirageErroEnum.FILL.getType());
|
||||
//相同任务时限制加一
|
||||
if (Objects.equals(task, last_task)) {
|
||||
count++;
|
||||
}
|
||||
applyUpdatePointCode(StandarStirageErroEnum.FILL.getType());
|
||||
|
||||
}
|
||||
//空出直接完结指令
|
||||
|
||||
if (error == 6) {
|
||||
Instruction instruction = checkInst();
|
||||
try {
|
||||
finish_instruction(instruction);
|
||||
applyUpdatePointCode(StandarStirageErroEnum.VOIDANCE.getType());
|
||||
//清警
|
||||
cleanErro();
|
||||
} catch (Exception e) {
|
||||
@@ -603,16 +603,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
//清警
|
||||
cleanErro();
|
||||
//放货
|
||||
if (cargoMove == 1 && count < WcsConfig.stacker_error_in_count) {
|
||||
if (forkCargo == 2 && count < WcsConfig.stacker_error_in_count) {
|
||||
//相同任务时限制加一
|
||||
if (Objects.equals(task, last_task)) {
|
||||
count++;
|
||||
}
|
||||
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType());
|
||||
} else if (cargoMove == 0) {
|
||||
} else if (forkCargo == 0) {
|
||||
//取货
|
||||
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_IN.getType());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -664,9 +665,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "one_message18";
|
||||
}
|
||||
|
||||
if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) {
|
||||
task = task * 1000;
|
||||
updateData2(poinCode, instruction, point, split, task);
|
||||
if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType()) || type.equals(StandarStirageErroEnum.VOIDANCE.getType())) {
|
||||
updateData2(poinCode, instruction, point, split);
|
||||
List list = new ArrayList();
|
||||
String x = point.getExtraValue().get("x").toString();
|
||||
String y = split[1];
|
||||
@@ -754,12 +754,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = null;
|
||||
}
|
||||
|
||||
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split, Integer task) {
|
||||
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split) {
|
||||
Instruction instructionUpdate = checkInst();
|
||||
TaskDto taskUpdate = new TaskDto();
|
||||
instructionUpdate.setNext_point_code(poinCode);
|
||||
instructionUpdate.setNext_device_code(split[0]);
|
||||
instructionUpdate.setInstruction_code(String.valueOf(task));
|
||||
taskUpdate.setNext_point_code(poinCode);
|
||||
taskUpdate.setNext_device_code(split[0]);
|
||||
taskUpdate.setTask_id(instructionUpdate.getTask_id());
|
||||
@@ -799,9 +798,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
//放货完成
|
||||
if (forkCargo==0) {
|
||||
if (forkCargo == 0) {
|
||||
//取货中或者取货完成(分入库出库)
|
||||
if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) {
|
||||
if ("1".equals(instructionErro.getExecute_code()) || "2".equals(instructionErro.getExecute_code())) {
|
||||
List list = new ArrayList();
|
||||
String startDeviceCode = instructionErro.getStart_device_code();
|
||||
Device startDeviceError = deviceAppService.findDeviceByCode(startDeviceCode);
|
||||
@@ -813,10 +812,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
//放货中报警
|
||||
if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) {
|
||||
if ("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) {
|
||||
List list = new ArrayList();
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||
pakagePLCData(list, instructionErro.getTo_x(), instructionErro.getTo_y(), instructionErro.getTo_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||
pakagePLCData(list, instructionErro.getTo_x(), instructionErro.getTo_y(), instructionErro.getTo_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
@@ -825,7 +824,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
//出库报警
|
||||
if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
//取货报警
|
||||
if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) {
|
||||
if ("1".equals(instructionErro.getExecute_code()) || "2".equals(instructionErro.getExecute_code())) {
|
||||
List list = new ArrayList();
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
|
||||
pakagePLCData(list, instructionErro.getFrom_x(), instructionErro.getFrom_y(), instructionErro.getFrom_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||
@@ -834,7 +833,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
//放货中报警
|
||||
if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) {
|
||||
if ("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) {
|
||||
String next_device_code = instructionErro.getNext_device_code();
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
List list = new ArrayList();
|
||||
|
||||
@@ -20,7 +20,7 @@ public class WcsConfig {
|
||||
/**
|
||||
* 堆垛机异常入库次数限制
|
||||
*/
|
||||
public static Integer stacker_error_in_count ;
|
||||
public static Integer stacker_error_in_count = 5;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user