feat:添加无人船慢速行驶指令
This commit is contained in:
@@ -19,6 +19,7 @@ import LeftPanel from './components/LeftPanel';
|
||||
import CenterView from './components/CenterView';
|
||||
import ExecLeftPanel from './components/ExecLeftPanel';
|
||||
import ExecBottomStrip from './components/ExecBottomStrip';
|
||||
import ExecRightPanel from './components/ExecRightPanel';
|
||||
import { useClientAuth } from './hooks/useClientAuth';
|
||||
import { useClientSSE } from './hooks/useClientSSE';
|
||||
import { useRouteData } from './hooks/useRouteData';
|
||||
@@ -26,7 +27,6 @@ import { useNavigationState } from './hooks/useNavigationState';
|
||||
import { useNavigationData } from './hooks/useNavigationData';
|
||||
import styles from './index.less';
|
||||
|
||||
/** 船 Logo SVG */
|
||||
const ShipLogoIcon: React.FC = () => (
|
||||
<svg width="20" height="20" viewBox="0 0 36 36" fill="none">
|
||||
<path d="M6 27L8.4 21H27.6L30 27C30 27 25.5 30 18 30C10.5 30 6 27 6 27Z" fill="white" fillOpacity="0.9" />
|
||||
@@ -36,7 +36,6 @@ const ShipLogoIcon: React.FC = () => (
|
||||
</svg>
|
||||
);
|
||||
|
||||
/** 格式化秒数为 HH:MM:SS */
|
||||
const formatElapsed = (totalSec: number) => {
|
||||
const h = Math.floor(totalSec / 3600).toString().padStart(2, '0');
|
||||
const m = Math.floor((totalSec % 3600) / 60).toString().padStart(2, '0');
|
||||
@@ -44,20 +43,54 @@ const formatElapsed = (totalSec: number) => {
|
||||
return `${h}:${m}:${s}`;
|
||||
};
|
||||
|
||||
const calculateDistanceMeters = (
|
||||
from: { longitude: number; latitude: number },
|
||||
to: { longitude: number; latitude: number },
|
||||
) => {
|
||||
const earthRadius = 6371000;
|
||||
const dLat = (to.latitude - from.latitude) * Math.PI / 180;
|
||||
const dLon = (to.longitude - from.longitude) * Math.PI / 180;
|
||||
const lat1 = from.latitude * Math.PI / 180;
|
||||
const lat2 = to.latitude * Math.PI / 180;
|
||||
const a = Math.sin(dLat / 2) ** 2
|
||||
+ Math.cos(lat1) * Math.cos(lat2) * Math.sin(dLon / 2) ** 2;
|
||||
return earthRadius * 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
};
|
||||
|
||||
const ClientPage: React.FC = () => {
|
||||
const [messageApi, messageContextHolder] = message.useMessage();
|
||||
const [modalApi, modalContextHolder] = Modal.useModal();
|
||||
// ── 认证 ──
|
||||
const { boatData: sseBoatData, sseConnected, loading: sseLoading, deviceOffline, connectSSE, disconnectSSE } = useClientSSE();
|
||||
|
||||
const {
|
||||
boatData: sseBoatData,
|
||||
sseConnected,
|
||||
loading: sseLoading,
|
||||
deviceOffline,
|
||||
connectSSE,
|
||||
disconnectSSE,
|
||||
} = useClientSSE();
|
||||
const { deviceSn, deviceInfo, handleLogout } = useClientAuth(disconnectSSE);
|
||||
|
||||
// ── 航线数据 ──
|
||||
const { routes, routeWaypointsMap, selectedRouteId, setSelectedRouteId, routeLoading } =
|
||||
useRouteData(deviceSn);
|
||||
const {
|
||||
routes,
|
||||
routeWaypointsMap,
|
||||
selectedRouteId,
|
||||
setSelectedRouteId,
|
||||
routeLoading,
|
||||
} = useRouteData(deviceSn);
|
||||
|
||||
const boatData = sseBoatData;
|
||||
const hasBoatPosition = Number.isFinite(boatData?.longitude) && Number.isFinite(boatData?.latitude);
|
||||
const videoStreamUrl = useMemo(() => {
|
||||
const rawInfo = deviceInfo as any;
|
||||
return rawInfo?.videoStreamUrl
|
||||
|| rawInfo?.whepUrl
|
||||
|| rawInfo?.streamUrl
|
||||
|| rawInfo?.videoUrl
|
||||
|| rawInfo?.liveStreamUrl
|
||||
|| undefined;
|
||||
}, [deviceInfo]);
|
||||
|
||||
// ── 沉浸模式状态机 ──
|
||||
const {
|
||||
isPaused,
|
||||
currentWaypointIndex,
|
||||
@@ -72,43 +105,85 @@ const ClientPage: React.FC = () => {
|
||||
handleResumeSailing,
|
||||
handleStopSailing,
|
||||
handleStopPreview,
|
||||
handleEmergencyStop,
|
||||
handlePreviewChange,
|
||||
} = useNavigationState(deviceSn, selectedRouteId, setSelectedRouteId, routes, messageApi, modalApi);
|
||||
|
||||
// ── SSE 连接 ──
|
||||
useEffect(() => {
|
||||
if (!deviceSn) return;
|
||||
connectSSE(deviceSn);
|
||||
return () => { disconnectSSE(); };
|
||||
}, [deviceSn]);
|
||||
return () => {
|
||||
disconnectSSE();
|
||||
};
|
||||
}, [deviceSn, connectSSE, disconnectSSE]);
|
||||
|
||||
// ── 沉浸模式计时器 ──
|
||||
const [elapsed, setElapsed] = useState(0);
|
||||
const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
const [previewStartSignal, setPreviewStartSignal] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (isImmersive && !isPaused) {
|
||||
timerRef.current = setInterval(() => setElapsed((s) => s + 1), 1000);
|
||||
timerRef.current = setInterval(() => setElapsed((seconds) => seconds + 1), 1000);
|
||||
} else if (timerRef.current) {
|
||||
clearInterval(timerRef.current);
|
||||
timerRef.current = null;
|
||||
}
|
||||
if (!isImmersive) setElapsed(0);
|
||||
return () => { if (timerRef.current) clearInterval(timerRef.current); };
|
||||
|
||||
if (!isImmersive) {
|
||||
setElapsed(0);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (timerRef.current) clearInterval(timerRef.current);
|
||||
};
|
||||
}, [isImmersive, isPaused]);
|
||||
|
||||
// ── 预览航线回调 ──
|
||||
const handlePreviewRoute = useCallback((routeId: string) => {
|
||||
if (routeId !== selectedRouteId) {
|
||||
setSelectedRouteId(routeId);
|
||||
}
|
||||
// 延迟递增信号,让 selectedRouteId 先生效触发航点加载
|
||||
setTimeout(() => setPreviewStartSignal((s) => s + 1), 200);
|
||||
setTimeout(() => setPreviewStartSignal((signal) => signal + 1), 200);
|
||||
}, [selectedRouteId, setSelectedRouteId]);
|
||||
|
||||
// ── 预先计算航线基础信息(不依赖 boatData) ──
|
||||
const handleExecuteRoute = useCallback(async (routeId: string) => {
|
||||
const firstWaypoint = routeWaypointsMap[routeId]?.[0];
|
||||
if (!firstWaypoint) {
|
||||
messageApi.warning('当前航线缺少起始航点,无法执行');
|
||||
return;
|
||||
}
|
||||
if (!hasBoatPosition) {
|
||||
messageApi.warning('尚未收到无人船实时位置,暂时不能执行航线');
|
||||
return;
|
||||
}
|
||||
|
||||
const distance = calculateDistanceMeters(
|
||||
{ longitude: boatData!.longitude, latitude: boatData!.latitude },
|
||||
{ longitude: firstWaypoint.longitude, latitude: firstWaypoint.latitude },
|
||||
);
|
||||
|
||||
if (distance > 200) {
|
||||
modalApi.warning({
|
||||
title: '无法执行航线',
|
||||
centered: true,
|
||||
width: 500,
|
||||
okText: '知道了',
|
||||
content: (
|
||||
<div style={{ paddingTop: 8, textAlign: 'center', lineHeight: 1.9, fontSize: 16 }}>
|
||||
<div>
|
||||
无人船距离航线起点约
|
||||
<span style={{ color: '#ff7875', fontWeight: 700, margin: '0 6px' }}>
|
||||
{Math.round(distance)} 米
|
||||
</span>
|
||||
</div>
|
||||
<div>已超过 200 米,请先将无人船驶近起点后再执行。</div>
|
||||
</div>
|
||||
),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await handleStartSailing(routeId);
|
||||
}, [routeWaypointsMap, boatData, hasBoatPosition, handleStartSailing, messageApi, modalApi]);
|
||||
|
||||
const activeWaypointsRaw = useMemo(() => {
|
||||
if (!activeRouteId) return [];
|
||||
return routeWaypointsMap[activeRouteId] || [];
|
||||
@@ -116,45 +191,40 @@ const ClientPage: React.FC = () => {
|
||||
|
||||
const activeRouteInfoRaw = useMemo(() => {
|
||||
if (!activeRouteId) return null;
|
||||
return routes.find((r) => r.routeId === activeRouteId) || null;
|
||||
return routes.find((route) => route.routeId === activeRouteId) || null;
|
||||
}, [activeRouteId, routes]);
|
||||
|
||||
// ── 预览模式假数据 ──
|
||||
const effectiveBoatData = useMemo(() => {
|
||||
if (!isPreviewing) return boatData;
|
||||
// 如果有真实 SSE 数据,优先使用
|
||||
if (boatData?.longitude) return boatData;
|
||||
// 预览模式下根据航线航点和经过时间生成模拟遥测数据
|
||||
if (hasBoatPosition) return boatData;
|
||||
if (activeWaypointsRaw.length === 0) return null;
|
||||
|
||||
const previewSpeed = 2; // m/s,与预览动画速度一致
|
||||
const previewSpeed = 2;
|
||||
const totalDist = activeRouteInfoRaw?.totalDistance || 1000;
|
||||
const traveled = elapsed * previewSpeed;
|
||||
const fraction = Math.min(traveled / totalDist, 0.99);
|
||||
const wpIdx = Math.min(
|
||||
const waypointIdx = Math.min(
|
||||
Math.floor(fraction * (activeWaypointsRaw.length - 1)),
|
||||
activeWaypointsRaw.length - 2,
|
||||
);
|
||||
const wp = activeWaypointsRaw[wpIdx];
|
||||
const nextWp = activeWaypointsRaw[wpIdx + 1] || wp;
|
||||
const waypoint = activeWaypointsRaw[waypointIdx];
|
||||
const nextWaypoint = activeWaypointsRaw[waypointIdx + 1] || waypoint;
|
||||
|
||||
// 航段内插值
|
||||
const segFrac = (fraction * (activeWaypointsRaw.length - 1)) - wpIdx;
|
||||
const lon = wp.longitude + (nextWp.longitude - wp.longitude) * segFrac;
|
||||
const lat = wp.latitude + (nextWp.latitude - wp.latitude) * segFrac;
|
||||
const segFraction = (fraction * (activeWaypointsRaw.length - 1)) - waypointIdx;
|
||||
const longitude = waypoint.longitude + (nextWaypoint.longitude - waypoint.longitude) * segFraction;
|
||||
const latitude = waypoint.latitude + (nextWaypoint.latitude - waypoint.latitude) * segFraction;
|
||||
|
||||
// 计算航向
|
||||
const dLon = (nextWp.longitude - wp.longitude) * Math.PI / 180;
|
||||
const lat1 = wp.latitude * Math.PI / 180;
|
||||
const lat2 = nextWp.latitude * Math.PI / 180;
|
||||
const dLon = (nextWaypoint.longitude - waypoint.longitude) * Math.PI / 180;
|
||||
const lat1 = waypoint.latitude * Math.PI / 180;
|
||||
const lat2 = nextWaypoint.latitude * Math.PI / 180;
|
||||
const y = Math.sin(dLon) * Math.cos(lat2);
|
||||
const x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(dLon);
|
||||
const heading = ((Math.atan2(y, x) * 180 / Math.PI) + 360) % 360;
|
||||
|
||||
return {
|
||||
deviceSn: deviceSn || '',
|
||||
longitude: lon,
|
||||
latitude: lat,
|
||||
longitude,
|
||||
latitude,
|
||||
heading,
|
||||
speed: previewSpeed,
|
||||
battery: 85,
|
||||
@@ -162,9 +232,8 @@ const ClientPage: React.FC = () => {
|
||||
status: 'preview',
|
||||
recordTime: new Date().toISOString(),
|
||||
} as import('@/types/boatRoute').BoatTelemetryData;
|
||||
}, [isPreviewing, boatData, activeWaypointsRaw, activeRouteInfoRaw, elapsed, deviceSn]);
|
||||
}, [isPreviewing, boatData, hasBoatPosition, activeWaypointsRaw, activeRouteInfoRaw, elapsed, deviceSn]);
|
||||
|
||||
// ── 导航计算(使用 effectiveBoatData 以便预览模式也有数据) ──
|
||||
const {
|
||||
activeWaypoints,
|
||||
activeRouteInfo,
|
||||
@@ -181,192 +250,194 @@ const ClientPage: React.FC = () => {
|
||||
return (
|
||||
<ConfigProvider theme={darkTheme}>
|
||||
<AntdApp>
|
||||
{messageContextHolder}
|
||||
{modalContextHolder}
|
||||
<div className={`${styles.container} ${isImmersive ? styles.sailing : ''}`}>
|
||||
|
||||
{/* ========== 普通模式 - 顶部导航栏 ========== */}
|
||||
{!isImmersive && (
|
||||
<div className={styles.navBar}>
|
||||
<div className={styles.navLogo}>
|
||||
<div className={styles.navLogoIcon}><ShipLogoIcon /></div>
|
||||
<span className={styles.navLogoText}>WAVE PILOT</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.navSpacer} />
|
||||
|
||||
<div className={styles.navTabs}>
|
||||
<div className={`${styles.navTab} ${styles.navTabActive}`}>
|
||||
<EnvironmentOutlined />
|
||||
<span>航线管理</span>
|
||||
{messageContextHolder}
|
||||
{modalContextHolder}
|
||||
<div className={`${styles.container} ${isImmersive ? styles.sailing : ''}`}>
|
||||
{!isImmersive && (
|
||||
<div className={styles.navBar}>
|
||||
<div className={styles.navLogo}>
|
||||
<div className={styles.navLogoIcon}><ShipLogoIcon /></div>
|
||||
<span className={styles.navLogoText}>WAVE PILOT</span>
|
||||
</div>
|
||||
<div className={styles.navTab}>
|
||||
<EyeOutlined />
|
||||
<span>实时监控</span>
|
||||
</div>
|
||||
<div className={styles.navTab}>
|
||||
<HistoryOutlined />
|
||||
<span>历史记录</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.navSpacer} />
|
||||
<div className={styles.navSpacer} />
|
||||
|
||||
<div className={styles.navRight}>
|
||||
<WifiOutlined className={styles.navIconBtn} />
|
||||
<ThunderboltOutlined className={styles.navIconBtn} />
|
||||
<div className={styles.devIndicator}>
|
||||
<span
|
||||
className={styles.devDot}
|
||||
style={{ background: sseConnected ? '#10b981' : '#ff4d4f' }}
|
||||
<div className={styles.navTabs}>
|
||||
<div className={`${styles.navTab} ${styles.navTabActive}`}>
|
||||
<EnvironmentOutlined />
|
||||
<span>航线管理</span>
|
||||
</div>
|
||||
<div className={styles.navTab}>
|
||||
<EyeOutlined />
|
||||
<span>实时监控</span>
|
||||
</div>
|
||||
<div className={styles.navTab}>
|
||||
<HistoryOutlined />
|
||||
<span>历史记录</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.navSpacer} />
|
||||
|
||||
<div className={styles.navRight}>
|
||||
<WifiOutlined className={styles.navIconBtn} />
|
||||
<ThunderboltOutlined className={styles.navIconBtn} />
|
||||
<div className={styles.devIndicator}>
|
||||
<span
|
||||
className={styles.devDot}
|
||||
style={{ background: sseConnected ? '#10b981' : '#ff4d4f' }}
|
||||
/>
|
||||
<span className={styles.devSn}>{deviceInfo.deviceName || deviceSn}</span>
|
||||
</div>
|
||||
<Button
|
||||
type="text"
|
||||
icon={<LogoutOutlined />}
|
||||
onClick={handleLogout}
|
||||
className={styles.navLogoutBtn}
|
||||
size="small"
|
||||
/>
|
||||
<span className={styles.devSn}>{deviceInfo.deviceName || deviceSn}</span>
|
||||
</div>
|
||||
<Button
|
||||
type="text"
|
||||
icon={<LogoutOutlined />}
|
||||
onClick={handleLogout}
|
||||
className={styles.navLogoutBtn}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ========== 沉浸模式 - 执行导航栏 ========== */}
|
||||
{isImmersive && (
|
||||
<div className={styles.execNav}>
|
||||
<button
|
||||
className={styles.execBackBtn}
|
||||
onClick={isPreviewing ? handleStopPreview : handleStopSailing}
|
||||
>
|
||||
<LeftOutlined />
|
||||
</button>
|
||||
|
||||
<div className={styles.execTitleArea}>
|
||||
<div className={styles.execTitle}>
|
||||
{activeRouteInfo?.routeName || '航线'} · {modeLabel}
|
||||
</div>
|
||||
<div className={styles.execSubtitle}>
|
||||
{deviceInfo.deviceName || deviceSn} · 已{isPreviewing ? '预览' : '执行'} {formatElapsed(elapsed)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={styles.execBadge}>
|
||||
<span className={styles.execBadgeDot} />
|
||||
<span>{modeLabel} {modeTag}</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.execSpacer} />
|
||||
|
||||
<div className={styles.execRight}>
|
||||
{isSailing && (
|
||||
<button
|
||||
className={styles.execPauseBtn}
|
||||
onClick={isPaused ? handleResumeSailing : handlePauseSailing}
|
||||
>
|
||||
{isPaused ? <CaretRightOutlined /> : <PauseOutlined />}
|
||||
<span>{isPaused ? '继续' : '暂停'}</span>
|
||||
</button>
|
||||
)}
|
||||
{isImmersive && (
|
||||
<div className={styles.execNav}>
|
||||
<button
|
||||
className={styles.execStopBtn}
|
||||
className={styles.execBackBtn}
|
||||
onClick={isPreviewing ? handleStopPreview : handleStopSailing}
|
||||
>
|
||||
<StopOutlined />
|
||||
<span>终止</span>
|
||||
<LeftOutlined />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ========== 主体区域 ========== */}
|
||||
<div className={styles.mainBody}>
|
||||
|
||||
{/* 设备离线遮罩 */}
|
||||
{deviceOffline && !sseConnected && (
|
||||
<div className={styles.offlineOverlay}>
|
||||
<div className={styles.offlineCard}>
|
||||
<DisconnectOutlined className={styles.offlineIcon} />
|
||||
<div className={styles.offlineTitle}>设备不在线</div>
|
||||
<div className={styles.offlineDesc}>
|
||||
无法订阅设备 <span className={styles.offlineSn}>{deviceInfo.deviceName || deviceSn}</span> 的实时数据
|
||||
<br />
|
||||
{sseLoading ? '正在重新连接...' : '请检查设备是否已开机并接入网络'}
|
||||
<div className={styles.execTitleArea}>
|
||||
<div className={styles.execTitle}>
|
||||
{activeRouteInfo?.routeName || '航线'} · {modeLabel}
|
||||
</div>
|
||||
{sseLoading ? (
|
||||
<Spin size="small" style={{ marginTop: 16 }} />
|
||||
) : (
|
||||
<Button
|
||||
icon={<ReloadOutlined />}
|
||||
onClick={() => connectSSE(deviceSn)}
|
||||
style={{ marginTop: 16, borderColor: 'rgba(34,211,238,0.4)', color: '#22d3ee' }}
|
||||
ghost
|
||||
<div className={styles.execSubtitle}>
|
||||
{deviceInfo.deviceName || deviceSn} · {isPreviewing ? '预览' : '执行'} · {formatElapsed(elapsed)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.execBadge}>
|
||||
<span className={styles.execBadgeDot} />
|
||||
<span>{modeLabel} {modeTag}</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.execSpacer} />
|
||||
|
||||
<div className={styles.execRight}>
|
||||
{isSailing && (
|
||||
<button
|
||||
className={styles.execPauseBtn}
|
||||
onClick={isPaused ? handleResumeSailing : handlePauseSailing}
|
||||
>
|
||||
重试连接
|
||||
</Button>
|
||||
{isPaused ? <CaretRightOutlined /> : <PauseOutlined />}
|
||||
<span>{isPaused ? '继续' : '暂停'}</span>
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className={styles.execStopBtn}
|
||||
onClick={isPreviewing ? handleStopPreview : handleStopSailing}
|
||||
>
|
||||
<StopOutlined />
|
||||
<span>终止</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 左侧边栏 - 普通模式 */}
|
||||
{!isImmersive && (
|
||||
<div className={styles.leftPanel}>
|
||||
<LeftPanel
|
||||
routes={routes}
|
||||
routeWaypointsMap={routeWaypointsMap}
|
||||
loading={routeLoading}
|
||||
selectedRouteId={selectedRouteId}
|
||||
onSelectRoute={setSelectedRouteId}
|
||||
deviceInfo={deviceInfo}
|
||||
boatData={boatData}
|
||||
sseConnected={sseConnected}
|
||||
onStartSailing={handleStartSailing}
|
||||
onPreviewRoute={handlePreviewRoute}
|
||||
sailingLoading={sailingLoading}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.mainBody}>
|
||||
{deviceOffline && !sseConnected && (
|
||||
<div className={styles.offlineOverlay}>
|
||||
<div className={styles.offlineCard}>
|
||||
<DisconnectOutlined className={styles.offlineIcon} />
|
||||
<div className={styles.offlineTitle}>设备不在线</div>
|
||||
<div className={styles.offlineDesc}>
|
||||
无法订阅设备 <span className={styles.offlineSn}>{deviceInfo.deviceName || deviceSn}</span> 的实时数据
|
||||
<br />
|
||||
{sseLoading ? '正在重新连接...' : '请检查设备是否已开机并接入网络'}
|
||||
</div>
|
||||
{sseLoading ? (
|
||||
<Spin size="small" style={{ marginTop: 16 }} />
|
||||
) : (
|
||||
<Button
|
||||
icon={<ReloadOutlined />}
|
||||
onClick={() => connectSSE(deviceSn)}
|
||||
style={{ marginTop: 16, borderColor: 'rgba(34,211,238,0.4)', color: '#22d3ee' }}
|
||||
ghost
|
||||
>
|
||||
重试连接
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 左侧面板 - 沉浸模式 (仪表盘 + 航点列表) */}
|
||||
{isImmersive && (
|
||||
<ExecLeftPanel
|
||||
boatData={effectiveBoatData}
|
||||
waypoints={activeWaypoints}
|
||||
currentWaypointIndex={currentWaypointIndex}
|
||||
/>
|
||||
)}
|
||||
{!isImmersive && (
|
||||
<div className={styles.leftPanel}>
|
||||
<LeftPanel
|
||||
routes={routes}
|
||||
routeWaypointsMap={routeWaypointsMap}
|
||||
loading={routeLoading}
|
||||
selectedRouteId={selectedRouteId}
|
||||
onSelectRoute={setSelectedRouteId}
|
||||
deviceInfo={deviceInfo}
|
||||
boatData={boatData}
|
||||
sseConnected={sseConnected}
|
||||
onStartSailing={handleExecuteRoute}
|
||||
onPreviewRoute={handlePreviewRoute}
|
||||
sailingLoading={sailingLoading}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 地图区域 */}
|
||||
<div className={styles.centerView}>
|
||||
<CenterView
|
||||
deviceSn={deviceSn}
|
||||
routes={routes}
|
||||
selectedRouteId={selectedRouteId}
|
||||
boatData={boatData}
|
||||
isSailing={isSailing}
|
||||
sailingLoading={sailingLoading}
|
||||
previewStartSignal={previewStartSignal}
|
||||
previewStopSignal={previewStopSignal}
|
||||
onStartSailing={handleStartSailing}
|
||||
onPreviewChange={handlePreviewChange}
|
||||
/>
|
||||
|
||||
{/* 沉浸模式 - 底部航线信息条 */}
|
||||
{isImmersive && (
|
||||
<ExecBottomStrip
|
||||
progress={progress}
|
||||
<ExecLeftPanel
|
||||
boatData={effectiveBoatData}
|
||||
waypoints={activeWaypoints}
|
||||
currentWaypointIndex={currentWaypointIndex}
|
||||
totalWaypoints={activeWaypoints.length}
|
||||
remainingDistance={remainingDistance}
|
||||
estimatedRemainingTime={estimatedRemainingTime}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={styles.centerView}>
|
||||
<CenterView
|
||||
deviceSn={deviceSn}
|
||||
routes={routes}
|
||||
selectedRouteId={selectedRouteId}
|
||||
boatData={boatData}
|
||||
isSailing={isSailing}
|
||||
sailingLoading={sailingLoading}
|
||||
previewStartSignal={previewStartSignal}
|
||||
previewStopSignal={previewStopSignal}
|
||||
onStartSailing={handleStartSailing}
|
||||
onPreviewChange={handlePreviewChange}
|
||||
/>
|
||||
|
||||
{isSailing && (
|
||||
<ExecBottomStrip
|
||||
progress={progress}
|
||||
currentWaypointIndex={currentWaypointIndex}
|
||||
totalWaypoints={activeWaypoints.length}
|
||||
remainingDistance={remainingDistance}
|
||||
estimatedRemainingTime={estimatedRemainingTime}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isImmersive && (
|
||||
<div className={styles.execRightPanel}>
|
||||
<ExecRightPanel
|
||||
deviceInfo={deviceInfo}
|
||||
boatData={effectiveBoatData}
|
||||
activeRouteInfo={activeRouteInfo}
|
||||
sseConnected={sseConnected}
|
||||
videoStreamUrl={videoStreamUrl}
|
||||
isPreviewing={isPreviewing}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AntdApp>
|
||||
</ConfigProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user