opt:宁波富佳NDC优化
This commit is contained in:
@@ -366,7 +366,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
(byte) 0X00, (byte) 0X6D,
|
||||
(byte) 0X00, (byte) 0X06,
|
||||
(byte) indexhigh, (byte) indexlow,
|
||||
(byte) 0X01, (byte) 0X10,
|
||||
(byte) 0X01, (byte) 0X12,
|
||||
(byte) phasehigh, (byte) phaselow
|
||||
};
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
//任务完毕
|
||||
//(无车id及状态)
|
||||
else if (phase == 0x14) {
|
||||
else if (phase == 0x0A) {
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令号{}对应的指令", ikey);
|
||||
} else {
|
||||
|
||||
@@ -138,15 +138,15 @@ public class AutoCreateInst {
|
||||
} else {
|
||||
next_point_code = next_device_code;
|
||||
}
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (beltConveyorDeviceDriver.getType() != 2) {
|
||||
beltConveyorDeviceDriver.writing("to_command","7");
|
||||
log.info("当前输送线出入库信号不为出库");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
// if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
// beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
// if (beltConveyorDeviceDriver.getType() != 2) {
|
||||
// beltConveyorDeviceDriver.writing("to_command","7");
|
||||
// log.info("当前输送线出入库信号不为出库");
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
Instruction instdto = new Instruction();
|
||||
@@ -188,22 +188,29 @@ public class AutoCreateInst {
|
||||
instdto.setNext_height(next_height);
|
||||
instdto.setAgv_action_type(agvActionType);
|
||||
|
||||
//本项目默认类型 1
|
||||
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
|
||||
instdto.setAgv_inst_type("1");
|
||||
} else {
|
||||
instdto.setAgv_inst_type("4");
|
||||
}
|
||||
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
|
||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
//满足出库,查询当前出库任务,+1后返回给
|
||||
if (beltConveyorDeviceDriver.getType() == 2) {
|
||||
synchronized (this) {
|
||||
if (beltConveyorDeviceDriver.getType() == 2) {
|
||||
//因为已经创建成功,因此这个时候可以+1了
|
||||
int count = instructionService.queryInstructionCount(next_device_code);
|
||||
beltConveyorDeviceDriver.updateOutboundTaskNum(count,false);
|
||||
beltConveyorDeviceDriver.writing("to_taskNum", count + "");
|
||||
nextdevice.setOutbound_task_num(count);
|
||||
}
|
||||
}
|
||||
}
|
||||
// beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
// //满足出库,查询当前出库任务,+1后返回给
|
||||
// if (beltConveyorDeviceDriver.getType() == 2) {
|
||||
// synchronized (this) {
|
||||
// if (beltConveyorDeviceDriver.getType() == 2) {
|
||||
// //因为已经创建成功,因此这个时候可以+1了
|
||||
// int count = instructionService.queryInstructionCount(next_device_code);
|
||||
// beltConveyorDeviceDriver.updateOutboundTaskNum(count,false);
|
||||
// beltConveyorDeviceDriver.writing("to_taskNum", count + "");
|
||||
// nextdevice.setOutbound_task_num(count);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
acsTask.setRemark(e.getMessage());
|
||||
taskserver.updateByCodeFromCache(acsTask);
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<!--agv单工位-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">指令相关:</span>
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" size="small" label-width="95px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="ip地址" prop="ip_address">
|
||||
<el-input
|
||||
v-model="form.ip_address"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
:loading="false"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
queryDriverConfig,
|
||||
updateConfig
|
||||
} from '@/api/acs/device/driverConfig'
|
||||
import crud from '@/mixins/crud'
|
||||
|
||||
export default {
|
||||
name: 'StandardConveyorControl',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
parentForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
ip_address: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
// 从父表单获取设备编码
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
this.sliceItem()
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = true
|
||||
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<!--agv双工位-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">设备协议:</span>
|
||||
</div>
|
||||
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扫码器ip:" label-width="150px" prop="x">
|
||||
<el-input v-model.trim="form.ip_address" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span" />
|
||||
<el-button
|
||||
:loading="false"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="doSubmit"
|
||||
>保存
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {
|
||||
queryDriverConfig,
|
||||
updateConfig
|
||||
} from '@/api/acs/device/driverConfig'
|
||||
|
||||
import crud from '@/mixins/crud'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
export default {
|
||||
name: 'StandardScanner',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
parentForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
scannerIP: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
// 从父表单获取设备编码
|
||||
this.device_id = this.$props.parentForm.device_id
|
||||
this.device_code = this.$props.parentForm.device_code
|
||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.form) {
|
||||
const arr = Object.keys(data.form)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.form = data.form
|
||||
}
|
||||
}
|
||||
|
||||
// 给表单赋值,并且属性不能为空
|
||||
if (data.parentForm) {
|
||||
const arr = Object.keys(data.parentForm)
|
||||
// 不为空
|
||||
if (arr.length > 0) {
|
||||
this.opc_code = data.parentForm.opc_code
|
||||
this.plc_code = data.parentForm.plc_code
|
||||
}
|
||||
}
|
||||
})
|
||||
deviceCrud.selectDeviceList().then(data => {
|
||||
this.deviceList = data
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
this.configLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user