add : 测试入库
This commit is contained in:
@@ -81,27 +81,27 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
*/
|
||||
Instruction inst = null;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 工作模式
|
||||
*/
|
||||
int mode = 0;
|
||||
int last_mode = 0;
|
||||
/**
|
||||
/**
|
||||
* 光电信号
|
||||
*/
|
||||
int move = 0;
|
||||
int last_move = 0;
|
||||
/**
|
||||
/**
|
||||
* 托盘方向
|
||||
*/
|
||||
int carrier_direction = 0;
|
||||
int last_carrier_direction = 0;
|
||||
/**
|
||||
/**
|
||||
* 报警
|
||||
*/
|
||||
int error = 0;
|
||||
int last_error = 0;
|
||||
/**
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
int task = 0;
|
||||
@@ -308,16 +308,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
break;
|
||||
case 4:
|
||||
/**
|
||||
* 申请捆扎
|
||||
*/
|
||||
* 申请捆扎
|
||||
*/
|
||||
if (move > 0) {
|
||||
applyLaStrangulation();
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
/**
|
||||
* 申请贴标
|
||||
*/
|
||||
* 申请贴标
|
||||
*/
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLabeling();
|
||||
|
||||
@@ -526,9 +526,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
try{
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e1){
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.enums.InstructionStatusEnum;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
@@ -281,7 +282,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
instructionService.update(inst);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "纸箱入库输送线任务开始反馈执行中状态,反馈成功,指令号:" + task + ",载具号:" + inst.getVehicle_code());
|
||||
}
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "1") || StrUtil.equals(inst.getInstruction_status(), "0")) {
|
||||
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex()) || StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.READY.getIndex())) {
|
||||
if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
if (mode == 2) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
public class BoxSubvolumesConveyorDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "box_out_subvolumes_conveyor";
|
||||
return "box_subvolumes_conveyor";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,7 +46,7 @@ public class BoxSubvolumesConveyorDefination implements OpcDeviceDriverDefinatio
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.conveyor);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.acs.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.enums.InstructionStatusEnum;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
@@ -34,6 +35,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||
import org.nl.acs.task.enums.TaskTypeEnum;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
@@ -155,6 +157,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
String notCreateTaskMessage = "";
|
||||
String notCreateInstMessage = "";
|
||||
String feedMessage = "";
|
||||
String inst_message;
|
||||
String task_code = null;
|
||||
String vehicle_code;
|
||||
|
||||
|
||||
List<String> getDeviceCodeList = null;
|
||||
@@ -189,6 +194,10 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
// barcode = this.itemProtocol.getBarcode();
|
||||
|
||||
|
||||
if (move != 0 && task > 0) {
|
||||
|
||||
update_instruction_status();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
@@ -311,27 +320,43 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新指令状态
|
||||
*/
|
||||
public synchronized void update_instruction_status() throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
|
||||
|
||||
private void updateInstruct() {
|
||||
if (mode == 3 && task > 0) {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
|
||||
|
||||
} else {
|
||||
this.instruction_update_time = date;
|
||||
//更改指令状态
|
||||
if (task > 0) {
|
||||
Instruction inst = checkInst();
|
||||
if (inst != null) {
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
||||
inst.setInstruction_status(CommonFinalParam.ONE);
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
instructionService.update(inst);
|
||||
} else {
|
||||
this.instruction_update_time = date;
|
||||
inst = checkInst();
|
||||
if (inst != null) {
|
||||
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||
vehicle_code = inst.getVehicle_code();
|
||||
task_code = inst.getTask_code();
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||
inst.setInstruction_status("1");
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
instructionService.update(inst);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "纸箱入库输送线任务开始反馈执行中状态,反馈成功,指令号:" + task + ",载具号:" + inst.getVehicle_code());
|
||||
}
|
||||
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex()) || StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.READY.getIndex())) {
|
||||
if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
if (mode == 2) {
|
||||
finish_instruction();
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "纸箱入库输送线任务开始反馈完成状态,反馈成功,指令号:" + task + ",载具号:" + inst.getVehicle_code());
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成";
|
||||
inst_message = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,7 +378,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
String taskcode = taskdto.getTask_code();
|
||||
String vehiclecode = taskdto.getVehicle_code();
|
||||
String priority = taskdto.getPriority();
|
||||
if (TaskTypeEnum.AGV_Task.equals(taskdto.getTask_type())){
|
||||
|
||||
}
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(taskdto.getRoute_plan_code());
|
||||
@@ -373,6 +400,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
instdto.setPriority(priority);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(device_code);
|
||||
instdto.setInstruction_type(taskdto.getTask_type());
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
@@ -385,7 +413,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
//创建指令后修改任务状态
|
||||
taskdto.setTask_status("1");
|
||||
taskserver.update(taskdto);
|
||||
requireSucess = true;
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
|
||||
List list = new ArrayList();
|
||||
@@ -448,7 +475,10 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public synchronized boolean finish_instruction() throws Exception {
|
||||
instructionService.finish(inst);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
|
||||
@@ -308,106 +308,114 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
//找符合条件的任务
|
||||
BoxSubvolumesConveyorDeviceDriver boxOutSubvolumesConveyorDeviceDriver = new BoxSubvolumesConveyorDeviceDriver();
|
||||
String deviceCode = boxOutSubvolumesConveyorDeviceDriver.getDevice_code();
|
||||
TaskDto taskDto = taskserver.findByEndCodeAndReady(deviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
//抓取工位
|
||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
||||
}
|
||||
//放货工位
|
||||
if (ObjectUtil.isEmpty(putDeviceCodeList)) {
|
||||
putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
|
||||
}
|
||||
//找终点为入库输送线工位任务类型为行架的任务
|
||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||
String startDeviceCode = getDeviceCodeList.get(i);
|
||||
TaskDto taskDto = taskserver.findByStartCodeAndReady(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDto) && TaskTypeEnum.Truss_Task.getIndex().equals(taskDto.getTask_type())) {
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
String start_device_code = taskDto.getStart_device_code();
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
String taskid = taskDto.getTask_id();
|
||||
String taskcode = taskDto.getTask_code();
|
||||
String start_point_code = taskDto.getStart_point_code();
|
||||
String route_plan_code = taskDto.getRoute_plan_code();
|
||||
String next_point_code = taskDto.getNext_point_code();
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
instdto.setTask_id(taskid);
|
||||
instdto.setTask_code(taskcode);
|
||||
instdto.setCreate_by("auto");
|
||||
instdto.setStart_device_code(start_device_code);
|
||||
instdto.setNext_device_code(next_device_code);
|
||||
instdto.setStart_point_code(start_point_code);
|
||||
instdto.setNext_point_code(next_point_code);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(device_code);
|
||||
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
String start_device_code = taskDto.getStart_device_code();
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
String taskid = taskDto.getTask_id();
|
||||
String taskcode = taskDto.getTask_code();
|
||||
String start_point_code = taskDto.getStart_point_code();
|
||||
String route_plan_code = taskDto.getRoute_plan_code();
|
||||
String next_point_code = taskDto.getNext_point_code();
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
instdto.setTask_id(taskid);
|
||||
instdto.setTask_code(taskcode);
|
||||
String now = DateUtil.now();
|
||||
instdto.setCreate_time(now);
|
||||
instdto.setCreate_by("auto");
|
||||
instdto.setStart_device_code(start_device_code);
|
||||
instdto.setNext_device_code(next_device_code);
|
||||
instdto.setStart_point_code(start_point_code);
|
||||
instdto.setNext_point_code(next_point_code);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(device_code);
|
||||
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString());
|
||||
|
||||
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
List list = new ArrayList();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 1);
|
||||
list.add(map1);
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("code", "to_target");
|
||||
map2.put("value", next_addr);
|
||||
list.add(map2);
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
map3.put("code", "to_onset");
|
||||
map3.put("value", start_addr);
|
||||
list.add(map3);
|
||||
Map<String, Object> map4 = new HashMap<>();
|
||||
map4.put("code", "to_task");
|
||||
map4.put("value", instdto.getInstruction_code());
|
||||
list.add(map4);
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_seq())) {
|
||||
Map<String, Object> map5 = new HashMap<>();
|
||||
map5.put("code", "to_seq");
|
||||
map5.put("value", interactionJsonDTO.getItem_to_seq());
|
||||
list.add(map5);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_last_one())) {
|
||||
Map<String, Object> map6 = new HashMap<>();
|
||||
map6.put("code", "to_last_one");
|
||||
map6.put("value", interactionJsonDTO.getItem_to_last_one());
|
||||
list.add(map6);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_direction())) {
|
||||
Map<String, Object> map7 = new HashMap<>();
|
||||
map7.put("code", "to_direction");
|
||||
map7.put("value", interactionJsonDTO.getItem_to_direction());
|
||||
list.add(map7);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getItem_to_max_no())) {
|
||||
Map<String, Object> map8 = new HashMap<>();
|
||||
map8.put("code", "to_max_no");
|
||||
map8.put("value", interactionJsonDTO.getItem_to_max_no());
|
||||
list.add(map8);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
this.writing(list);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "创建指令时出现异常:" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString() + ",指令执行失败:" + e.getMessage());
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString());
|
||||
//创建指令后修改任务状态
|
||||
taskDto.setTask_status("1");
|
||||
taskserver.update(taskDto);
|
||||
requireSucess = true;
|
||||
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
List list = new ArrayList();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 1);
|
||||
list.add(map1);
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("code", "to_target");
|
||||
map2.put("value", next_addr);
|
||||
list.add(map2);
|
||||
Map<String, Object> map3 = new HashMap<>();
|
||||
map3.put("code", "to_onset");
|
||||
map3.put("value", start_addr);
|
||||
list.add(map3);
|
||||
Map<String, Object> map4 = new HashMap<>();
|
||||
map4.put("code", "to_task");
|
||||
map4.put("value", instdto.getInstruction_code());
|
||||
list.add(map4);
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getSeq())) {
|
||||
Map<String, Object> map5 = new HashMap<>();
|
||||
map5.put("code", "to_seq");
|
||||
map5.put("value", interactionJsonDTO.getSeq());
|
||||
list.add(map5);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getLastOne())) {
|
||||
Map<String, Object> map6 = new HashMap<>();
|
||||
map6.put("code", "to_last_one");
|
||||
map6.put("value", interactionJsonDTO.getLastOne());
|
||||
list.add(map6);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getDirection())) {
|
||||
Map<String, Object> map7 = new HashMap<>();
|
||||
map7.put("code", "to_direction");
|
||||
map7.put("value", interactionJsonDTO.getDirection());
|
||||
list.add(map7);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getMaxNo())) {
|
||||
Map<String, Object> map8 = new HashMap<>();
|
||||
map8.put("code", "to_max_no");
|
||||
map8.put("value", interactionJsonDTO.getMaxNo());
|
||||
list.add(map8);
|
||||
}
|
||||
|
||||
try {
|
||||
this.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString() + ",指令执行失败:" + e.getMessage());
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
}else{
|
||||
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
} else {
|
||||
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,22 +6,22 @@ import lombok.Data;
|
||||
public class InteractionJsonDTO {
|
||||
|
||||
/**
|
||||
*木箱长度
|
||||
*木箱最大数量
|
||||
*/
|
||||
private String item_to_max_no = "to_max_no";
|
||||
private String maxNo;
|
||||
/**
|
||||
*木箱宽度
|
||||
*子卷摆放方向
|
||||
*/
|
||||
private String item_to_direction = "to_direction";
|
||||
private String direction;
|
||||
/**
|
||||
*木箱高度
|
||||
*下发木箱工位顺序
|
||||
*/
|
||||
private String item_to_seq = "to_seq";
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
*下发木箱条码
|
||||
*是否最后子卷
|
||||
*/
|
||||
private String item_to_last_one = "to_last_one";
|
||||
private String lastOne;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -292,161 +292,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
special2 = this.itemProtocol.getItem_special2();
|
||||
trayCode = this.itemProtocol.getItem_trayCode();
|
||||
storage_cache = this.itemProtocol.getItem_storage_cache();
|
||||
/*stacker_rpm = this.itemProtocol.getstacker_rpm();
|
||||
stacker_electricCurrent = this.itemProtocol.getstacker_electricCurrent();
|
||||
stacker_runing_time = this.itemProtocol.getstacker_runing_time();
|
||||
stacker_workingHours = this.itemProtocol.getstacker_workingHours();
|
||||
cargo_rpm = this.itemProtocol.getcargo_rpm();
|
||||
cargo_electric_Current = this.itemProtocol.getcargo_electric_Current();
|
||||
cargo_workingHour = this.itemProtocol.getcargo_workingHours();
|
||||
cargo_runingTimes = this.itemProtocol.getcargo_runingTimes();
|
||||
fork_rpm = this.itemProtocol.getfork_rpm();
|
||||
fork_electric_Current = this.itemProtocol.getfork_electric_Current();
|
||||
fork_workingHours = this.itemProtocol.getfork_workingHours();
|
||||
fork_runingTimes = this.itemProtocol.getfork_runingTimes();*/
|
||||
|
||||
if (!item_deviceCode.equals(last_item_deviceCode)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(item_deviceCode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_item_deviceCode + "->" + item_deviceCode);
|
||||
}
|
||||
if (!mode.equals(last_mode)) {
|
||||
requireSucess = false;
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (!command.equals(last_command)) {
|
||||
requireSucess = false;
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(command));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号command:" + last_command + "->" + command);
|
||||
}
|
||||
if (!task.equals(last_task)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
if (!error.equals(last_error)) {
|
||||
if (0 != error) {
|
||||
DeviceErrorLogDto acsDeviceErrorLog = new DeviceErrorLogDto();
|
||||
acsDeviceErrorLog.setDevice_code(this.device_code);
|
||||
acsDeviceErrorLog.setError_code(String.valueOf(error));
|
||||
String errorInfo = ErrorUtil.getDictDetail(ErrorType.STACKER_ERROR.getErrorType(), String.valueOf(error));
|
||||
acsDeviceErrorLog.setError_info(errorInfo);
|
||||
errorLogServer.create(acsDeviceErrorLog);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (!z.equals(last_z)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(z));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号z:" + last_z + "->" + z);
|
||||
}
|
||||
if (!x.equals(last_x)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(x));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号z:" + last_x + "->" + x);
|
||||
}
|
||||
if (!y.equals(last_y)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(y));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号y:" + last_y + "->" + y);
|
||||
}
|
||||
if (!move.equals(last_move)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (!cargoMove.equals(last_cargoMove)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargoMove));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号cargoMove:" + last_cargoMove + "->" + cargoMove);
|
||||
}
|
||||
if (!action.equals(last_action)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(action));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action);
|
||||
}
|
||||
if (!distancex.equals(last_distancex)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distancex));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号distancex:" + last_distancex + "->" + distancex);
|
||||
}
|
||||
if (!distancey.equals(last_distancey)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distancey));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号distancey:" + last_distancey + "->" + distancey);
|
||||
}
|
||||
if (!cargoError.equals(last_cargoError)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargoError));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号cargoError:" + last_cargoError + "->" + cargoError);
|
||||
}
|
||||
if (!forkCargo.equals(last_forkCargo)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(forkCargo));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号forkCargo:" + last_forkCargo + "->" + forkCargo);
|
||||
}
|
||||
if (!forkLocation.equals(last_forkLocation)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(forkLocation));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号forkLocation:" + last_forkLocation + "->" + forkLocation);
|
||||
}
|
||||
if (!forkAction.equals(last_forkAction)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(forkAction));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号forkAction:" + last_forkAction + "->" + forkAction);
|
||||
}
|
||||
if (!special1.equals(last_special1)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(special1));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号special1:" + last_special1 + "->" + special1);
|
||||
}
|
||||
if (!special2.equals(last_special2)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(special2));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号special2:" + last_special2 + "->" + special2);
|
||||
}
|
||||
if (!Arrays.equals(trayCode, last_trayCode)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", Arrays.toString(trayCode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号trayCode:" + Arrays.toString(last_trayCode) + "->" + Arrays.toString(trayCode));
|
||||
}
|
||||
if (!storage_cache.equals(last_storage_cache)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(storage_cache));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号storage_cache:" + last_storage_cache + "->" + storage_cache);
|
||||
}
|
||||
/*if (!stacker_rpm.equals(last_stacker_rpm)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(stacker_rpm));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_stacker_rpm + "->" + stacker_rpm);
|
||||
}
|
||||
if (!stacker_electricCurrent.equals(last_stacker_electricCurrent)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(stacker_electricCurrent));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_stacker_electricCurrent + "->" + stacker_electricCurrent);
|
||||
}
|
||||
if (!stacker_runing_time.equals(last_stacker_runing_time)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(stacker_runing_time));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_stacker_runing_time + "->" + stacker_runing_time);
|
||||
}
|
||||
if (!stacker_workingHours.equals(last_stacker_workingHours)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(stacker_workingHours));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_stacker_workingHours + "->" + stacker_workingHours);
|
||||
}
|
||||
if (!cargo_rpm.equals(last_cargo_rpm)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(stacker_workingHours));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_cargo_rpm + "->" + cargo_rpm);
|
||||
}
|
||||
if (!cargo_electric_Current.equals(last_cargo_electric_Current)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargo_electric_Current));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_cargo_electric_Current + "->" + cargo_electric_Current);
|
||||
}
|
||||
if (!cargo_workingHour.equals(last_cargo_workingHour)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargo_workingHour));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_cargo_workingHour + "->" + cargo_workingHour);
|
||||
}
|
||||
if (!cargo_runingTimes.equals(last_cargo_runingTimes)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargo_runingTimes));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_cargo_runingTimes + "->" + cargo_runingTimes);
|
||||
}
|
||||
if (!fork_rpm.equals(last_fork_rpm)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(fork_rpm));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_fork_rpm + "->" + fork_rpm);
|
||||
}
|
||||
if (!fork_electric_Current.equals(last_fork_electric_Current)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(fork_electric_Current));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_fork_electric_Current + "->" + fork_electric_Current);
|
||||
}
|
||||
if (!fork_workingHours.equals(last_fork_workingHours)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(fork_workingHours));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_fork_workingHours + "->" + fork_workingHours);
|
||||
}
|
||||
if (!fork_runingTimes.equals(last_fork_runingTimes)) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(fork_runingTimes));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_fork_runingTimes + "->" + fork_runingTimes);
|
||||
}*/
|
||||
|
||||
// 更新指令状态
|
||||
if (mode == 3 && task > 0) {
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package org.nl.acs.device_driver.storage.double_extension_storage;
|
||||
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device.enums.DeviceType;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.DeviceDriverDefination;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双伸位货架
|
||||
*/
|
||||
@Service
|
||||
public class DoubleExtensionStorageDefination implements DeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "double_extension_storage";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "双伸位货架";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "双伸位货架";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new DoubleExtensionStorageDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return DoubleExtensionStorageDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.storage);
|
||||
return types;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package org.nl.acs.device_driver.storage.double_extension_storage;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.StorageDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||
|
||||
|
||||
/**
|
||||
* 标准版货架
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
public class DoubleExtensionStorageDeviceDriver extends AbstractDeviceDriver implements RouteableDeviceDriver, StorageDeviceDriver, DeviceDriver {
|
||||
public DoubleExtensionStorageDeviceDriver() {
|
||||
|
||||
}
|
||||
|
||||
public boolean isTakeReady() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isPutReady() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean fixTypes(Integer type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class CreateDDJInst {
|
||||
if (startDevice.getDevice_type().equals(DeviceType.storage.name()) &&
|
||||
(nextDevice.getDevice_type().equals(DeviceType.conveyor.name()) || nextDevice.getDevice_type().equals(DeviceType.storage.name()))) {
|
||||
taskDtoList.add(taskDto);
|
||||
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(taskDtoList)) {
|
||||
|
||||
@@ -139,9 +139,6 @@ export default {
|
||||
standard_conveyor_control_with_scanner,
|
||||
standard_conveyor_control,
|
||||
standard_conveyor_monitor,
|
||||
// hailiang_smart_plc_test,
|
||||
// paint_conveyor,
|
||||
// empty_vehicle_stacking_position,
|
||||
agv_ndc_two,
|
||||
agv_ndc_one,
|
||||
xg_agv,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<!--标准版-输送机-控制点-->
|
||||
<!--一楼木箱机械手、子卷机械手对接位-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
|
||||
Reference in New Issue
Block a user