STK Components 二次开发- 卫星地面站

前期卫星地面站创建已经说过,本次说一下卫星和地面站可见性时卫星名称和轨迹线变色问题。

1.创建卫星

// Get the current TLE for the given satellite identifier.
var tleList = TwoLineElementSetHelper.GetTles(m_satelliteIdentifier, JulianDate.Now);// Use the epoch of the first TLE, since the TLE may have been loaded from offline data.
m_epoch = tleList[0].Epoch;// Propagate the TLE and use that as the satellite's location point.
var locationPoint = new Sgp4Propagator(tleList).CreatePoint();
m_satellite = new Platform
{Name = "Satellite " + m_satelliteIdentifier,LocationPoint = locationPoint,// Orient the satellite using Vehicle Velocity Local Horizontal (VVLH) axes.OrientationAxes = new AxesVehicleVelocityLocalHorizontal(m_earth.FixedFrame, locationPoint),
};// Set the identifier for the satellite in the CZML document.
m_satellite.Extensions.Add(new IdentifierExtension(m_satelliteIdentifier));// Configure a glTF model for the satellite.
m_satellite.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
{// Link to a binary glTF file.Model = new CesiumResource(GetModelUri("satellite.glb"), CesiumResourceBehavior.LinkTo),// By default, Cesium plays all animations in the model simultaneously, which is not desirable.RunAnimations = false,
}));

2.创建地面站

// Define the location of the facility using cartographic coordinates.
var location = new Cartographic(Trig.DegreesToRadians(-75.596766667), Trig.DegreesToRadians(40.0388333333), 0.0);
var locationPoint = new PointCartographic(m_earth, location);
m_facility = new Platform
{Name = "AGI HQ",LocationPoint = locationPoint,// Orient the facility using East-North-Up (ENU) axes.OrientationAxes = new AxesEastNorthUp(m_earth, locationPoint),
};// Set the identifier for the facility in the CZML document. 
m_facility.Extensions.Add(new IdentifierExtension("AGI"));// Configure a glTF model for the facility.
m_facility.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
{// Link to a binary glTF file.Model = new CesiumResource(GetModelUri("facility.glb"), CesiumResourceBehavior.LinkTo),RunAnimations = false,HeightReference = CesiumHeightReference.ClampToGround,
}));// Configure label for AGI HQ.
m_facility.Extensions.Add(new LabelGraphicsExtension(new LabelGraphics
{Text = m_facility.Name,FillColor = Color.White,// Only show label when camera is far enough from the satellite,// to avoid visually clashing with the model.DistanceDisplayCondition = new Bounds(1000.0, double.MaxValue),HeightReference = CesiumHeightReference.ClampToGround,
}));

3.创建卫星和地面站关系

m_satelliteFacilityLink = new LinkInstantaneous(m_facility, m_satellite);// Set the identifier for the link in the CZML document. 
m_satelliteFacilityLink.Extensions.Add(new IdentifierExtension("SatelliteFacilityAccess"));// Specify how access should be constrained.  In this case, 
// access will only exist when no part of the earth is between AGI HQ and the satellite.
m_accessQuery = new CentralBodyObstructionConstraint(m_satelliteFacilityLink, m_earth);// Configure graphical display of the access link.
m_satelliteFacilityLink.Extensions.Add(new LinkGraphicsExtension(new LinkGraphics
{// Show the access link only when access is satisfied.Show = new AccessQueryCesiumProperty<bool>(m_accessQuery, true, false, false),Material = new SolidColorMaterialGraphics(Color.Yellow),
}));

因为随着可见性变色,需要在关系中获取到可见时间。

