add:新增分切行架异常任务下发
This commit is contained in:
@@ -321,6 +321,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_head_time = date;
|
||||
String link_device_code = String.valueOf(this.getDevice().getExtraValue().get("link_device_code"));
|
||||
Device device = deviceAppservice.findDeviceByCode(link_device_code);
|
||||
SlitTwoManipulatorDeviceDriver slitTwoManipulatorDeviceDriver;
|
||||
if (device.getDeviceDriver()instanceof SlitTwoManipulatorDeviceDriver) {
|
||||
slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
|
||||
//如果禁用
|
||||
if (slitTwoManipulatorDeviceDriver.getIs_disable()==1){
|
||||
//就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑
|
||||
try {
|
||||
flag = instruction_require2();
|
||||
} catch (Exception e) {
|
||||
flag = false;
|
||||
}
|
||||
if (flag) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//抓取工位
|
||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
||||
@@ -369,6 +387,63 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
return flag;
|
||||
}
|
||||
|
||||
//关联设备异常申请任务
|
||||
public synchronized boolean instruction_require2() {
|
||||
boolean flag = false;
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_head_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_head_time);
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_head_time = date;
|
||||
//抓取工位
|
||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||
getDeviceCodeList = this.getExtraDeviceCodes("error_get_device_code");
|
||||
}
|
||||
//放货工位
|
||||
if (ObjectUtil.isEmpty(putDeviceCodeList)) {
|
||||
putDeviceCodeList = this.getExtraDeviceCodes("error_put_device_code");
|
||||
}
|
||||
TaskDto task = null;
|
||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||
String startDeviceCode = getDeviceCodeList.get(i);
|
||||
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtos)) {
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtos = this.sortTask(taskDtos);
|
||||
TaskDto taskDto = taskDtos.get(0);
|
||||
truss_type = taskDto.getTruss_type();
|
||||
//查询任务是行架任务
|
||||
if (!StrUtil.equals(taskDto.getTask_type(), "6")) {
|
||||
taskDto = null;
|
||||
continue;
|
||||
}
|
||||
flag = this.executeReadyInst(taskDto);
|
||||
} else {
|
||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtoList = this.sortTask(taskDtoList);
|
||||
for (int j = 0; j < taskDtoList.size(); j++) {
|
||||
task = taskDtoList.get(j);
|
||||
|
||||
// 9 行架任务
|
||||
if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) {
|
||||
task = null;
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(task)) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(task)) {
|
||||
flag = this.executeReadyTask(task);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//执行已有就绪指令
|
||||
public synchronized boolean executeReadyInst(TaskDto taskDto) {
|
||||
//获取指令信息
|
||||
|
||||
@@ -175,6 +175,45 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联设备异常时取货点" prop="device_code" label-width="200">
|
||||
<el-select
|
||||
v-model="form.error_get_device_code"
|
||||
multiple
|
||||
filterable
|
||||
reserve-keyword
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联设备异常时放货点" prop="device_code" label-width="200">
|
||||
<el-select
|
||||
v-model="form.error_put_device_code"
|
||||
filterable
|
||||
reserve-keyword
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
@@ -347,7 +386,9 @@ export default {
|
||||
is_release: true,
|
||||
link_device_code: [],
|
||||
get_device_code: [],
|
||||
put_device_code: []
|
||||
put_device_code: [],
|
||||
error_get_device_code: [],
|
||||
error_put_device_code: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user