障碍物检测初始化

This commit is contained in:
mmc
2026-10-30 16:28:52 +08:00
parent 2602ef4a57
commit 951b9fa9e5
7 changed files with 215 additions and 144 deletions

View File

@@ -47,6 +47,7 @@ export default class DeviceController {
this.onIsFinished = null;
this.onIsExecuting = null;
this.handleArrivedPoint = null;
this.onDetectionReport = null;
// 全量设备实时状态(mapPush)连接
this.mapPushWs = null;
@@ -167,6 +168,23 @@ export default class DeviceController {
console.log('route_post');
this.onRoutePost?.(msg);
}
if (msg?.type == 'detectionReport') {
console.log('detectionReport');
this.onDetectionReport?.(msg);
}
// case 'detectionReport':
//const { isSecure, obstacle } = msg.data;
//if (isSecure) return;
//const type = obstacle?.type;
//const distance = (obstacle?.distance || 0).toFixed(2);
//const types = { 0: i18n.t('constants.locationUnknown'), 1: i18n.t('devices.obstaclePerson'), 2: i18n.t('devices.obstacleVehicle'), 3: i18n.t('devices.obstacleFence'), 4: i18n.t('devices.obstaclePothole'), 5: i18n.t('devices.obstacleGrass') };
//this.messageApi.warning({
// key: 'obstacle-warning',
// content: i18n.t('devices.obstacleDetectedReport', { obstacle: types[type] ?? i18n.t('devices.unknownObject'), distance }),
// duration: 3,
//});
//break;
@@ -527,10 +545,11 @@ export default class DeviceController {
this.deviceStatusChangedMsg?.(msg);
break;
case 'remoteControl':
case 'detectionReport':
this.onDetectionReport?.(msg);
break;
default:
break;
}