AccessEvaluator evaluator = m_accessQuery.GetEvaluator();// Compute the time intervals when the viewing location is able to see the satellite.
AccessQueryResult accessResult = evaluator.Evaluate(m_epoch, m_epoch.AddDays(1));
var accessIntervals = accessResult.SatisfactionIntervals;
var LabelResults = new TimeIntervalCollection<Color>();LabelResults =GetColorList(accessIntervals, m_epoch, false);
m_satellite.Extensions.Add(new LabelGraphicsExtension(new LabelGraphics
{Text = new ConstantCesiumProperty<string>(m_satellite.Name),Font= new ConstantCesiumProperty<string>("20px"),FillColor = LabelResults,}));var LineResults = new TimeIntervalCollection<Color>();
LineResults = GetColorList(accessIntervals, m_epoch, true);
m_satellite.Extensions.Add(new PathGraphicsExtension(new PathGraphics
{Material = new PolylineOutlineMaterialGraphics{Color = LineResults,OutlineWidth = new ConstantCesiumProperty<double>(1.0),OutlineColor = new ConstantCesiumProperty<Color>(Color.Black),},Width = 2,LeadTime = Duration.FromMinutes(44).TotalSeconds,TrailTime = Duration.FromMinutes(44).TotalSeconds,
}));
  public static TimeIntervalCollection<Color> GetColorList(TimeIntervalCollection accessIntervals, Define.Link struLink,bool isLine){var results = new TimeIntervalCollection<Color>();JulianDate tmp = new JulianDate();foreach (TimeInterval interval in accessIntervals){if (results.Count() == 0){results.Add(new TimeInterval<Color>(struLink.m_jBeginTime, interval.Start.ToGregorianDate().ToJulianDate(), Color.White, true, false));}if (tmp.ToString() != ""){results.Add(new TimeInterval<Color>(tmp, interval.Start.ToGregorianDate().ToJulianDate(), Color.White, true, false));}if(isLine){results.Add(new TimeInterval<Color>(interval.Start.ToGregorianDate().ToJulianDate(), interval.Stop.ToGregorianDate().ToJulianDate(), Color.Red, false, true));}else{results.Add(new TimeInterval<Color>(interval.Start.ToGregorianDate().ToJulianDate(), interval.Stop.ToGregorianDate().ToJulianDate(), Color.Green, false, true));}tmp = interval.Stop.ToGregorianDate().ToJulianDate();}return results;}

效果:

轨迹线和名称变色

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/179877.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MFC容器中使用标准库容器,内存违规

问题描述 CArray中元素不管是直接或间接使用标准库容器&#xff0c;会引发内存违规。与CArray内部实现有关。测试代码如下&#xff1a; struct tagData {std::vector<int> m_Values; }; CArray<tagData, tagData> mIntVecArray; {tagData mData;mData.m_Values.p…

类和对象——(2)类

归纳编程学习的感悟&#xff0c; 记录奋斗路上的点滴&#xff0c; 希望能帮到一样刻苦的你&#xff01; 如有不足欢迎指正&#xff01; 共同学习交流&#xff01; &#x1f30e;欢迎各位→点赞 &#x1f44d; 收藏⭐ 留言​&#x1f4dd; 只虽然夜晚很长&#xff0c;但天…

SpringBoot配置跨域的机种方式 spring跨域的几种方式

