优化新版航向角显示 和中英文
This commit is contained in:
@@ -423,6 +423,20 @@ export default function DeviceStatusPage() {
|
|||||||
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
// `webrtc://1.95.137.212/live/livestream/${device?.serialNumber}`,
|
||||||
//);
|
//);
|
||||||
const getVal = (val) => val === "no_rain" ? t('devices.rainNo') : (val || '-');
|
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(() => {
|
const realtimePosition = React.useMemo(() => {
|
||||||
// 1. 无人机:优先用 MQTT 实时数据
|
// 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>{runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||||
<span>{t('devices.rtPositioning')}:</span>
|
<span>{t('devices.rtPositioning')}:</span>
|
||||||
<span>
|
<span>
|
||||||
{runningStatus.qual == 0 ? t('constants.locationInvalid') :
|
{runningStatus.fix_status ? fixStatusMap[runningStatus.fix_status] : t('constants.locationUnknown')}
|
||||||
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')}
|
|
||||||
</span>
|
</span>
|
||||||
<span>{t('devices.rtSatellites')}:</span>
|
<span>{t('devices.rtSatellites')}:</span>
|
||||||
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</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>{runningStatus.headingStatus !== undefined ? `${runningStatus.headingStatus == 1 ? t('devices.rtInitialized') : t('devices.uninitialized')}` : '-'}</span>
|
||||||
<span>{t('devices.rtPositioning')}</span>
|
<span>{t('devices.rtPositioning')}</span>
|
||||||
<span>
|
<span>
|
||||||
{runningStatus.qual == 0 ? t('constants.locationInvalid') :
|
{runningStatus.fix_status ? fixStatusMap[runningStatus.fix_status] : t('constants.locationUnknown')}
|
||||||
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')}
|
|
||||||
</span>
|
</span>
|
||||||
<span>{t('devices.rtSatellites')}</span>
|
<span>{t('devices.rtSatellites')}</span>
|
||||||
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</span>
|
<span>{t('devices.satelliteCount', { count: runningStatus.satelliteCnt || 0 })}</span>
|
||||||
|
|||||||
@@ -145,6 +145,20 @@ export default function RobotTaskPage() {
|
|||||||
const [messageApi, contextHolder] = message.useMessage();
|
const [messageApi, contextHolder] = message.useMessage();
|
||||||
const controllerRef = useRef<DeviceController | null>(null);
|
const controllerRef = useRef<DeviceController | null>(null);
|
||||||
const isFirstConnect = useRef(true);
|
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) => {
|
const handleFinish = (data) => {
|
||||||
setExecute(false);
|
setExecute(false);
|
||||||
setShowVideo(false); // 任务完成关闭视频
|
setShowVideo(false); // 任务完成关闭视频
|
||||||
@@ -1268,6 +1282,19 @@ export default function RobotTaskPage() {
|
|||||||
<span style={{ color: '#9eff9e' }}>{t('devices.remoteMode')}</span>
|
<span style={{ color: '#9eff9e' }}>{t('devices.remoteMode')}</span>
|
||||||
)}
|
)}
|
||||||
</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>
|
<span>
|
||||||
{t('devices.heading')}
|
{t('devices.heading')}
|
||||||
@@ -1280,11 +1307,7 @@ export default function RobotTaskPage() {
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
{t('devices.location')}
|
{t('devices.location')}
|
||||||
{(() => {
|
{robotRealtimePosition?.fix_status ? fixStatusMap[robotRealtimePosition?.fix_status] : t('constants.locationUnknown')}
|
||||||
const qual = robotRealtimePosition?.qual;
|
|
||||||
const info = getLocationQuality(qual);
|
|
||||||
return <span style={{ color: info.color }}>{info.text}</span>;
|
|
||||||
})()}
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{/* 视频开关 */}
|
{/* 视频开关 */}
|
||||||
|
|||||||
@@ -1029,7 +1029,15 @@ const en = {
|
|||||||
fixed2Video: 'Fixed2 Video 已配',
|
fixed2Video: 'Fixed2 Video 已配',
|
||||||
|
|
||||||
batteryFixed2: '电池 Battery Fixed2',
|
batteryFixed2: '电池 Battery Fixed2',
|
||||||
|
noFix: 'noFix',
|
||||||
|
single: 'single',
|
||||||
|
dgnss: 'dgnss',
|
||||||
|
ins: 'ins',
|
||||||
|
|
||||||
|
singleNoHeading: 'singleNoHeading',
|
||||||
|
dgnssNoHeading: 'dgnssNoHeading',
|
||||||
|
rtkFixedNoHeading: 'rtkFixedNoHeading',
|
||||||
|
rtkFloatNoHeading: 'rtkFloatNoHeading',
|
||||||
s62: 'Signal/Satellite',
|
s62: 'Signal/Satellite',
|
||||||
|
|
||||||
s72: 'Wind Speed',
|
s72: 'Wind Speed',
|
||||||
|
|||||||
@@ -243,6 +243,16 @@ const zh = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
devices: {
|
devices: {
|
||||||
|
noFix: '无定位',
|
||||||
|
single: '单点定位',
|
||||||
|
dgnss: '差分定位',
|
||||||
|
ins: '惯导定位',
|
||||||
|
rtkFixed: 'RTK固定解',
|
||||||
|
rtkFloat: 'RTK浮点解',
|
||||||
|
singleNoHeading: '单点定位(无航向)',
|
||||||
|
dgnssNoHeading: '差分定位(无航向)',
|
||||||
|
rtkFixedNoHeading: 'RTK固定解(无航向)',
|
||||||
|
rtkFloatNoHeading: 'RTK浮点解(无航向)',
|
||||||
deviceManagement: '设备管理',
|
deviceManagement: '设备管理',
|
||||||
distributable: '可调度',
|
distributable: '可调度',
|
||||||
deviceOverview: '设备总览',
|
deviceOverview: '设备总览',
|
||||||
@@ -373,7 +383,6 @@ const zh = {
|
|||||||
currentTemp: '当前温度',
|
currentTemp: '当前温度',
|
||||||
humidity: '环境湿度',
|
humidity: '环境湿度',
|
||||||
positionAccuracy: '定位精度',
|
positionAccuracy: '定位精度',
|
||||||
rtkFixed: 'RTK 固定',
|
|
||||||
networkLatency: '网络延迟',
|
networkLatency: '网络延迟',
|
||||||
waterRiskWarning: '注意:区域 B 存在积水风险,建议避开',
|
waterRiskWarning: '注意:区域 B 存在积水风险,建议避开',
|
||||||
presetRoutes: '预设路线',
|
presetRoutes: '预设路线',
|
||||||
@@ -809,8 +818,7 @@ const zh = {
|
|||||||
rthPreset: '返航预设',
|
rthPreset: '返航预设',
|
||||||
rtkCount: 'RTK数量',
|
rtkCount: 'RTK数量',
|
||||||
rtkEnvLabel: 'RTK环境标签',
|
rtkEnvLabel: 'RTK环境标签',
|
||||||
rtkFixed2: 'RTK',
|
rtkFixed2: 'RTK固定',
|
||||||
rtkFloat: 'RTK浮点',
|
|
||||||
rtkHighPrecision: 'RTK高精度',
|
rtkHighPrecision: 'RTK高精度',
|
||||||
rtkModeDesc: 'RTK模式描述',
|
rtkModeDesc: 'RTK模式描述',
|
||||||
rtkStatus: 'RTK状态',
|
rtkStatus: 'RTK状态',
|
||||||
@@ -3344,17 +3352,17 @@ const zh = {
|
|||||||
male: '男',
|
male: '男',
|
||||||
female: '女',
|
female: '女',
|
||||||
notSet: '未设置',
|
notSet: '未设置',
|
||||||
basicInfo: '基础提示',
|
basicInfo: '基本信息',
|
||||||
changePassword: '变更密码',
|
changePassword: '变更密码',
|
||||||
confirmPasswordPlaceholder: '确认密码占位',
|
confirmPasswordPlaceholder: '确认密码',
|
||||||
confirmPasswordRequired: '确认密码必填',
|
confirmPasswordRequired: '确认密码必填',
|
||||||
emailInvalid: '邮件无效',
|
emailInvalid: '邮件无效',
|
||||||
emailPlaceholder: '邮件占位',
|
emailPlaceholder: '邮件占位',
|
||||||
newPasswordPlaceholder: '新密码占位',
|
newPasswordPlaceholder: '新密码',
|
||||||
oldPasswordPlaceholder: '旧密码占位',
|
oldPasswordPlaceholder: '旧密码',
|
||||||
passwordLengthError: '密码长度错误',
|
passwordLengthError: '密码长度错误',
|
||||||
phoneInvalid: '电话无效',
|
phoneInvalid: '电话无效',
|
||||||
remarkPlaceholder: '备注占位',
|
remarkPlaceholder: '备注',
|
||||||
requestFailed: '请求失败',
|
requestFailed: '请求失败',
|
||||||
},
|
},
|
||||||
users: {
|
users: {
|
||||||
|
|||||||
Reference in New Issue
Block a user