From ebbffc61f4cd7a992e1f4cd1d6156f0f40e2f050 Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Fri, 27 Jan 2023 10:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SiemensConveyorDeviceDriver.java | 51 ++----------------- ...CoveyorControlWithScannerDeviceDriver.java | 1 + 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index b472065ad..55a00f3f4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -192,45 +192,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); } -// if (task > 0) { -// Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); -// if (ObjectUtil.isNotEmpty(instruction)) { -// -// if (StrUtil.equals(this.getDeviceCode(), instruction.getStart_device_code())) { -// -// if (StrUtil.equals(instruction.getInstruction_status(), "0")) { -// instruction.setInstruction_status("1"); -// instructionService.update(instruction); -// } -// -// String next_device_code = instruction.getNext_device_code(); -// Device device = deviceAppservice.findDeviceByCode(next_device_code); -// if (ObjectUtil.isEmpty(device)) { -// logServer.deviceExecuteLog(this.device_code, "", "", "任务号:" + task + "输送线任务未完成,目标站设备为空!"); -// return; -// } -// SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; -// if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { -// if(mode ==2 ){ -// siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); -// int nextTask = siemensConveyorDeviceDriver.getTask(); -// if (nextTask == task) { -// inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code(); -// if (StrUtil.equals(instruction.getInstruction_status(), "1")) { -// inst = instruction; -// finish_instruction(); -// this.clearWrite(); -// } -// } -// } -// -// } -// } -// -// } -// -// } - if (mode == 2 && move != 0 && task > 0) { //inst_message inst = instructionService.findByCodeFromCache(String.valueOf(task)); @@ -238,12 +199,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { vehicle_code = inst.getVehicle_code(); -// Device device = deviceAppservice.findDeviceByCode("BCR1"); -// StandardScannerDeviceDriver standardScannerDeviceDriver; -// if (device.getDeviceDriver() instanceof ScannerDeviceDriver) { -// standardScannerDeviceDriver = (StandardScannerDeviceDriver) device.getDeviceDriver(); -// standardScannerDeviceDriver.writeBarcode(vehicle_code); -// } finish_instruction(); } if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { @@ -873,16 +828,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme public synchronized void applyAgvTask() { Date date = new Date(); - if (date.getTime() - this.require_empty_out_time.getTime() < (long) this.instruction_require_time_out) { + if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - this.require_empty_out_time = date; + this.instruction_require_time = date; if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { message = "申请AGV搬运任务中..."; JSONObject apply = new JSONObject(); apply.put("device_code", device_code); - apply.put("type","4"); + apply.put("type","1"); String str = acsToWmsService.applyTaskToWms(apply); JSONObject jo = JSON.parseObject(str); if (ObjectUtil.isEmpty(jo)) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index 087162f8c..32a3ea317 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -684,6 +684,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe jo.put("hasGoods", true); } jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("driver_type", "standard_conveyor_control_with_scanner"); jo.put("mode", mode); jo.put("move", move); jo.put("action", action);