SpringBoot配置跨域的机种方式 spring跨域的几种方式 1、注解方式2、实现 WebMvcConfigurer 接口3、使用 FilterRegistrationBean 过滤器 (推荐) 1、注解方式 使用 CrossOrigin注解标注在 Controller或者 Mapping RestController CrossOrigin RequestMapping("/ctro&quo…

Spark_Spark高阶特性

wscg filter导致断链 Codegen 向量化 simdjson Orc Parquet 支持批量读取 spark本身对parquet支持比较好&#xff0c;因为parquet

“PredictingChildrenHeight“ app Tech Support(URL)

Using our app, we can predict a childs height through formulas. Because there are many factors that affect a childs height, it is for reference only. ​​​​​​​ If you have any questions, you can either leave a message or send the questions to our em…

msng病毒分析

这是一个非常古老的文件夹病毒&#xff0c;使用XP系统的文件夹图标&#xff0c;采用VB语言开发&#xff0c;使用了一种自定义的壳来保护&#xff0c;会打开网址http://www.OpenClose.ir,通过软盘、U盘和共享目录进行传播&#xff0c;会在U盘所有的目录下生成自身的副本&#xf…

mysql使用--备份与恢复

1.mysqldump 1.1.使用mysqldump备份数据 1.1.1.备份指定数据库中的指定表 如&#xff1a;mysqldump [其他选项] 数据库名 [表1名 表2名 …] 如&#xff1a;mysqldump -uroot -hlocalhost -p1234 database1 student_score > student_score.sql 上述采用-u和-p完成用户登录&am…

Linux常用命令----shutdown命令

文章目录 命令概述参数解释使用示例及解释 命令概述 shutdown 命令用于安全地关闭或重启 Linux 系统。它允许管理员指定一个时间点执行操作&#xff0c;并可发送警告信息给所有登录的用户。 参数解释 时间参数 ([时间]): now: 立即执行关闭或重启操作。m: 在 m 分钟后执行操作…

Android控件全解手册 - 任意View缩放平移工具-实现思路和讲解

Unity3D特效百例案例项目实战源码Android-Unity实战问题汇总游戏脚本-辅助自动化Android控件全解手册再战Android系列Scratch编程案例软考全系列Unity3D学习专栏蓝桥系列ChatGPT和AIGC &#x1f449;关于作者 专注于Android/Unity和各种游戏开发技巧&#xff0c;以及各种资源分…

数字阅读用户规模持续增长 5.3亿人享受数字化阅读便利

近日,鲁迅长孙周令飞在接受采访时表示,自己“现在90%的时间刷视频,10%的时间看书”,引发网友热议。不少网友表示,鲁迅的孙子都花90%的时间刷视频,难怪现在没人看书了,其实这并不奇怪,也并不表明没人看书,而是读屏与读书并重的时代,纸质阅读与数字阅读共同构成了日常的阅读模式。…

大数据之Redis

NoSQL SQL数据库泛指关系型数据库NoSQL不拘泥于关系型数据的设计范式&#xff0c;放弃了通用的技术标准&#xff0c;为某一特定领域场景而设计 NoSQL的特点 不遵循SQL标准不支持ACID远超SQL的性能 NoSQL的适用场景 对数据高并发的读写海量数据的读写对数据高可扩展性的 N…

webpack具体实现--未完

1、前端模块打包工具webpack webpack 是 Webpack 的核心模块&#xff0c;webpack-cli 是 Webpack 的 CLI 程序&#xff0c;用来在命令行中调用 Webpack。webpack-cli 所提供的 CLI 程序就会出现在 node_modules/.bin 目录当中&#xff0c;我们可以通过 npx 快速找到 CLI 并运行…

web:NewsCenter

题目 打开页面显示如下 页面有个输入框&#xff0c;猜测是sql注入&#xff0c;即search为注入参数点&#xff0c;先尝试一下 返回空白显示错误 正常显示如下 是因为单引号与服务端代码中的’形成闭合&#xff0c;输入的字符串hello包裹&#xff0c;服务端代码后面多出来一个‘导…

Linux僵死进程及文件操作

1.僵死进程(僵尸进程)&#xff1a; 1.僵死进程产生的原因或者条件: 什么是僵死进程? 当子进程先于父进程结束,父进程没有获取子进程的退出码,此时子进程变成僵死进程. 简而言之,就是子进程先结束,并且父进程没有获取它的退出码; 那么僵死进程产生的原因或者条件就是:子进…

哈希和unordered系列封装(C++)

哈希和unordered系列封装 一、哈希1. 概念2. 哈希函数&#xff0c;哈希碰撞哈希函数&#xff08;常用的两个&#xff09;哈希冲突&#xff08;碰撞&#xff09;小结 3. 解决哈希碰撞闭散列线性探测二次探测代码实现载荷因子&#xff08;扩容&#xff09; 开散列哈希桶代码实现扩…

dpkg、apt、rpm、yum、dnf使用

1. yum参数以及使用 yum 命令是在 Fedora 和 RedHat 以及 SUSE 中基于 rpm 的软件包管理器&#xff0c;它可以使系统管理人员交互和自动化地更新与管理 RPM 软件包&#xff0c;能够从指定的服务器自动下载 RPM 包并且安装&#xff0c;可以自动处理依赖性关系&#xff0c;并且一…

Spark_spark shell退出方式

问题描述 在使用Spark Shell进行交互式编程时&#xff0c;如何优雅地退出Spark Shell&#xff0c;即关闭Shell会话&#xff0c;并释放资源。 解决方案 Spark Shell是一个交互式的Spark环境&#xff0c;基于Scala编程语言&#xff0c;可以用于快速开发和调试Spark应用程序。当…

C语言:输入3个整数,按由小到大的顺序输出(指针)

分析&#xff1a; 定义三个整型变量 a、b、c&#xff0c;和三个指向整型变量的指针变量 i、j、k。然后使用 scanf 函数从标准输入&#xff08;键盘&#xff09;中读取输入的三个整数&#xff0c;并将它们存储到 a、b、c 中。注意&#xff0c;使用 &a、&b、&c 进行赋…

【GitLab】流水线入门

(꒪ꇴ꒪ )&#xff0c;Hello我是祐言QAQ我的博客主页&#xff1a;C/C语言&#xff0c;数据结构&#xff0c;Linux基础&#xff0c;ARM开发板&#xff0c;网络编程等领域UP&#x1f30d;快上&#x1f698;&#xff0c;一起学习&#xff0c;让我们成为一个强大的攻城狮&#xff0…

深入理解字符串函数和字符函数(二)

目录 strstr 的使用和模拟实现​ 简单的使用&#xff1a; 复杂情况下的使用 模拟实现strstr函数 用暴力求解的方式&#xff1a; strtok的使用 strerror 函数的使用​ strstr 的使用和模拟实现​ 作用:返回字符串在另外一个字符串中第一次出现的位置&#xff0c;即查找子…