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.hqwc.cn/news/227754.html

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

相关文章

计网Lesson4 - 计算机组网模型

文章目录 计算机的连接方式1. 两台计算机的互联2. 多台计算机的互联&#xff08;旧式&#xff09;3. 多台计算机的互联 --- 集线器&#xff08;Hub&#xff09;4. 网桥5. 多台计算机的互联 --- 交换器&#xff08;Switch&#xff09; 计算机的连接方式 1. 两台计算机的互联 网…

ArrayList与顺序表的简单理解

前言----list 在集合框架中&#xff0c;List是一个接口&#xff0c;继承自Collection。Collection也是一个接口&#xff0c;该接口中规范了后序容器中常用的一些方法&#xff0c;具体如下所示&#xff1a; Iterable也是一个接口&#xff0c;表示实现该接口的类是可以逐个元素进…

前端量子纠缠 效果炸裂 multipleWindow3dScene

我 | 在这里 &#x1f575;️ 读书 | 长沙 ⭐软件工程 ⭐ 本科 &#x1f3e0; 工作 | 广州 ⭐ Java 全栈开发&#xff08;软件工程师&#xff09; &#x1f383; 爱好 | 研究技术、旅游、阅读、运动、喜欢流行歌曲 ✈️已经旅游的地点 | 新疆-乌鲁木齐、新疆-吐鲁番、广东-广州…

丽晶酒店及度假村打造绮丽之境“美食实验室”中国市场首秀

于重庆丽晶酒店以艺术与美食的碰撞演绎“对比之美”&#xff0c;感官之华 2023年11月28日&#xff0c;中国上海 ——基于对当下消费趋势的敏锐洞察&#xff0c;洲际酒店集团旗下奢华品牌丽晶酒店及度假村近年来不断焕新&#xff0c;以崭新形象缔造现代奢华的旅居体验。作为丽晶…

基于SSM的酒店预订管理系统设计与实现

末尾获取源码 开发语言&#xff1a;Java Java开发工具&#xff1a;JDK1.8 后端框架&#xff1a;SSM 前端&#xff1a;Vue 数据库&#xff1a;MySQL5.7和Navicat管理工具结合 服务器&#xff1a;Tomcat8.5 开发软件&#xff1a;IDEA / Eclipse 是否Maven项目&#xff1a;是 目录…

广州华锐互动:VR虚拟现实内容创作工具带来全新的应用场景

随着科技的不断发展&#xff0c;低代码编辑工具已经成为了一种越来越受欢迎的开发方式。它可以帮助开发人员快速构建应用程序&#xff0c;降低开发成本&#xff0c;提高开发效率&#xff0c;而VR虚拟现实内容创作工具带来了全新的应用场景。 VR虚拟现实内容创作工具是广州华锐互…

《数据结构、算法与应用C++语言描述》-线索二叉树的定义与C++实现

_23Threaded BinaryTree 可编译运行代码见&#xff1a;GIithub::Data-Structures-Algorithms-and-Applications/_24Threaded_BinaryTree 线索二叉树定义 在普通二叉树中&#xff0c;有很多nullptr指针被浪费了&#xff0c;可以将其利用起来。 首先我们要来看看这空指针有多少…

Webshell混淆免杀的一些思路

简介 为了避免被杀软检测到&#xff0c;黑客们会对Webshell进行混淆免杀。本文将介绍一些Webshell混淆免杀的思路&#xff0c;帮助安全人员更好地防范Webshell攻击。静态免杀是指通过对恶意软件进行混淆、加密或其他技术手段&#xff0c;使其在静态分析阶段难以被杀毒软件或安全…

linux 安装 mvn

mvn 下载地址&#xff1a;https://maven.apache.org/download.cgi 选择一个合适的版本 cd /opt && curl -o apache-maven-3.8.6-bin.tar.gz https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz tar -xzf apache-maven-3.8.6-bin.…

【EI会议投稿】第四届物联网与智慧城市国际学术会议(IoTSC 2024)

第四届物联网与智慧城市国际学术会议 2024 4th International Conference on Internet of Things and Smart City 继IoTSC前三届的成功举办&#xff0c;第四届物联网与智慧城市国际学术会议&#xff08;IoTSC 2024&#xff09;将于2024年3月22-24日在河南洛阳举办。 智慧城市的…

常见面试题-Redis 切片集群以及主节点选举机制

Redis 切片集群了解吗&#xff1f; 答&#xff1a; Redis 切片集群是目前使用比较多的方案&#xff0c;Redis 切面集群支持多个主从集群进行横向扩容&#xff0c;架构如下&#xff1a; 使用切片集群有什么好处&#xff1f; 提升 Redis 读写性能&#xff0c;之前的主从模式中&…

Python---lambda表达式

普通函数与匿名函数 在Python中&#xff0c;函数是一个被命名的、独立的完成特定功能的一段代码&#xff0c;并可能给调用它的程序一个返回值。 所以在Python中&#xff0c;函数大多数是有名函数 > 普通函数。但是有些情况下&#xff0c;我们为了简化程序代码&#xff0c;…