地图 位置 偏移修复 急停割刀加确认机制
This commit is contained in:
@@ -961,7 +961,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
width: 2,
|
width: 2,
|
||||||
// 规划航线用橙色,和实时轨迹区分
|
// 规划航线用橙色,和实时轨迹区分
|
||||||
material: Cesium.Color.ORANGE.withAlpha(0.8),
|
material: Cesium.Color.ORANGE.withAlpha(0.8),
|
||||||
clampToGround: true,
|
clampToGround: false,
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1085,7 +1085,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
outline: true,
|
outline: true,
|
||||||
outlineColor: Cesium.Color.ORANGE.withAlpha(0.8),
|
outlineColor: Cesium.Color.ORANGE.withAlpha(0.8),
|
||||||
height: 0,
|
height: 0,
|
||||||
clampToGround: true,
|
clampToGround: false,
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1096,7 +1096,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
width: 2,
|
width: 2,
|
||||||
|
|
||||||
material: Cesium.Color.ORANGE.withAlpha(0.8),
|
material: Cesium.Color.ORANGE.withAlpha(0.8),
|
||||||
clampToGround: true,
|
clampToGround: false,
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1346,7 +1346,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
positions: linePositions,
|
positions: linePositions,
|
||||||
width: 4,
|
width: 4,
|
||||||
material: Cesium.Color.SKYBLUE,
|
material: Cesium.Color.SKYBLUE,
|
||||||
clampToGround: true,
|
clampToGround: false,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2116,7 +2116,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
outline: true,
|
outline: true,
|
||||||
outlineColor: Cesium.Color.fromCssColorString('#13C2C2').withAlpha(0.9),
|
outlineColor: Cesium.Color.fromCssColorString('#13C2C2').withAlpha(0.9),
|
||||||
height: 0,
|
height: 0,
|
||||||
clampToGround: true,
|
clampToGround: false,
|
||||||
},
|
},
|
||||||
label: region?.regionName ? {
|
label: region?.regionName ? {
|
||||||
text: region.regionName,
|
text: region.regionName,
|
||||||
@@ -2977,7 +2977,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
|||||||
positions: positions,
|
positions: positions,
|
||||||
width: 2,
|
width: 2,
|
||||||
material: Cesium.Color.BLUE.withAlpha(0.9),
|
material: Cesium.Color.BLUE.withAlpha(0.9),
|
||||||
clampToGround: true,
|
clampToGround: false,
|
||||||
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -292,30 +292,30 @@ export default function ErrorManagement() {
|
|||||||
return <Tag color={getSeverityColor(text)}>{severityObj?.label || text}</Tag>;
|
return <Tag color={getSeverityColor(text)}>{severityObj?.label || text}</Tag>;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
//{
|
||||||
title: t('systemSetting.checkField'),
|
// title: t('systemSetting.checkField'),
|
||||||
dataIndex: 'field',
|
// dataIndex: 'field',
|
||||||
key: 'field',
|
// key: 'field',
|
||||||
width: 130,
|
// width: 130,
|
||||||
},
|
//},
|
||||||
{
|
//{
|
||||||
title: t('systemSetting.compareRule'),
|
// title: t('systemSetting.compareRule'),
|
||||||
dataIndex: 'compareType',
|
// dataIndex: 'compareType',
|
||||||
key: 'compareType',
|
// key: 'compareType',
|
||||||
width: 140,
|
// width: 140,
|
||||||
render: (val) => {
|
// render: (val) => {
|
||||||
const item = CompareEnumOptions.find(o => o.value === val);
|
// const item = CompareEnumOptions.find(o => o.value === val);
|
||||||
return item?.label || val;
|
// return item?.label || val;
|
||||||
},
|
// },
|
||||||
},
|
//},
|
||||||
|
|
||||||
{
|
//{
|
||||||
title: t('systemSetting.compareValueCol'),
|
// title: t('systemSetting.compareValueCol'),
|
||||||
dataIndex: 'compareValues',
|
// dataIndex: 'compareValues',
|
||||||
key: 'compareValues',
|
// key: 'compareValues',
|
||||||
width: 140,
|
// width: 140,
|
||||||
|
|
||||||
},
|
//},
|
||||||
{
|
{
|
||||||
title: t('common.description'),
|
title: t('common.description'),
|
||||||
dataIndex: 'errorDescription',
|
dataIndex: 'errorDescription',
|
||||||
|
|||||||
@@ -631,12 +631,12 @@ export default function DeviceOverviewPage() {
|
|||||||
|
|
||||||
// 机器人视频
|
// 机器人视频
|
||||||
// 机器人视频:只有 robotPlayActive = true 才真正拉流
|
// 机器人视频:只有 robotPlayActive = true 才真正拉流
|
||||||
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
//const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||||
(!isUAV && robotPlayActive && !selectedDevice?.hasHost) ? (selectedDevice?.serialNumber || '') : '',
|
// (!isUAV && robotPlayActive && !selectedDevice?.hasHost) ? (selectedDevice?.serialNumber || '') : '',
|
||||||
(!isUAV && robotPlayActive)
|
// (!isUAV && robotPlayActive)
|
||||||
? `webrtc://1.95.137.212/live/livestream/${selectedDevice?.serialNumber}`
|
// ? `webrtc://1.95.137.212/live/livestream/${selectedDevice?.serialNumber}`
|
||||||
: ''
|
// : ''
|
||||||
);
|
//);
|
||||||
|
|
||||||
const getDevivePermisstion = (data) => {
|
const getDevivePermisstion = (data) => {
|
||||||
const params = {
|
const params = {
|
||||||
@@ -1320,22 +1320,10 @@ export default function DeviceOverviewPage() {
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
robotPlayActive ? (
|
robotPlayActive ? (
|
||||||
selectedDevice?.hasHost ? (
|
<div className="device-overview-video-inner">
|
||||||
<div className="device-overview-video-inner">
|
<AgrtcRoomRobot CHANNEL={selectedDevice?.serialNumber || ''} />
|
||||||
<AgrtcRoomRobot CHANNEL={selectedDevice?.serialNumber || ''} />
|
</div>
|
||||||
</div>
|
|
||||||
) : robotVideo ? (
|
|
||||||
<VideoPlayer
|
|
||||||
deviceId={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
|
||||||
idx={mowerView === 'front' ? 1 : mowerView === 'back' ? 2 : mowerView === 'left' ? 3 : 4}
|
|
||||||
className="w-full h-full object-contain"
|
|
||||||
video={robotVideo}
|
|
||||||
error={error}
|
|
||||||
ready={ready}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="device-overview-video-loading">{t('video.videoLoading')}</div>
|
|
||||||
)
|
|
||||||
) : (
|
) : (
|
||||||
// ========== 未点击播放时:显示播放大按钮 ==========
|
// ========== 未点击播放时:显示播放大按钮 ==========
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import {
|
|||||||
message,
|
message,
|
||||||
Modal,
|
Modal,
|
||||||
Switch,
|
Switch,
|
||||||
DatePicker
|
DatePicker,
|
||||||
|
App
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
DashboardOutlined,
|
DashboardOutlined,
|
||||||
@@ -79,7 +80,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { backToRestPointCommand } from '@/api/mapEdit';
|
import { backToRestPointCommand } from '@/api/mapEdit';
|
||||||
import CarReverseGuideLine from './CarReverseGuideLine';
|
import CarReverseGuideLine from './CarReverseGuideLine';
|
||||||
import mowerImg from '../../assets/images/mower.png';
|
import mowerImg from '../../assets/images/mower.png';
|
||||||
import { sendEmergencyStop, syncEmergencyStop } from './emergencyStopControl';
|
import { sendEmergencyStop, syncEmergencyStop, subscribeEmergencyStop } from './emergencyStopControl';
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
@@ -153,6 +154,8 @@ export default function DeviceStatusPage() {
|
|||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
});
|
});
|
||||||
|
const { modal } = App.useApp();
|
||||||
|
|
||||||
const [mowerView, setMowerView] = useState('front');
|
const [mowerView, setMowerView] = useState('front');
|
||||||
const [steerXY, setSteerXY] = useState({ x: 0, y: 0 });
|
const [steerXY, setSteerXY] = useState({ x: 0, y: 0 });
|
||||||
const [isGamepadConnected, setIsGamepadConnected] = useState(false);
|
const [isGamepadConnected, setIsGamepadConnected] = useState(false);
|
||||||
@@ -459,6 +462,9 @@ export default function DeviceStatusPage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
syncEmergencyStop(runningStatus?.emergency_stop);
|
syncEmergencyStop(runningStatus?.emergency_stop);
|
||||||
}, [runningStatus?.emergency_stop]);
|
}, [runningStatus?.emergency_stop]);
|
||||||
|
// 急停当前状态(用于确认弹窗区分「触发急停」还是「解除急停」)
|
||||||
|
const [eStopActive, setEStopActive] = useState(false);
|
||||||
|
useEffect(() => subscribeEmergencyStop(setEStopActive), []);
|
||||||
// 统一在线状态判断:优先实时数据,兜底接口数据
|
// 统一在线状态判断:优先实时数据,兜底接口数据
|
||||||
const isDeviceOnline = useMemo(() => {
|
const isDeviceOnline = useMemo(() => {
|
||||||
// 1. 优先检查实时数据源(WebSocket 推送的 wsDeviceInfo / locationInfo)
|
// 1. 优先检查实时数据源(WebSocket 推送的 wsDeviceInfo / locationInfo)
|
||||||
@@ -481,12 +487,12 @@ export default function DeviceStatusPage() {
|
|||||||
// 3. 兜底用接口返回的 onlineStatus
|
// 3. 兜底用接口返回的 onlineStatus
|
||||||
return device?.onlineStatus == 1;
|
return device?.onlineStatus == 1;
|
||||||
}, [device, wsDeviceInfo, locationInfo,]);
|
}, [device, wsDeviceInfo, locationInfo,]);
|
||||||
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
//const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||||
(!isUAV && isVideoPlaying && !device?.hasHost) ? (device?.serialNumber || '') : '',
|
// (!isUAV && isVideoPlaying && !device?.hasHost) ? (device?.serialNumber || '') : '',
|
||||||
(!isUAV && isVideoPlaying)
|
// (!isUAV && isVideoPlaying)
|
||||||
? `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`
|
// ? `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`
|
||||||
: ''
|
// : ''
|
||||||
);
|
//);
|
||||||
//const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
//const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||||
// !isUAV ? device?.serialNumber : '',
|
// !isUAV ? device?.serialNumber : '',
|
||||||
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
||||||
@@ -697,7 +703,7 @@ export default function DeviceStatusPage() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//console.log(runningStatus,controlMode, "现在的控制controlmode")
|
//console.log(runningStatus,controlMode, "现在的控制controlmode")
|
||||||
if ((controlMode == 3 && runningStatus?.control_mode == 3) || runningStatus?.systemMode == 3) {
|
if ((controlMode == 3 && runningStatus?.control_mode == 3)) {
|
||||||
messageApi.warning(t('devices.onRemoteControl'));
|
messageApi.warning(t('devices.onRemoteControl'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -744,8 +750,12 @@ export default function DeviceStatusPage() {
|
|||||||
warned = true;
|
warned = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((currentStatus?.control_mode != 3 || currentStatus?.controlMode != 3) &&
|
if (
|
||||||
currentStatus?.systemMode != 3) {
|
currentStatus?.controlMode != 3 &&
|
||||||
|
currentStatus?.control_mode != 3 &&
|
||||||
|
currentStatus?.systemMode != 3 &&
|
||||||
|
currentStatus?.system_mode != 3
|
||||||
|
) {
|
||||||
messageApi.warning(t('devices.switchControl'));
|
messageApi.warning(t('devices.switchControl'));
|
||||||
warned = true;
|
warned = true;
|
||||||
}
|
}
|
||||||
@@ -835,11 +845,87 @@ export default function DeviceStatusPage() {
|
|||||||
}, [buildSteerButtons, handleGamepadUpdate]);
|
}, [buildSteerButtons, handleGamepadUpdate]);
|
||||||
|
|
||||||
// 点击:未激活→激活;再次点击→取消;切换同组另一个按钮时自动互斥
|
// 点击:未激活→激活;再次点击→取消;切换同组另一个按钮时自动互斥
|
||||||
const toggleSteerGroup = useCallback((group: SteerGroup, value: string) => {
|
const isConfirmingRef = useRef(false);
|
||||||
if (blockIfGamepadConnected()) return;
|
|
||||||
const prev = steerStateRef.current;
|
const toggleSteerGroup = useCallback(
|
||||||
sendSteerState({ ...prev, [group]: prev[group] === value ? null : value } as Record<SteerGroup, string | null>);
|
(group: SteerGroup, value: string) => {
|
||||||
}, [blockIfGamepadConnected, sendSteerState]);
|
if (blockIfGamepadConnected()) return;
|
||||||
|
|
||||||
|
// 防止重复打开确认框
|
||||||
|
if (isConfirmingRef.current) return;
|
||||||
|
|
||||||
|
const prev = steerStateRef.current;
|
||||||
|
const isActivating = prev[group] !== value;
|
||||||
|
|
||||||
|
// 需要二次确认的危险操作
|
||||||
|
const DANGEROUS_ACTIONS: Record<
|
||||||
|
string,
|
||||||
|
Record<string, { title: string; content: string }>
|
||||||
|
> = {
|
||||||
|
blade: {
|
||||||
|
start: {
|
||||||
|
title: t('devices.steer.confirmCutterStart'),
|
||||||
|
content: t('devices.steer.confirmCutterStartDesc'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
power: {
|
||||||
|
ignition: {
|
||||||
|
title: t('devices.steer.confirmIgnition'),
|
||||||
|
content: t('devices.steer.confirmIgnitionDesc'),
|
||||||
|
},
|
||||||
|
shutdown: {
|
||||||
|
title: t('devices.steer.confirmShutdown'),
|
||||||
|
content: t('devices.steer.confirmShutdownDesc'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const danger = isActivating
|
||||||
|
? DANGEROUS_ACTIONS[group]?.[value]
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
// 真正执行操作时读取最新状态
|
||||||
|
const doToggle = () => {
|
||||||
|
const latest = steerStateRef.current;
|
||||||
|
|
||||||
|
sendSteerState({
|
||||||
|
...latest,
|
||||||
|
[group]: latest[group] === value ? null : value,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (danger) {
|
||||||
|
isConfirmingRef.current = true;
|
||||||
|
|
||||||
|
modal.confirm({
|
||||||
|
title: danger.title,
|
||||||
|
content: danger.content,
|
||||||
|
okText: t('common.confirm'),
|
||||||
|
cancelText: t('common.cancel'),
|
||||||
|
okButtonProps: { danger: true },
|
||||||
|
|
||||||
|
onOk: () => {
|
||||||
|
try {
|
||||||
|
doToggle();
|
||||||
|
} finally {
|
||||||
|
isConfirmingRef.current = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onCancel: () => {
|
||||||
|
isConfirmingRef.current = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
afterClose: () => {
|
||||||
|
isConfirmingRef.current = false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
doToggle();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[blockIfGamepadConnected, sendSteerState, t, modal]
|
||||||
|
);
|
||||||
|
|
||||||
// 锁存期间每 100ms 持续发送,保持"按住"语义
|
// 锁存期间每 100ms 持续发送,保持"按住"语义
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -1558,7 +1644,17 @@ export default function DeviceStatusPage() {
|
|||||||
<DPadControl
|
<DPadControl
|
||||||
onGamepadUpdate={(state) => { if (blockIfGamepadConnected()) return; handleGamepadUpdate(state); }}
|
onGamepadUpdate={(state) => { if (blockIfGamepadConnected()) return; handleGamepadUpdate(state); }}
|
||||||
onSpeedChange={() => { }}
|
onSpeedChange={() => { }}
|
||||||
onEmergencyStop={() => sendEmergencyStop(selectedSn)}
|
onEmergencyStop={() => {
|
||||||
|
const isRelease = eStopActive;
|
||||||
|
modal.confirm({
|
||||||
|
title: isRelease ? t('devices.steer.confirmEmergencyRelease') : t('devices.steer.confirmEmergencyStop'),
|
||||||
|
content: isRelease ? t('devices.steer.confirmEmergencyReleaseDesc') : t('devices.steer.confirmEmergencyStopDesc'),
|
||||||
|
okText: t('common.confirm'),
|
||||||
|
cancelText: t('common.cancel'),
|
||||||
|
okButtonProps: { danger: !isRelease },
|
||||||
|
onOk: () => sendEmergencyStop(selectedSn),
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ width: '100%', display: 'flex', flexDirection: 'column', gap: 8 }}>
|
<div style={{ width: '100%', display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
BatteryWarning,
|
BatteryWarning,
|
||||||
MoveVertical,
|
MoveVertical,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
import { App } from 'antd';
|
||||||
|
|
||||||
export type RobotFeature =
|
export type RobotFeature =
|
||||||
| 'emergencyStop'
|
| 'emergencyStop'
|
||||||
@@ -75,6 +76,8 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
const [active, setActive] = useState<Set<RobotFeature>>(new Set(activeFeatures));
|
const [active, setActive] = useState<Set<RobotFeature>>(new Set(activeFeatures));
|
||||||
|
const { modal } = App.useApp();
|
||||||
|
|
||||||
// 临时按压闪烁标记
|
// 临时按压闪烁标记
|
||||||
const [flashKey, setFlashKey] = useState<RobotFeature | null>(null);
|
const [flashKey, setFlashKey] = useState<RobotFeature | null>(null);
|
||||||
// 急停锁存状态:与 DPad / 手柄共用同一份状态,点击后保持按下态
|
// 急停锁存状态:与 DPad / 手柄共用同一份状态,点击后保持按下态
|
||||||
@@ -97,7 +100,15 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
|
|||||||
// 一次性按钮:只发指令,不切换active状态
|
// 一次性按钮:只发指令,不切换active状态
|
||||||
if (oneShotKeys.includes(feature)) {
|
if (oneShotKeys.includes(feature)) {
|
||||||
if (feature === 'emergencyStop') {
|
if (feature === 'emergencyStop') {
|
||||||
sendEmergencyStop(deviceId || "");
|
const isRelease = eStopActive;
|
||||||
|
modal.confirm({
|
||||||
|
title: isRelease ? t('devices.steer.confirmEmergencyRelease') : t('devices.steer.confirmEmergencyStop'),
|
||||||
|
content: isRelease ? t('devices.steer.confirmEmergencyReleaseDesc') : t('devices.steer.confirmEmergencyStopDesc'),
|
||||||
|
okText: t('common.confirm'),
|
||||||
|
cancelText: t('common.cancel'),
|
||||||
|
okButtonProps: { danger: !isRelease },
|
||||||
|
onOk: () => sendEmergencyStop(deviceId || ""),
|
||||||
|
});
|
||||||
onToggle?.(feature, true);
|
onToggle?.(feature, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||||
import { Row, Col, Card, Button, Space, Table, Tag, Typography, Badge, Tabs, Input, Switch, Tooltip, Timeline, Select, message, DatePicker, TimePicker, Popconfirm, App, Radio, Empty, Collapse } from 'antd';
|
import { Row, Col, Card, Button, Space, Table, Tag, Typography, Badge, Tabs, Input, Switch, Tooltip, Timeline, Select, message, DatePicker, TimePicker, Popconfirm, App, Radio, Empty, Collapse, Modal } from 'antd';
|
||||||
import { PlusOutlined, ImportOutlined, NodeIndexOutlined, SaveOutlined, DeleteOutlined, CloseOutlined, ReloadOutlined, ExclamationCircleOutlined, EnvironmentOutlined, EnvironmentFilled } from '@ant-design/icons';
|
import { PlusOutlined, ImportOutlined, NodeIndexOutlined, SaveOutlined, DeleteOutlined, CloseOutlined, ReloadOutlined, ExclamationCircleOutlined, EnvironmentOutlined, EnvironmentFilled } from '@ant-design/icons';
|
||||||
import { Car, Navigation, MapPinned, Route, Satellite, LayoutGrid, CheckCircle2, AlertCircle, TrendingUp, Maximize2 } from 'lucide-react';
|
import { Car, Navigation, MapPinned, Route, Satellite, LayoutGrid, CheckCircle2, AlertCircle, TrendingUp, Maximize2 } from 'lucide-react';
|
||||||
import TaskTypeRadio from '../taskRadio/taskRadio';
|
import TaskTypeRadio from '../taskRadio/taskRadio';
|
||||||
@@ -123,10 +123,10 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
robot: null,
|
robot: null,
|
||||||
planId: null,
|
planId: null,
|
||||||
});
|
});
|
||||||
const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
//const { video: robotVideo, error, ready } = useWebRTCPlayer(
|
||||||
executingRobot?.serialNumber ? executingRobot?.serialNumber : '',
|
// executingRobot?.serialNumber ? executingRobot?.serialNumber : '',
|
||||||
`webrtc://1.95.137.212/live/livestream/${executingRobot?.serialNumber}`,
|
// `webrtc://1.95.137.212/live/livestream/${executingRobot?.serialNumber}`,
|
||||||
);
|
//);
|
||||||
const [historyFilterForm, setHistoryFilterForm] = useState({
|
const [historyFilterForm, setHistoryFilterForm] = useState({
|
||||||
taskStatus: null,
|
taskStatus: null,
|
||||||
robot: null,
|
robot: null,
|
||||||
@@ -900,10 +900,10 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
const res = await cancelRoute(params);
|
const res = await cancelRoute(params);
|
||||||
if (res.code === 200 && res.data == true) {
|
if (res.code === 200 && res.data == true) {
|
||||||
utils.message.success(t('devices.fixed2TaskSuspended2Fixed2CancelledFixed2'));
|
utils.message.success(t('devices.fixed2TaskSuspended2Fixed2CancelledFixed2'));
|
||||||
fetchTaskPoolList();
|
//fetchTaskPoolList();
|
||||||
fetchTaskHistoryList();
|
//fetchTaskHistoryList();
|
||||||
fetchStatsTaskHistoryList();
|
//fetchStatsTaskHistoryList();
|
||||||
fetchConsecutiveTaskList();
|
//fetchConsecutiveTaskList();
|
||||||
setExecute(false);
|
setExecute(false);
|
||||||
//if (controllerRef.current) {
|
//if (controllerRef.current) {
|
||||||
// controllerRef.current.destroy?.();
|
// controllerRef.current.destroy?.();
|
||||||
@@ -934,9 +934,9 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
const res = await pauseRoute(params);
|
const res = await pauseRoute(params);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
utils.message.success(t('devices.taskPaused'));
|
utils.message.success(t('devices.taskPaused'));
|
||||||
fetchTaskPoolList();
|
//fetchTaskPoolList();
|
||||||
fetchTaskHistoryList();
|
//fetchTaskHistoryList();
|
||||||
fetchStatsTaskHistoryList();
|
//fetchStatsTaskHistoryList();
|
||||||
} else {
|
} else {
|
||||||
utils.message.error(res.msg || t('devices.pauseFailed'));
|
utils.message.error(res.msg || t('devices.pauseFailed'));
|
||||||
}
|
}
|
||||||
@@ -957,9 +957,9 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
const res = await recoverRoute(params);
|
const res = await recoverRoute(params);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
utils.message.success(t('devices.taskResumed'));
|
utils.message.success(t('devices.taskResumed'));
|
||||||
fetchTaskPoolList();
|
//fetchTaskPoolList();
|
||||||
fetchTaskHistoryList();
|
//fetchTaskHistoryList();
|
||||||
fetchStatsTaskHistoryList();
|
//fetchStatsTaskHistoryList();
|
||||||
} else {
|
} else {
|
||||||
utils.message.error(res.msg || t('devices.resumeFailed'));
|
utils.message.error(res.msg || t('devices.resumeFailed'));
|
||||||
}
|
}
|
||||||
@@ -1621,7 +1621,16 @@ export function TaskPlanningView({ selectedMachineSn, embedded = false, onStatsC
|
|||||||
|
|
||||||
// 急停:与 DPad 保持一致,调用共享锁存接口(再次点击解除)
|
// 急停:与 DPad 保持一致,调用共享锁存接口(再次点击解除)
|
||||||
const handleEmergencyStop = () => {
|
const handleEmergencyStop = () => {
|
||||||
sendEmergencyStop(selectedMachineSn || targetRobot?.serialNumber || '');
|
// 已急停 -> 再次点击是解除;未急停 -> 点击是触发
|
||||||
|
const isRelease = eStopActive;
|
||||||
|
modal.confirm({
|
||||||
|
title: isRelease ? t('devices.steer.confirmEmergencyRelease') : t('devices.steer.confirmEmergencyStop'),
|
||||||
|
content: isRelease ? t('devices.steer.confirmEmergencyReleaseDesc') : t('devices.steer.confirmEmergencyStopDesc'),
|
||||||
|
okText: t('common.confirm'),
|
||||||
|
cancelText: t('common.cancel'),
|
||||||
|
okButtonProps: { danger: !isRelease },
|
||||||
|
onOk: () => sendEmergencyStop(selectedMachineSn || targetRobot?.serialNumber || ''),
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选中的路径对象列表(用于拖拽排序显示)
|
// 选中的路径对象列表(用于拖拽排序显示)
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ export default class DeviceController {
|
|||||||
this.onMapPush?.(next);
|
this.onMapPush?.(next);
|
||||||
}
|
}
|
||||||
if (msg?.type == 'device_task_change') {
|
if (msg?.type == 'device_task_change') {
|
||||||
|
console.log('task change:', msg);
|
||||||
|
|
||||||
if (msg.status == "FINISH") {
|
if (msg.status == "FINISH") {
|
||||||
console.log('task finish');
|
console.log('task finish');
|
||||||
this.onIsFinished?.(msg);
|
this.onIsFinished?.(msg);
|
||||||
|
|||||||
@@ -697,7 +697,19 @@
|
|||||||
chassisDownHint: 'Chassis down',
|
chassisDownHint: 'Chassis down',
|
||||||
cutterControl: 'Cutter Control',
|
cutterControl: 'Cutter Control',
|
||||||
cutterAccel: 'Cutter Faster',
|
cutterAccel: 'Cutter Faster',
|
||||||
cutterDecel: 'Cutter Slower',
|
cutterDecel: "Cutter Stop",
|
||||||
|
confirmEmergencyStop: "Confirm Emergency Stop?",
|
||||||
|
confirmEmergencyStopDesc: "Triggering emergency stop will immediately halt all robot motion. This action cannot be undone.",
|
||||||
|
confirmEmergencyRelease: "Confirm Release Emergency Stop?",
|
||||||
|
confirmEmergencyReleaseDesc: "Releasing emergency stop will restore robot control. Ensure the surrounding area is safe.",
|
||||||
|
confirmCutterStart: "Confirm Cutter Start?",
|
||||||
|
confirmCutterStartDesc: "The cutter will start working. Ensure the surrounding area is clear.",
|
||||||
|
confirmCutterStop: "Confirm Cutter Stop?",
|
||||||
|
confirmCutterStopDesc: "The cutter will stop.",
|
||||||
|
confirmIgnition: "Confirm Ignition?",
|
||||||
|
confirmIgnitionDesc: "The robot chassis will start. Watch for people and obstacles around.",
|
||||||
|
confirmShutdown: "Confirm Shutdown?",
|
||||||
|
confirmShutdownDesc: "The robot chassis will shut down and all motion will stop.",
|
||||||
},
|
},
|
||||||
features: {
|
features: {
|
||||||
title: 'Feature Control',
|
title: 'Feature Control',
|
||||||
|
|||||||
@@ -730,7 +730,19 @@ const zh = {
|
|||||||
chassisDownHint: '底盘下降',
|
chassisDownHint: '底盘下降',
|
||||||
cutterControl: '割刀控制',
|
cutterControl: '割刀控制',
|
||||||
cutterAccel: '割刀启动',
|
cutterAccel: '割刀启动',
|
||||||
cutterDecel: '割刀停止',
|
cutterDecel: "割刀停止",
|
||||||
|
confirmEmergencyStop: "确认触发急停?",
|
||||||
|
confirmEmergencyStopDesc: "触发急停后机器人所有运动将立即停止,此操作不可撤销。",
|
||||||
|
confirmEmergencyRelease: "确认解除急停?",
|
||||||
|
confirmEmergencyReleaseDesc: "解除急停后机器人将恢复可控状态,请确认周围环境安全。",
|
||||||
|
confirmCutterStart: "确认启动割刀?",
|
||||||
|
confirmCutterStartDesc: "割刀启动后将进入持续工作状态,请确保周围环境安全。",
|
||||||
|
confirmCutterStop: "确认停止割刀?",
|
||||||
|
confirmCutterStopDesc: "割刀将停止工作。",
|
||||||
|
confirmIgnition: "确认点火启动?",
|
||||||
|
confirmIgnitionDesc: "机器人底盘将启动,请注意周围人员与障碍物。",
|
||||||
|
confirmShutdown: "确认熄火?",
|
||||||
|
confirmShutdownDesc: "机器人底盘将熄火,当前所有运动将停止。",
|
||||||
},
|
},
|
||||||
features: {
|
features: {
|
||||||
title: '功能控制',
|
title: '功能控制',
|
||||||
|
|||||||
Reference in New Issue
Block a user