fix: AGV驱动

This commit is contained in:
2026-10-12 16:31:27 +08:00
parent 45db781a40
commit 87cfbbdd19
9 changed files with 126 additions and 12 deletions

View File

@@ -178,23 +178,23 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
log.info("接收agv上报信息:" + bs);
log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno);
Device device = null;
// Device device = null;
String device_code = null;
String old_device_code = null;
String emptyNum = null;
// String emptyNum = null;
if (agvaddr != 0) {
old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
old_device_code = deviceService.queryDeviceCodeByAddressNoException(agvaddr);
if (StrUtil.contains(old_device_code, "-")) {
String[] point = old_device_code.split("-");
device_code = point[0];
} else if (StrUtil.contains(old_device_code, ".")) {
String[] point = old_device_code.split("\\.");
device_code = point[0];
emptyNum = point[1];
// emptyNum = point[1];
} else {
device_code = old_device_code;
}
device = deviceAppService.findDeviceByCode(device_code);
// device = deviceAppService.findDeviceByCode(device_code);
}
//开始任务
@@ -218,13 +218,13 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
Device agvDevice = deviceAppService.findDeviceByCode(agvcar);
if (agvDevice != null) {
if (agvDevice.getDeviceDriver() instanceof AgvNdcDeviceDriver) {
// AgvNdcDeviceDriver agvNdcTwoDeviceDriver = (AgvNdcDeviceDriver) agvDevice.getDeviceDriver();
// agvNdcTwoDeviceDriver.setInstruction(null);
AgvNdcDeviceDriver agvNdcTwoDeviceDriver = (AgvNdcDeviceDriver) agvDevice.getDeviceDriver();
agvNdcTwoDeviceDriver.setInstruction(null);
}
}
inst.setInstruction_status("2");
try {
//instructionService.finish(inst);
instructionService.finish(inst.getInstruction_id());
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -288,6 +288,7 @@ public interface DeviceService extends CommonService<Device> {
* @return
*/
String queryDeviceCodeByAddress(int address);
String queryDeviceCodeByAddressNoException(int address);
/**
* 获取缓存设备

View File

@@ -1382,6 +1382,14 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
StorageCell one = storageCellService.getOne(new LambdaQueryWrapper<StorageCell>().eq(StorageCell::getAddress, add));
return one.getStorage_code();
}
@Override
public String queryDeviceCodeByAddressNoException(int add) {
StorageCell one = storageCellService.getOne(new LambdaQueryWrapper<StorageCell>().eq(StorageCell::getAddress, add));
if (ObjectUtil.isEmpty(one)) {
return null;
}
return one.getStorage_code();
}
@Override
public List<Device> findCacheDevice() {

View File

@@ -40,7 +40,7 @@ public class BeltConveyorAgvDefination extends OpcDeviceDriverDefination {
@Override
public List<DeviceType> getFitDeviceTypes() {
List<DeviceType> types = new LinkedList();
types.add(DeviceType.station);
types.add(DeviceType.conveyor);
return types;
}

View File

@@ -40,7 +40,7 @@ public class ManipulatorAgvStationDefination extends OpcDeviceDriverDefination {
@Override
public List<DeviceType> getFitDeviceTypes() {
List<DeviceType> types = new LinkedList<>();
types.add(DeviceType.robot);
types.add(DeviceType.station);
return types;
}

View File

@@ -227,9 +227,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
}
try {
if (StrUtil.equals(shortPathsList.get(0).getType(), RouteTypeEnum.NDC.getCode())) {
ndcApi.sendTask(instruction);
//下发成功,否则失败
instruction.setSend_status(SendStatusEnum.SUCCESS.getCode());
ndcApi.sendTask(instruction);
} else if (StrUtil.equals(shortPathsList.get(0).getType(), RouteTypeEnum.KUKA.getCode())) {
//下发成功,否则失败
SubmitMissionRequest request = new SubmitMissionRequest();

View File

@@ -2,7 +2,7 @@ package org.nl.extInterface.wms.constand;
public class WmsMethodConstant {
public static final String FEEDBACK_TASK_STATUS = "/task/transport/acs-feedback";
public static final String FEEDBACK_BUSINESS_STATUS = "task/transport/acs-business-feedback";
public static final String FEEDBACK_BUSINESS_STATUS = "/task/transport/acs-business-feedback";
public static final String APPLY_INBOUND_TASK = "/admin-api/acs/wms/inbound/apply";
public static final String APPLY_OUTBOUND_AGV_TASK = "/acs/call/outbound/agv/apply";
public static final String CALL_EMPTY_PALLET_STACK = "/admin-api/acs/wms/applyEmptyPalletOutbound";

View File

@@ -101,6 +101,7 @@ import dice_storage_station from './driver/one_conveyor/dice_storage_station.vue
import dice_storage_manipulator from './driver/one_manipulator/dice_storage_manipulator.vue'
import box_packing_in_manipulator from './driver/two_manipulator/box_packing_in_manipulator.vue'
import box_agv_wait_station from './driver/two_station/box_agv_wait_station.vue'
import agv_ndc from './driver/agv/agv_ndc.vue'
export default {
name: 'DeviceConfig',
components: {
@@ -109,6 +110,7 @@ export default {
standard_inspect_site,
agv_ndc_two,
agv_ndc_one,
agv_ndc,
xg_agv,
belt_conveyor,
standard_manipulator,

View File

@@ -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,
require: 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>