xiugai
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useRef, useState, useMemo, useImperativeHandle, forwardRef, useCallback } from 'react';
|
||||
import React, { useEffect, useRef, useState, useMemo, useImperativeHandle, forwardRef, useCallback } from 'react';
|
||||
import carImg from '../assets/images/carplane.png';
|
||||
import planeImg from '../assets/images/planeicon.png';
|
||||
import cameraImg from '../assets/images/camera.png';
|
||||
@@ -214,14 +214,13 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
baseLayerPicker: true,
|
||||
geocoder: false,
|
||||
homeButton: false,
|
||||
sceneModePicker: true,
|
||||
sceneModePicker: false,
|
||||
navigationHelpButton: false,
|
||||
fullscreenButton: false,
|
||||
infoBox: false,
|
||||
terrain: Cesium.Terrain.fromWorldTerrain(),
|
||||
imageryProvider: new Cesium.UrlTemplateImageryProvider({
|
||||
url: "https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}",
|
||||
credit: "Google Maps"
|
||||
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
|
||||
fileExtension: "jpg"
|
||||
})
|
||||
});
|
||||
viewer.resolutionScale = 2.0;
|
||||
@@ -3597,32 +3596,6 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
|
||||
duration,
|
||||
});
|
||||
},
|
||||
setMapType: (type) => {
|
||||
const viewer = viewerRef.current;
|
||||
if (!viewer) return;
|
||||
viewer.imageryLayers.removeAll();
|
||||
let url = "";
|
||||
if (type === 'google-satellite') {
|
||||
url = "https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}";
|
||||
} else if (type === 'google-streets') {
|
||||
url = "https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}";
|
||||
} else {
|
||||
url = "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}";
|
||||
}
|
||||
viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({
|
||||
url: url,
|
||||
credit: "Map Data"
|
||||
}));
|
||||
},
|
||||
toggle3D: (is3D) => {
|
||||
const viewer = viewerRef.current;
|
||||
if (!viewer) return;
|
||||
if (is3D) {
|
||||
viewer.scene.mode = Cesium.SceneMode.SCENE3D;
|
||||
} else {
|
||||
viewer.scene.mode = Cesium.SceneMode.SCENE2D;
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
return (
|
||||
|
||||
@@ -2627,9 +2627,9 @@ export default function DeviceStatusPage() {
|
||||
|
||||
|
||||
|
||||
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.rtLeftMeasureRpm')} value={(runningStatus?.left_measured_rpm ?? runningStatus?.leftMeasureSpeed) !== undefined ? Number(runningStatus?.left_measured_rpm ?? runningStatus?.leftMeasureSpeed).toFixed(1) + 'rpm' : '-'} />
|
||||
{/*<ConsoleRow icon={<DashboardOutlined />} label={t('devices.rtLeftMeasureRpm')} value={(runningStatus?.left_measured_rpm ?? runningStatus?.leftMeasureSpeed) !== undefined ? Number(runningStatus?.left_measured_rpm ?? runningStatus?.leftMeasureSpeed).toFixed(1) + 'rpm' : '-'} />*/}
|
||||
|
||||
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.rtRightMeasureRpm')} value={(runningStatus?.right_measured_rpm ?? runningStatus?.rightMeasureSpeed) !== undefined ? Number(runningStatus?.right_measured_rpm ?? runningStatus?.rightMeasureSpeed).toFixed(1) + 'rpm' : '-'} />
|
||||
{/*<ConsoleRow icon={<DashboardOutlined />} label={t('devices.rtRightMeasureRpm')} value={(runningStatus?.right_measured_rpm ?? runningStatus?.rightMeasureSpeed) !== undefined ? Number(runningStatus?.right_measured_rpm ?? runningStatus?.rightMeasureSpeed).toFixed(1) + 'rpm' : '-'} />*/}
|
||||
|
||||
<ConsoleRow icon={<DashboardOutlined />} label={t('devices.rtLeftMotorRpm')} value={runningStatus?.left_motor_rpm !== undefined ? Number(runningStatus?.left_motor_rpm).toFixed(1) + 'rpm' : '-'} />
|
||||
|
||||
@@ -2861,9 +2861,9 @@ export default function DeviceStatusPage() {
|
||||
|
||||
<div style={{ position: 'absolute', top: 8, left: 8, zIndex: 10, background: 'rgba(0,0,0,0.55)', color: '#fff', padding: '8px 12px', borderRadius: 8, fontSize: 12, backdropFilter: 'blur(4px)', boxShadow: '0 2px 8px rgba(0,0,0,0.3)', display: 'flex', flexDirection: 'column', gap: 4 }}>
|
||||
|
||||
<div style={{ fontWeight: 600, color: '#91caff' }}>{t('devices.rtPositioning')}:{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')}</div>
|
||||
{/*<div style={{ fontWeight: 600, color: '#91caff' }}>{t('devices.rtPositioning')}:{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')}</div>*/}
|
||||
|
||||
<div>{t('devices.rtSatellites')}:{t('devices.satelliteCount', { count: runningStatus?.satelliteCnt || 0 })}</div>
|
||||
{/*<div>{t('devices.rtSatellites')}:{t('devices.satelliteCount', { count: runningStatus?.satelliteCnt || 0 })}</div>*/}
|
||||
|
||||
<div>{t('devices.rtHeadingAngle')}:{runningStatus?.yaw !== undefined ? Number(runningStatus?.yaw).toFixed(1) + '°' : '-'}</div>
|
||||
|
||||
|
||||
@@ -453,16 +453,7 @@ const TaskMonitorPage: React.FC = () => {
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div style={{ position: 'absolute', bottom: 20, right: 20, display: 'flex', gap: 8, zIndex: 10 }}>
|
||||
<Button size="small" style={{ borderRadius: 4 }} icon={<MapIcon size={14} />} onClick={() => {
|
||||
mapRef.current?.setMapType('google-satellite');
|
||||
mapRef.current?.toggle3D(true);
|
||||
}}>卫星全景</Button>
|
||||
<Button size="small" style={{ borderRadius: 4 }} icon={<LayoutGrid size={14} />} onClick={() => {
|
||||
mapRef.current?.setMapType('google-streets');
|
||||
mapRef.current?.toggle3D(false);
|
||||
}}>2D普通</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user