From 9f0bed4513b6ba92cfa8761e2bea8c7f67a810fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Fri, 14 Mar 2025 14:42:06 +0800 Subject: [PATCH] =?UTF-8?q?demo=5F03=5F=E5=8D=AB=E6=98=9F=E5=8A=A0?= =?UTF-8?q?=E7=AB=99=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_TLE_DATA.ts | 9 ++++ .../demo_01_OrbitGeneration.ts | 0 .../demo_02_Track.ts | 0 .../Cesium/cesium-demos/demo_03_卫星加站点.ts | 53 +++++++++++++++++++ .../Cesium/cesium-helper/_TOOLTIP_MAP.ts | 23 ++++---- src/pages/Satellite/Cesium/index.page.vue | 7 ++- 6 files changed, 79 insertions(+), 13 deletions(-) rename src/pages/Satellite/Cesium/{cesium-helper => cesium-demos}/_TLE_DATA.ts (97%) rename src/pages/Satellite/Cesium/{cesium-helper => cesium-demos}/demo_01_OrbitGeneration.ts (100%) rename src/pages/Satellite/Cesium/{cesium-helper => cesium-demos}/demo_02_Track.ts (100%) create mode 100644 src/pages/Satellite/Cesium/cesium-demos/demo_03_卫星加站点.ts diff --git a/src/pages/Satellite/Cesium/cesium-helper/_TLE_DATA.ts b/src/pages/Satellite/Cesium/cesium-demos/_TLE_DATA.ts similarity index 97% rename from src/pages/Satellite/Cesium/cesium-helper/_TLE_DATA.ts rename to src/pages/Satellite/Cesium/cesium-demos/_TLE_DATA.ts index 232e61c..222c1a2 100644 --- a/src/pages/Satellite/Cesium/cesium-helper/_TLE_DATA.ts +++ b/src/pages/Satellite/Cesium/cesium-demos/_TLE_DATA.ts @@ -26,6 +26,15 @@ export const DEMO_DATA = { RA_OF_ASC_NODE: 63.0294, REV_AT_EPOCH: 13, }, + get tleLine1() { + return this.tleString.split('\n')[1]; + }, + get tleLine2() { + return this.tleString.split('\n')[2]; + }, + get tleName() { + return this.tleString.split('\n')[0]; + }, tleString: `2025-045B 1 63158U 25045B 25071.65907894 .00072212 -50502-6 39937-3 0 9999 2 63158 19.0363 63.0294 7375486 181.9338 171.6150 2.21786616 127`, diff --git a/src/pages/Satellite/Cesium/cesium-helper/demo_01_OrbitGeneration.ts b/src/pages/Satellite/Cesium/cesium-demos/demo_01_OrbitGeneration.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-helper/demo_01_OrbitGeneration.ts rename to src/pages/Satellite/Cesium/cesium-demos/demo_01_OrbitGeneration.ts diff --git a/src/pages/Satellite/Cesium/cesium-helper/demo_02_Track.ts b/src/pages/Satellite/Cesium/cesium-demos/demo_02_Track.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-helper/demo_02_Track.ts rename to src/pages/Satellite/Cesium/cesium-demos/demo_02_Track.ts diff --git a/src/pages/Satellite/Cesium/cesium-demos/demo_03_卫星加站点.ts b/src/pages/Satellite/Cesium/cesium-demos/demo_03_卫星加站点.ts new file mode 100644 index 0000000..913c286 --- /dev/null +++ b/src/pages/Satellite/Cesium/cesium-demos/demo_03_卫星加站点.ts @@ -0,0 +1,53 @@ +import type { Viewer } from 'cesium'; + +import * as Cesium from 'cesium'; + +export function demo_卫星加站点(viewer: Viewer) { + // 1. 添加一个卫星 + const satellite = viewer.entities.add({ + label: { + font: '14pt monospace', + pixelOffset: new Cesium.Cartesian2(0, 20), + text: '卫星', + }, + name: '测试卫星', + point: { + color: Cesium.Color.RED, + pixelSize: 10, // 卫星显示为一个点 + }, + position: Cesium.Cartesian3.fromDegrees(114, 40, 500_000), // 经度、纬度、高度(500km) + }); + + // 2. 添加一个地面检测站点 + const detectionSite = viewer.entities.add({ + label: { + font: '14pt monospace', + pixelOffset: new Cesium.Cartesian2(0, 20), + text: '检测站', + }, + name: '检测站点', + point: { + color: Cesium.Color.BLUE, + pixelSize: 8, + }, + position: Cesium.Cartesian3.fromDegrees(116, 39, 0), // 北京附近的一个地面站点 + }); + + // 3. 可选:绘制卫星与站点之间的连线 + viewer.entities.add({ + polyline: { + material: Cesium.Color.YELLOW.withAlpha(0.5), + positions: new Cesium.CallbackProperty(() => { + const satellitePosition = satellite.position?.getValue(Cesium.JulianDate.now()); + const sitePosition = detectionSite.position?.getValue(Cesium.JulianDate.now()); + + if (!satellitePosition || !sitePosition) { + return []; + } + + return [satellitePosition, sitePosition]; + }, false), + width: 2, + }, + }); +} diff --git a/src/pages/Satellite/Cesium/cesium-helper/_TOOLTIP_MAP.ts b/src/pages/Satellite/Cesium/cesium-helper/_TOOLTIP_MAP.ts index 2dad089..0f0c6db 100644 --- a/src/pages/Satellite/Cesium/cesium-helper/_TOOLTIP_MAP.ts +++ b/src/pages/Satellite/Cesium/cesium-helper/_TOOLTIP_MAP.ts @@ -1,20 +1,21 @@ +/* eslint-disable perfectionist/sort-objects */ /* prettier-ignore */ export const TOOLTIP_MAP = { - ARG_OF_PERICENTER_近地点幅角: "8位数字,如'181.9338',表示近地点相对升交点的角度(度),范围0°-360°", - BSTAR_BSTAR拖曳项: "BSTAR参数。8位科学计数法,如'39937-3'表示0.39937×10⁻³/地球半径,表示大气拖曳影响", + NORAD_CAT_ID_卫星编号: "5位数字,如'63158',表示NORAD卫星唯一目录编号", CLASSIFICATION_TYPE_卫星分类: "1个字母,如'U',表示数据分类", - ECCENTRICITY_离心率: "7位数字,无小数点,如'7375486'表示0.7375486,小数点隐含在最前面", - ELEMENT_SET_NO_元素集编号: "4位数字,如'9999',表示TLE版本号", - EPHEMERIS_TYPE_星历类型: "通常为'0',表示使用SGP4星历模型", + OBJECT_ID_国际标识符: "8个字符,如'25045B'(年份+发射编号+部件),不足时右侧补空格", EPOCH_历元时间: "14位数字,如'25071.65907894',表示轨道数据的参考时间(年份+年积日.一天中的小数部分)", + MEAN_MOTION_DOT_平均运动一阶导数: "10位数字,如'.00072212',表示平均运动变化率的一半,单位圈/天²,左侧补空格", + MEAN_MOTION_DDOT_平均运动二阶导数: "8位科学计数法,如'-50502-6'表示-5.0502×10⁻⁶圈/天³,最后一位是指数", + BSTAR_BSTAR拖曳项: "BSTAR参数。8位科学计数法,如'39937-3'表示0.39937×10⁻³/地球半径,表示大气拖曳影响", + EPHEMERIS_TYPE_星历类型: "通常为'0',表示使用SGP4星历模型", + ELEMENT_SET_NO_元素集编号: "4位数字,如'9999',表示TLE版本号", // CHECKSUM_校验和: "1位数字,用于验证数据完整性,可选项", INCLINATION_轨道倾角: "8位数字,如'19.0363',表示轨道与赤道平面的夹角(度),范围0°-180°", - MEAN_ANOMALY_平近点角: "8位数字,如'171.6150',表示历元时的平近点角(度),范围0°-360°", - MEAN_MOTION_DDOT_平均运动二阶导数: "8位科学计数法,如'-50502-6'表示-5.0502×10⁻⁶圈/天³,最后一位是指数", - MEAN_MOTION_DOT_平均运动一阶导数: "10位数字,如'.00072212',表示平均运动变化率的一半,单位圈/天²,左侧补空格", - MEAN_MOTION_平均运动: "11位数字,如'2.21786616',表示卫星每天绕地球的圈数(圈/天)", - NORAD_CAT_ID_卫星编号: "5位数字,如'63158',表示NORAD卫星唯一目录编号", - OBJECT_ID_国际标识符: "8个字符,如'25045B'(年份+发射编号+部件),不足时右侧补空格", RA_OF_ASC_NODE_升交点赤经: "8位数字,如'63.0294',表示轨道升交点的赤经(度),范围0°-360°", + ECCENTRICITY_离心率: "7位数字,无小数点,如'7375486'表示0.7375486,小数点隐含在最前面", + ARG_OF_PERICENTER_近地点幅角: "8位数字,如'181.9338',表示近地点相对升交点的角度(度),范围0°-360°", + MEAN_ANOMALY_平近点角: "8位数字,如'171.6150',表示历元时的平近点角(度),范围0°-360°", + MEAN_MOTION_平均运动: "11位数字,如'2.21786616',表示卫星每天绕地球的圈数(圈/天)", REV_AT_EPOCH_历元时的圈数: "5位数字,如'13',表示卫星在历元时完成的轨道圈数", }; diff --git a/src/pages/Satellite/Cesium/index.page.vue b/src/pages/Satellite/Cesium/index.page.vue index f009891..cb03b57 100644 --- a/src/pages/Satellite/Cesium/index.page.vue +++ b/src/pages/Satellite/Cesium/index.page.vue @@ -1,15 +1,16 @@