diff --git a/src/components/VideoPlayer.tsx b/src/components/VideoPlayer.tsx index 39850cf..1b2c1dc 100644 --- a/src/components/VideoPlayer.tsx +++ b/src/components/VideoPlayer.tsx @@ -27,11 +27,11 @@ const VideoPlayer: React.FC = ({ const currentTitle = title || viewTitles[idx - 1]; if (!deviceId || error) { - return ; + return ; } if (!ready || !video) { - return ; + return ; } return ( diff --git a/src/components/devices/DeviceStatusPage.tsx b/src/components/devices/DeviceStatusPage.tsx index 17913f9..917a024 100644 --- a/src/components/devices/DeviceStatusPage.tsx +++ b/src/components/devices/DeviceStatusPage.tsx @@ -994,7 +994,7 @@ export default function DeviceStatusPage({ ) : ( // 机器人原布局 - + @@ -1015,7 +1015,13 @@ export default function DeviceStatusPage({ -
+
{robotVideo ? ( mowerView === 'all' ? ( ) : ( - +
+ + {/* 单视频模式状态叠加层 */} +
+
机器人状态
+
+ 电量: + + {runningStatus.battery !== undefined ? `${runningStatus.battery}%` : '-'} + + 电压: + {runningStatus.voltage !== undefined ? `${Number(runningStatus.voltage).toFixed(2)}V` : '-'} + 左电机: + {runningStatus.leftCurrent !== undefined ? `${Number(runningStatus.leftCurrent).toFixed(2)}A` : '-'} + 右电机: + {runningStatus.rightCurrent !== undefined ? `${Number(runningStatus.rightCurrent).toFixed(2)}A` : '-'} + 左速度: + {runningStatus.leftMeasureSpeed !== undefined ? `${Number(runningStatus.leftMeasureSpeed).toFixed(1)}rpm` : '-'} + 右速度: + {runningStatus.rightMeasureSpeed !== undefined ? `${Number(runningStatus.rightMeasureSpeed).toFixed(1)}rpm` : '-'} + 左温度: + {runningStatus.leftMotorTemp !== undefined ? `${Number(runningStatus.leftMotorTemp).toFixed(1)}℃` : '-'} + 右温度: + {runningStatus.rightMotorTemp !== undefined ? `${Number(runningStatus.rightMotorTemp).toFixed(1)}℃` : '-'} + 主控温度: + {runningStatus.chipTemp !== undefined ? `${Number(runningStatus.chipTemp).toFixed(1)}℃` : '-'} + 航向角: + {runningStatus.yaw !== undefined ? `${Number(runningStatus.yaw).toFixed(1)}°` : '-'} + 俯仰角: + {runningStatus.pitch !== undefined ? `${Number(runningStatus.pitch).toFixed(1)}°` : '-'} + 定位: + + {runningStatus.qual == 0 ? '无效' : + runningStatus.qual == 1 ? 'GPS单点' : + runningStatus.qual == 2 ? 'DGPS差分' : + runningStatus.qual == 4 ? 'RTK固定' : + runningStatus.qual == 5 ? 'RTK浮点' : '未知'} + + 卫星: + {runningStatus.satelliteCnt || 0}颗 + 模式: + + {runningStatus.controlMode == 1 ? '本地' : + runningStatus.controlMode == 3 ? '远程' : '未知'} + +
+
+ +
) ) : (
视频加载中...
)}
+ + {/* 右边 - 占1格,上部地图,下部远程控制 */} + + {/* 地图 */} @@ -1076,8 +1146,8 @@ export default function DeviceStatusPage({ } bordered={false} - style={{ borderRadius: 12 }} - bodyStyle={{ padding: 12, height: 400 }} + style={{ borderRadius: 12, marginBottom: 8, flex: 1, minHeight: 280 }} + bodyStyle={{ padding: 12, height: 'calc((100vh - 260px) / 2)', minHeight: 280 }} > - - - - 机器人状态详情} - bordered={false} - style={{ borderRadius: 12, marginBottom: 8 }} - extra={{device.onlineStatus === 1 ? '在线' : '离线'}} - > - - 电池电量}> - - - 系统电压}> - {fix2(runningStatus.voltage)} V - - {fix2(runningStatus?.leftCurrent)} A - {fix2(runningStatus?.rightCurrent)} A - {fix2(runningStatus?.leftMeasureSpeed)} rpm - {fix2(runningStatus?.rightMeasureSpeed)} rpm - {fix2(runningStatus?.leftMotorTemp)} ℃ - {fix2(runningStatus?.rightMotorTemp)} ℃ - {fix2(runningStatus?.chipTemp)} ℃ - {(runningStatus?.headingStatus == 1 ? "已初始化" : "未初始化")} - {(runningStatus?.controlMode == 1 ? "本地模式" : runningStatus?.controlMode == 3 ? "远程模式" : "控制模式")} - - - {runningStatus?.qual == 0 - ? '无效' - : runningStatus?.qual == 1 - ? 'GPS 单点定位' - : runningStatus?.qual == 2 - ? 'DGPS 伪距差分或 SBAS' - : runningStatus?.qual == 4 - ? 'RTK 固定解' - : runningStatus?.qual == 5 - ? 'RTK 浮点解' - : '未知'} - - - - - - {fix2(runningStatus?.yaw)}° - {fix2(runningStatus?.pitch)}° - - + {/* 远程控制面板 */} @@ -1149,9 +1173,9 @@ export default function DeviceStatusPage({ } bordered={false} - style={{ borderRadius: 12, background: '#0f172a' }} + style={{ borderRadius: 12, background: '#0f172a', flex: 1, minHeight: 280, }} headStyle={{ color: '#fff' }} - bodyStyle={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }} + bodyStyle={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: 'calc(100% - 57px)' }} > - {/* ========== 左列:左视 ========== */} + {/* 前视 - 铺满整个区域 */}
-
- -
左视
-
+
- {/* ========== 中列:上-前视 下-后视 ========== */} + {/* 左视 - 左上角 */}
- {/* 前视 */} -
- -
前视
-
- {/* 后视 */} -
- -
后视
-
+ + +
+ + {/* 右视 - 右上角 */} +
+ + +
+ + {/* 后视 - 底部居中 */} +
+ +
-
-
- -
右视
+
机器人状态
+
+ 电量: + + {statusData.battery !== undefined ? `${statusData.battery}%` : '-'} + + 电压: + {statusData.voltage !== undefined ? `${Number(statusData.voltage).toFixed(2)}V` : '-'} + 左电机: + {statusData.leftCurrent !== undefined ? `${Number(statusData.leftCurrent).toFixed(2)}A` : '-'} + 右电机: + {statusData.rightCurrent !== undefined ? `${Number(statusData.rightCurrent).toFixed(2)}A` : '-'} + 左速度: + {statusData.leftMeasureSpeed !== undefined ? `${Number(statusData.leftMeasureSpeed).toFixed(1)}rpm` : '-'} + 右速度: + {statusData.rightMeasureSpeed !== undefined ? `${Number(statusData.rightMeasureSpeed).toFixed(1)}rpm` : '-'} + 左温度: + {statusData.leftMotorTemp !== undefined ? `${Number(statusData.leftMotorTemp).toFixed(1)}℃` : '-'} + 右温度: + {statusData.rightMotorTemp !== undefined ? `${Number(statusData.rightMotorTemp).toFixed(1)}℃` : '-'} + 主控温度: + {statusData.chipTemp !== undefined ? `${Number(statusData.chipTemp).toFixed(1)}℃` : '-'} + 航向角: + {statusData.yaw !== undefined ? `${Number(statusData.yaw).toFixed(1)}°` : '-'} + 俯仰角: + {statusData.pitch !== undefined ? `${Number(statusData.pitch).toFixed(1)}°` : '-'} + 定位: + + {statusData.qual == 0 ? '无效' : + statusData.qual == 1 ? 'GPS单点' : + statusData.qual == 2 ? 'DGPS差分' : + statusData.qual == 4 ? 'RTK固定' : + statusData.qual == 5 ? 'RTK浮点' : '未知'} + + 卫星: + {statusData.satelliteCnt || 0}颗 + 模式: + + {statusData.controlMode == 1 ? '本地' : + statusData.controlMode == 3 ? '远程' : '未知'} + +
-
+ )}
) }