| | |
| | | const basePoints = [ |
| | | [ |
| | | { |
| | | longitude: 114.963191, |
| | | latitude: 27.136716, |
| | | height: 120 |
| | | longitude: 114.964975, |
| | | latitude: 27.134855, |
| | | height: 200 |
| | | }, |
| | | { |
| | | longitude: 114.957308, |
| | | latitude: 27.138452, |
| | | height: 120 |
| | | longitude: 114.963966, |
| | | latitude: 27.132836, |
| | | height: 200 |
| | | }, |
| | | { |
| | | longitude: 114.952, |
| | | latitude: 27.136317, |
| | | height: 120 |
| | | longitude: 114.963966, |
| | | latitude: 27.132836, |
| | | height: 320 |
| | | }, |
| | | { |
| | | longitude: 114.949293, |
| | | latitude: 27.133864, |
| | | height: 120 |
| | | longitude: 114.963974, |
| | | latitude: 27.132677, |
| | | height: 320 |
| | | }, |
| | | { |
| | | longitude: 114.944666, |
| | | latitude: 27.130526, |
| | | height: 120 |
| | | longitude: 114.963432, |
| | | latitude: 27.131665, |
| | | height: 320 |
| | | }, |
| | | { |
| | | longitude: 114.945909, |
| | | latitude: 27.127845, |
| | | height: 120 |
| | | longitude: 114.962865, |
| | | latitude: 27.130377, |
| | | height: 320 |
| | | }, |
| | | { |
| | | longitude: 114.962974, |
| | | latitude: 27.136242, |
| | | longitude: 114.965318, |
| | | latitude: 27.129925, |
| | | height: 320 |
| | | }, |
| | | { |
| | | longitude: 114.960144, |
| | | latitude: 27.134902, |
| | | height: 120 |
| | | }, |
| | | ], |
| | |
| | | height: 120 |
| | | }, |
| | | { |
| | | longitude: 114.925958, |
| | | latitude: 27.096963, |
| | | height: 400 |
| | | }, |
| | | { |
| | | longitude: 114.925836, |
| | | latitude: 27.096102, |
| | | height: 120 |
| | | height: 400 |
| | | }, |
| | | { |
| | | longitude: 114.928384, |
| | | latitude: 27.095866, |
| | | height: 120 |
| | | height: 400 |
| | | }, |
| | | { |
| | | longitude: 114.929874, |
| | | latitude: 27.096095, |
| | | height: 120 |
| | | height: 400 |
| | | }, |
| | | { |
| | | longitude: 114.931048, |
| | | latitude: 27.097666, |
| | | height: 120 |
| | | height: 400 |
| | | }, |
| | | ] |
| | | ] |
| | |
| | | |
| | | const setupDroneTrackClock = () => { |
| | | if (!viewer) return |
| | | const startTime = Cesium.JulianDate.now() |
| | | const now = new Date() |
| | | const noon = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 12, 0, 0, 0) |
| | | const startTime = Cesium.JulianDate.fromDate(noon) |
| | | const stopTime = Cesium.JulianDate.addSeconds(startTime, DRONE_TRACK_DURATION_S, new Cesium.JulianDate()) |
| | | viewer.clock.startTime = startTime |
| | | viewer.clock.stopTime = stopTime |
| | |
| | | const entityId = `online-device-${item.id ?? index}-${index}` |
| | | const rangeMeters = getDeviceRange(item) |
| | | devicePositions.push({ lng: position.longitude, lat: position.latitude }) |
| | | const billboard = deviceBillboardCollection.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 0), |
| | | image: isOnline ? equipmentIcon : offlineEquipmentIcon, |
| | | width: 40, |
| | | height: 56, |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | }) |
| | | billboard.id = entityId |
| | | devicePickMap.set(entityId, { data: item, billboard }) |
| | | deviceEntries.push({ position, rangeMeters, billboard, isOnline }) |
| | | deviceEntries.push({ position, rangeMeters, isOnline, entityId, data: item }) |
| | | }) |
| | | if (selectedTargetType.value === 'device' && selectedDeviceBillboard && !devicePickMap.has(selectedDeviceBillboard.id)) { |
| | | closePopup() |
| | | } |
| | | if (deviceEntries.length) { |
| | | const heights = await getPointPositionsHeight(devicePositions, viewer) |
| | | deviceEntries.forEach((entry, index) => { |
| | | const height = Number(heights?.[index]?.ASL) |
| | | const centerHeight = Number.isFinite(height) ? height : 0 |
| | | if (entry.billboard) { |
| | | entry.billboard.position = Cesium.Cartesian3.fromDegrees( |
| | | const billboard = deviceBillboardCollection.add({ |
| | | position: Cesium.Cartesian3.fromDegrees( |
| | | entry.position.longitude, |
| | | entry.position.latitude, |
| | | centerHeight |
| | | ) |
| | | } |
| | | ), |
| | | image: entry.isOnline ? equipmentIcon : offlineEquipmentIcon, |
| | | width: 40, |
| | | height: 56, |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | }) |
| | | billboard.id = entry.entityId |
| | | devicePickMap.set(entry.entityId, { data: entry.data, billboard }) |
| | | if (!entry.isOnline) return |
| | | if (!Number.isFinite(entry.rangeMeters) || entry.rangeMeters <= 0) return |
| | | const primitive = createDeviceRangePrimitiveWithHeight(entry.position, entry.rangeMeters, centerHeight) |
| | |
| | | addCockpitPrimitive(primitive) |
| | | deviceRingFillPrimitives.push(primitive) |
| | | }) |
| | | } |
| | | if (selectedTargetType.value === 'device' && selectedDeviceBillboard && !devicePickMap.has(selectedDeviceBillboard.id)) { |
| | | closePopup() |
| | | } |
| | | reorderCockpitPrimitives() |
| | | } |
| | |
| | | const handleDroneSignal = () => emit('droneSignal', selectedDevice.value) |
| | | const handleDroneCounter = () => emit('droneCounter', selectedDevice.value) |
| | | |
| | | const renderCommandPosts = list => { |
| | | const renderCommandPosts = async list => { |
| | | if (!viewer) return |
| | | ensureCommandPostCollection() |
| | | commandPostBillboardCollection.removeAll() |
| | | commandPostBillboardCollection.show = detailVisible.value |
| | | const entries = [] |
| | | const positions = [] |
| | | ; (list || []).forEach((item, index) => { |
| | | const position = getDevicePosition(item) |
| | | if (!position) return |
| | | entries.push({ position, index }) |
| | | positions.push({ lng: position.longitude, lat: position.latitude }) |
| | | }) |
| | | if (positions.length) { |
| | | const heights = await getPointPositionsHeight(positions, viewer) |
| | | entries.forEach((entry, idx) => { |
| | | const height = Number(heights?.[idx]?.ASL) |
| | | const centerHeight = Number.isFinite(height) ? height : 0 |
| | | commandPostBillboardCollection.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 0), |
| | | position: Cesium.Cartesian3.fromDegrees( |
| | | entry.position.longitude, |
| | | entry.position.latitude, |
| | | centerHeight |
| | | ), |
| | | image: commandPostIcon, |
| | | width: 40, |
| | | height: 56, |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | }) |
| | | }) |
| | | } |
| | | reorderCockpitPrimitives() |
| | | } |
| | | |
| | |
| | | const res = await newDefenseSceneManageList({ |
| | | time: dayjs().format('YYYY-MM-DD HH:mm:ss') |
| | | }) |
| | | renderCommandPosts(res?.data?.data ?? []) |
| | | await renderCommandPosts(res?.data?.data ?? []) |
| | | } catch (error) { |
| | | renderCommandPosts([]) |
| | | await renderCommandPosts([]) |
| | | } |
| | | } |
| | | |