'增加导入功能和修改readme'

This commit is contained in:
jiangteng 2023-02-13 10:05:23 +08:00
parent 31fa25629c
commit dee1159c63
8 changed files with 566 additions and 531 deletions

27
README.en.md Normal file
View File

@ -0,0 +1,27 @@
# satellite-track
## Introduction
Satellite-track is a program for tracking satellite orbit, developed by cesium, vue and satelliteJS. It supports satellite and satellite constellation orbit display within the next 24 hours (performance considerations); Custom satellite orbit data (TLE) loading is also supported,TLE data is from celestrak;
## Preview
### [【satellite-track】](https://jiangteng2019.github.io/satellite-track/)
### [【Alternate address】](http://120.48.134.120:10181/satellite-track/)
## Tips
In order to save performance, satellite-track limits the following options:
- click display of satellite orbital data, not full display;
- orbital data prediction for the next 24 hours;
- only five constellation data can be selected at the same time;
1. The access speed of github pages is slow, and the TLE data and cesium data are large. Please wait patiently for the resources to load;
1. If the spacecraft changes orbit frequently, the TLE cache needs to be cleared manually before use;
## Example
[![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track")
[![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011139_2.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011139_2.jpg "satellite-track")

View File

@ -1,35 +1,23 @@
# satellite-track # satellite-track
### satellite-track uses TLE data to track satellites and is developed using cesium, vue and satelliteJS. ## 概览
### [preview](https://jiangteng2019.github.io/satellite-track/)
satellite-track 是一款追踪卫星轨道的程序使用cesium、vue、satelliteJS开发。支持24小时之内的卫星和卫星星座轨道显示(性能考虑)同时也支持自定义的卫星轨道数据TLE加载。数据来源于celestrak。
## Preview
### [【satellite-track】](https://jiangteng2019.github.io/satellite-track/)
### [【备用地址】](http://120.48.134.120:10181/satellite-track/)
1. In order to save performance, satellite-track limits the following options: ## 注意
- click display of satellite orbital data, not full display; 为了节约性能satellite-track 使用了如下限制:
- orbital data prediction for the next 24 hours;
- only five constellation data can be selected at the same time;
1. The access speed of github pages is slow, and the TLE data and cesium data are large. Please wait patiently for the resources to load;
1. If the spacecraft changes orbit frequently, the TLE cache needs to be cleared manually before use;
1. Data from celestrak;
-------------------------------------------
### satellite-track使用TLE数据追踪卫星使用cesium、vue、satelliteJS开发。
### [预览](https://jiangteng2019.github.io/satellite-track/)
1. 为了节约性能satellite-track 使用了如下限制:
- 卫星轨道数据点击显示,而非全量显示; - 卫星轨道数据点击显示,而非全量显示;
- 轨道数据预测未来24小时; - 轨道数据预测未来24小时;
- 只能同时选择5个星座数据; - 只能同时选择5个星座数据;
1. github pages 访问速度慢TLE数据与cesium数据较大请耐心等待资源加载; 1. github pages 访问速度慢TLE数据与cesium数据较大请耐心等待资源加载;
1. 如果航天器变轨频繁使用前需手动清除TLE缓存; 1. 如果航天器变轨频繁使用前需手动清除TLE缓存;
1. 数据来源于celestrak;
## 示例
[![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track") [![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011203_1.jpg "satellite-track")
[![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011139_2.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011139_2.jpg "satellite-track") [![satellite-track](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011139_2.jpg "satellite-track")](https://images.cnblogs.com/cnblogs_com/engeng/2270012/o_230203011139_2.jpg "satellite-track")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,8 +6,8 @@
<link rel="icon" href="/satellite-track/favicon.ico"> <link rel="icon" href="/satellite-track/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>satellite-track</title> <title>satellite-track</title>
<script type="module" crossorigin src="/satellite-track/assets/index-373635a9.js"></script> <script type="module" crossorigin src="/satellite-track/assets/index-b3413a50.js"></script>
<link rel="stylesheet" href="/satellite-track/assets/index-c3c100ef.css"> <link rel="stylesheet" href="/satellite-track/assets/index-34874161.css">
</head> </head>
<body> <body>

View File

@ -43,6 +43,9 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
padding: 10px; padding: 10px;
.upload_button {
margin: 0 10px;
}
} }
.el-drawer { .el-drawer {

View File

@ -1,10 +1,10 @@
<template> <template>
<div id="cesiumContainer"></div> <div id="cesiumContainer"></div>
<div class="operate_container"> <div class="operate_container">
<div class="menu_button" @click="drawer = !drawer"> <div class="menu_button" @click="drawer = !drawer" title="控制面板">
<img src="../../assets/menu.svg" width="28" height="28" alt=""> <img src="../../assets/menu.svg" width="28" height="28" alt="">
</div> </div>
<div class="menu_button" @click="drawerImport = !drawerImport"> <div class="menu_button" @click="drawerImport = !drawerImport" title="导入">
<img src="../../assets/import.svg" width="28" height="28" alt=""> <img src="../../assets/import.svg" width="28" height="28" alt="">
</div> </div>
</div> </div>
@ -33,9 +33,12 @@
<el-button type="primary" @click="handleAddSatellite"> <el-button type="primary" @click="handleAddSatellite">
添加 添加
</el-button> </el-button>
<el-button type="default" @click="handleImportSatellite"> <el-upload class="upload_button" :on-change="handleImportSatellite" :show-file-list="false" accept="txt"
导入 :limit="1" :auto-upload="false" ref="upload">
</el-button> <template #trigger>
<el-button type="primary">导入</el-button>
</template>
</el-upload>
<el-button type="danger" @click="handleClearSatellite"> <el-button type="danger" @click="handleClearSatellite">
清空 清空
</el-button> </el-button>
@ -80,6 +83,8 @@ const checked = ref([1]);
const clickedSatelliteArray = []; const clickedSatelliteArray = [];
const upload = ref(null);
let tleData = ref(`BEIDOU-3 G2 let tleData = ref(`BEIDOU-3 G2
1 45344U 20017A 23037.82027362 -.00000136 00000+0 00000+0 0 9994 1 45344U 20017A 23037.82027362 -.00000136 00000+0 00000+0 0 9994
2 45344 1.9879 4.6761 0000950 328.7503 178.5761 1.00272999 10962 2 45344 1.9879 4.6761 0000950 328.7503 178.5761 1.00272999 10962
@ -223,8 +228,8 @@ function checkTleData(data) {
} }
dataArray.forEach((item, index) => { dataArray.forEach((item, index) => {
if (index % 3 === 0 && !item) throw new Error(false); if (index % 3 === 0 && !item) throw new Error(false);
if (index % 3 === 1 && item.length !== 69) throw new Error(false); if (index % 3 === 1 && item.length < 69) throw new Error(false);
if (index % 3 === 2 && item.length !== 69) throw new Error(false); if (index % 3 === 2 && item.length < 69) throw new Error(false);
}) })
return true; return true;
} catch (error) { } catch (error) {
@ -236,7 +241,7 @@ function checkTleData(data) {
// //
function handleAddSatellite() { function handleAddSatellite() {
if (!checkTleData(tleData.value)) { if (!checkTleData(tleData.value)) {
ElMessage.error('error tle data'); ElMessage.error('wrong TLE data');
return; return;
} }
clearcustomSatelliteMap(); clearcustomSatelliteMap();
@ -247,17 +252,24 @@ function handleAddSatellite() {
let result = viewer.entities.add(cesiumSateEntity); let result = viewer.entities.add(cesiumSateEntity);
customSatelliteMap.set(satellite.name, result) customSatelliteMap.set(satellite.name, result)
}); });
viewer.zoomTo(viewer.entities);
} }
function handleImportSatellite() { async function handleImportSatellite(uploadFiles) {
if (uploadFiles.raw.type !== "text/plain") {
ElMessage.warning('请上传TXT格式的TLE数据');
return;
}
let data = await uploadFiles.raw.text();
tleData.value = data;
} }
// cesium // cesium
function handleClearSatellite() { function handleClearSatellite() {
clearcustomSatelliteMap(); clearcustomSatelliteMap();
tleData.value = ""; tleData.value = "";
upload.value.clearFiles();
} }
// ; // ;