更新
This commit is contained in:
@@ -192,45 +192,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
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) {
|
if (mode == 2 && move != 0 && task > 0) {
|
||||||
//inst_message
|
//inst_message
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
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();
|
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())) {
|
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||||
vehicle_code = inst.getVehicle_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();
|
finish_instruction();
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
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() {
|
public synchronized void applyAgvTask() {
|
||||||
Date date = new Date();
|
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);
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.require_empty_out_time = date;
|
this.instruction_require_time = date;
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
message = "申请AGV搬运任务中...";
|
message = "申请AGV搬运任务中...";
|
||||||
JSONObject apply = new JSONObject();
|
JSONObject apply = new JSONObject();
|
||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
apply.put("type","4");
|
apply.put("type","1");
|
||||||
String str = acsToWmsService.applyTaskToWms(apply);
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
|
|||||||
@@ -684,6 +684,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
jo.put("hasGoods", true);
|
jo.put("hasGoods", true);
|
||||||
}
|
}
|
||||||
jo.put("device_name", this.getDevice().getDevice_name());
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
|
jo.put("driver_type", "standard_conveyor_control_with_scanner");
|
||||||
jo.put("mode", mode);
|
jo.put("mode", mode);
|
||||||
jo.put("move", move);
|
jo.put("move", move);
|
||||||
jo.put("action", action);
|
jo.put("action", action);
|
||||||
|
|||||||
Reference in New Issue
Block a user