优化新版航向角显示 和中英文
This commit is contained in:
@@ -423,6 +423,20 @@ export default function DeviceStatusPage() {
|
||||
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
||||
//);
|
||||
const getVal = (val) => val === "no_rain" ? t('devices.rainNo') : (val || '-');
|
||||
const fixStatusMap: Record<string, string> = {
|
||||
'no_fix': t('devices.noFix'),
|
||||
'single': t('devices.single'),
|
||||
'dgnss': t('devices.dgnss'),
|
||||
'ins': t('devices.ins'),
|
||||
'rtk_fixed': t('devices.rtkFixed'),
|
||||
'rtk_float': t('devices.rtkFloat'),
|
||||
'single_no_heading': t('devices.singleNoHeading'),
|
||||
'dgnss_no_heading': t('devices.dgnssNoHeading'),
|
||||
'rtk_fixed_no_heading': t('devices.rtkFixedNoHeading'),
|
||||
'rtk_float_no_heading': t('devices.rtkFloatNoHeading'),
|
||||
}
|
||||
|
||||
|
||||
|
||||
const realtimePosition = React.useMemo(() => {
|
||||
// 1. 无人机:优先用 MQTT 实时数据
|
||||
@@ -1167,11 +1181,7 @@ export default function DeviceStatusPage() {
|
||||
<span>{runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||
<span>{t('devices.rtPositioning')}:</span>
|
||||
<span>
|
||||
{runningStatus.qual == 0 ? t('constants.locationInvalid') :
|
||||
runningStatus.qual == 1 ? t('devices.gpsSingle') :
|
||||
runningStatus.qual == 2 ? t('devices.dgpsDiff') :
|
||||
runningStatus.qual == 4 ? t('devices.rtkFixed2') :
|
||||
runningStatus.qual == 5 ? t('devices.rtkFloat') : t('constants.locationUnknown')}
|
||||
{runningStatus.fix_status ? fixStatusMap[runningStatus.fix_status] : t('constants.locationUnknown')}
|
||||
</span>
|
||||
<span>{t('devices.rtSatellites')}:</span>
|
||||
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</span>
|
||||
@@ -1280,11 +1290,8 @@ export default function DeviceStatusPage() {
|
||||
<span>{runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||
<span>{t('devices.rtPositioning')}</span>
|
||||
<span>
|
||||
{runningStatus.qual == 0 ? t('constants.locationInvalid') :
|
||||
runningStatus.qual == 1 ? t('devices.gpsSingle') :
|
||||
runningStatus.qual == 2 ? t('devices.dgpsDiff') :
|
||||
runningStatus.qual == 4 ? t('devices.rtkFixed2') :
|
||||
runningStatus.qual == 5 ? t('devices.rtkFloat') : t('constants.locationUnknown')}
|
||||
{runningStatus.fix_status ? fixStatusMap[runningStatus.fix_status] : t('constants.locationUnknown')}
|
||||
|
||||
</span>
|
||||
<span>{t('devices.rtSatellites')}</span>
|
||||
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</span>
|
||||
|
||||
@@ -145,6 +145,20 @@ export default function RobotTaskPage() {
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
const controllerRef = useRef<DeviceController | null>(null);
|
||||
const isFirstConnect = useRef(true);
|
||||
const fixStatusMap: Record<string, string> = {
|
||||
'no_fix': t('devices.noFix'),
|
||||
'single': t('devices.single'),
|
||||
'dgnss': t('devices.dgnss'),
|
||||
'ins': t('devices.ins'),
|
||||
'rtk_fixed': t('devices.rtkFixed'),
|
||||
'rtk_float': t('devices.rtkFloat'),
|
||||
'single_no_heading': t('devices.singleNoHeading'),
|
||||
'dgnss_no_heading': t('devices.dgnssNoHeading'),
|
||||
'rtk_fixed_no_heading': t('devices.rtkFixedNoHeading'),
|
||||
'rtk_float_no_heading': t('devices.rtkFloatNoHeading'),
|
||||
}
|
||||
|
||||
|
||||
const handleFinish = (data) => {
|
||||
setExecute(false);
|
||||
setShowVideo(false); // 任务完成关闭视频
|
||||
@@ -1268,6 +1282,19 @@ export default function RobotTaskPage() {
|
||||
<span style={{ color: '#9eff9e' }}>{t('devices.remoteMode')}</span>
|
||||
)}
|
||||
</span>
|
||||
{/* const fixStatusMap: Record<string, string> = {
|
||||
'no_fix': t('devices.noFix'),
|
||||
'single': t('devices.single'),
|
||||
'dgnss': t('devices.dgnss'),
|
||||
'ins': t('devices.ins'),
|
||||
'rtk_fixed': t('devices.rtkFixed'),
|
||||
'rtk_float': t('devices.rtkFloat'),
|
||||
'single_no_heading': t('devices.singleNoHeading'),
|
||||
'dgnss_no_heading': t('devices.dgnssNoHeading'),
|
||||
'rtk_fixed_no_heading': t('devices.rtkFixedNoHeading'),
|
||||
'rtk_float_no_heading': t('devices.rtkFloatNoHeading'),
|
||||
}
|
||||
*/}
|
||||
|
||||
<span>
|
||||
{t('devices.heading')}
|
||||
@@ -1280,11 +1307,7 @@ export default function RobotTaskPage() {
|
||||
|
||||
<span>
|
||||
{t('devices.location')}
|
||||
{(() => {
|
||||
const qual = robotRealtimePosition?.qual;
|
||||
const info = getLocationQuality(qual);
|
||||
return <span style={{ color: info.color }}>{info.text}</span>;
|
||||
})()}
|
||||
{robotRealtimePosition?.fix_status ? fixStatusMap[robotRealtimePosition?.fix_status] : t('constants.locationUnknown')}
|
||||
</span>
|
||||
|
||||
{/* 视频开关 */}
|
||||
|
||||
Reference in New Issue
Block a user