机器人控制界面和 实时监控界面 加上 急停、避障、低电量自动返航、倾斜保护等 功能面板 加上 方向盘点击 控制机器 功能
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react';
|
||||
import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react';
|
||||
import {
|
||||
Card, Row, Col, Table, Select, Input, Tag,
|
||||
Typography, Button, Space, Avatar, Pagination,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
PauseCircleOutlined, StopOutlined, InfoCircleOutlined,
|
||||
ClockCircleOutlined, EnvironmentOutlined, PlusOutlined,
|
||||
SettingOutlined, ExclamationCircleOutlined, FileTextOutlined,
|
||||
DeleteOutlined, AimOutlined, SendOutlined, LockOutlined,
|
||||
DeleteOutlined, AimOutlined, SendOutlined, LockOutlined, SafetyOutlined,
|
||||
NodeIndexOutlined, SaveOutlined, MaximizeOutlined, ReloadOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { Line, Bar, Pie } from '@ant-design/charts';
|
||||
@@ -28,6 +28,7 @@ import { useSelector } from 'react-redux';
|
||||
import dayjs from 'dayjs';
|
||||
import envConfig from '../../env';
|
||||
import { useMqtt } from '../hooks/useMqtt';
|
||||
import RobotFeatureButtons from '../components/devices/RobotFeatureButtons';
|
||||
import DeviceController from '../components/devices/deviceController';
|
||||
|
||||
import {
|
||||
@@ -369,19 +370,19 @@ const RealTimeMonitorPage = () => {
|
||||
const lat = rt.lat;
|
||||
//if (!isFinite(lon) || !isFinite(lat) || (lon === 0 && lat === 0)) return d;
|
||||
return {
|
||||
...d,
|
||||
longitude: lon,
|
||||
latitude: lat,
|
||||
heading: rt.yaw,
|
||||
batteryLevel: rt.battery,
|
||||
feStatus: rt.status,
|
||||
taskId: rt.taskId,
|
||||
updateTime: rt.updateTime || d.updateTime,
|
||||
// 同步写入 locationMessage / lastRunningStatus,确保 Map.jsx 设备渲染 useEffect 能读到实时坐标
|
||||
locationMessage: { longitude: lon, latitude: lat, heading: rt.yaw, batteryLevel: rt.battery },
|
||||
lastRunningStatus: { longitude: lon, latitude: lat, heading: rt.yaw, batteryLevel: rt.battery },
|
||||
raw: { ...(d.raw || d), heading: rt.yaw, batteryLevel: rt.b, longitude: lon, latitude: lat },
|
||||
};
|
||||
...d,
|
||||
longitude: lon,
|
||||
latitude: lat,
|
||||
heading: rt.yaw,
|
||||
batteryLevel: rt.battery,
|
||||
feStatus: rt.status,
|
||||
taskId: rt.taskId,
|
||||
updateTime: rt.updateTime || d.updateTime,
|
||||
// 同步写入 locationMessage / lastRunningStatus,确保 Map.jsx 设备渲染 useEffect 能读到实时坐标
|
||||
locationMessage: { longitude: lon, latitude: lat, heading: rt.yaw, batteryLevel: rt.battery },
|
||||
lastRunningStatus: { longitude: lon, latitude: lat, heading: rt.yaw, batteryLevel: rt.battery },
|
||||
raw: { ...(d.raw || d), heading: rt.yaw, batteryLevel: rt.b, longitude: lon, latitude: lat },
|
||||
};
|
||||
});
|
||||
}, [devices, realtimeMap]);
|
||||
|
||||
@@ -1383,6 +1384,19 @@ const RealTimeMonitorPage = () => {
|
||||
)}
|
||||
</Card>
|
||||
|
||||
<Card size="small" style={{ borderRadius: 10, marginBottom: 0 }}>
|
||||
<p style={{ fontWeight: 600, fontSize: 13, marginBottom: 8 }}>
|
||||
<SafetyOutlined style={{ color: '#fa541c', marginRight: 6 }} />
|
||||
{t('devices.features.title')}
|
||||
</p>
|
||||
<RobotFeatureButtons
|
||||
activeFeatures={['response', 'obstacleAvoidance', 'lowBatteryReturn', 'tiltProtection']}
|
||||
onToggle={(feature, enabled) => {
|
||||
console.log('[RTMonitor Feature]', feature, enabled);
|
||||
}}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{/* ============== 【中部】预设路径列表 ============== */}
|
||||
<Card
|
||||
size="small"
|
||||
|
||||
Reference in New Issue
Block a user