急停 发送的模式切换 接收障碍物信息 纵览界面 返航和任务表格数据 优化 状态界面加入人员跟随和 系统模式 还未对接系统模式 任务监控界面加入障碍物

This commit is contained in:
mmc
2026-11-13 20:29:49 +08:00
parent e77d956434
commit f057e0b72c
10 changed files with 537 additions and 109 deletions

View File

@@ -19,7 +19,8 @@ export type RobotFeature =
| 'tiltProtection'
| 'findCar'
| 'autoback'
| 'controlMode';
| 'controlMode'
| 'personFollow';
export interface FeatureConfig {
key: RobotFeature;
@@ -37,6 +38,7 @@ const FEATURES: FeatureConfig[] = [
//{ key: 'tiltProtection', icon: <MoveVertical className="w-6 h-6" />, activeColor: '#10b981', inactiveColor: '#94a3b8' },
{ key: 'autoback', icon: <Zap className="w-6 h-6" />, activeColor: '#22c55e', inactiveColor: '#94a3b8' },
{ key: 'findCar', icon: <ShieldAlert className="w-6 h-6" />, activeColor: '#ef4444', inactiveColor: '#94a3b8' },
{ key: 'personFollow', icon: <MoveVertical className="w-6 h-6" />, activeColor: '#10b981', inactiveColor: '#94a3b8' },
];
// 急停方块
@@ -55,6 +57,7 @@ interface RobotFeatureButtonsProps {
sendFindCar?: () => void;
sendAutoBack?: () => void;
sendControlMode?: () => void;
deviceId?: string;
controlMode?: number | string;
}
@@ -66,7 +69,8 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
sendFindCar,
sendAutoBack,
sendControlMode,
controlMode
controlMode,
deviceId
}) => {
const { t } = useTranslation();
const { userInfo } = useSelector((state: RootState) => state.user);
@@ -75,10 +79,11 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
const [flashKey, setFlashKey] = useState<RobotFeature | null>(null);
// 一次性触发,不toggle的按钮列表
const oneShotKeys: RobotFeature[] = ['emergencyStop', 'findCar', 'autoback', 'controlMode'];
const oneShotKeys: RobotFeature[] = ['emergencyStop', 'findCar', 'autoback', 'controlMode', 'personFollow'];
const list = showEmergencyStop ? [EMERGENCY, ...FEATURES] : FEATURES;
const handleClick = (feature: RobotFeature) => {
// 触发按压反馈
setFlashKey(feature);
@@ -89,7 +94,7 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
// 一次性按钮:只发指令,不切换active状态
if (oneShotKeys.includes(feature)) {
if (feature === 'emergencyStop') {
sendEmergencyStop(userInfo);
sendEmergencyStop(deviceId || "");
onToggle?.(feature, true);
return;
}
@@ -100,8 +105,12 @@ const RobotFeatureButtons: React.FC<RobotFeatureButtonsProps> = ({
sendAutoBack?.();
}
if (feature === 'controlMode') {
sendControlMode?.();
sendControlMode?.(3);
}
if (
feature === 'personFollow'
) sendControlMode?.(4);
return;
}