STKX组件实现c#与stk的集成
STKX和QT技术集成在卫星视景仿真的应用

普通人员来说 , 操作不便 、 难 以掌握 、 应用范 围受限 。为克服这些缺 陷, 通过 S TK X组件 技术和 QT技术 集成 , 对S T K进 行必
要功能屏蔽 , 建立 友好 的中文人机交界面 , 实现卫星视景仿真 。首先介绍 了 S T KX组件技术 , 然后根据 集成设计 仿真 系统 , 最 后进行 了仿真验证 。其技术研究也 可应用在我 国正在发展 的航天器任务模 拟系统上。 关键词 : S TKX; QT; 视景仿真 ; 可视化
Байду номын сангаас
t o ma s t e r . To o v e r c o me t h e s e d e f e c t s , t h r o u g h t h e S TKX c o mp o n e n t t e c h n o l o g y a n d QT t e c h n o l o g y i n t e g r a t i o n , s h i e l d i n g
Fi r s t t h e p a p e r i n t r o d u c e s S TKX c o mp o n e n t t e c h n o l o g y, t h e n d e s i g n s s i mu l a t i o n s y s t e m a c c o r d i n g t o t h e i n t e g r a t i o n, f i — n a l l y, ma k e s t h e s i mu l a t i o n a n d v a l i d a t i o n . I t s t e c h n o l o g y c a n a l s o b e u s e d i n Ch i n e s e d e v e l o p i n g s p a c e c r a f t mi s s i o n a c t i v i —
用MapX与C开发地理信息系统

用MapX与C#开发地理信息系统第四章MAPX与C#实例 (5)4.1M AP X图层建立 (5)4.1.1 MapX数据与地图的组织结构 (5)4.1.2 实例1:建立/添加一个用户自定义图层 (5)4.1.3 在MapX中使用栅格图层 (7)4.1.4 实例2:栅格图层的建立 (8)4.2图元自动标注 (9)4.2.1 实例3:给图层加上自动标注功能 (9)4.3M AP X地图集 (9)4.3.1 什么是MapX地图集(Geoset)? (9)4.3.2 实例4:打开已存在的地图集文件 (10)4.3.3 实例5:保存地图集 (10)4.4内置工具的使用 (11)4.4.1 使用标准工具 (11)4.4.3 实例6:内置标准工具的使用 (11)4.5自定义工具 (12)4.5.1 创建自定义工具 (12)4.5.2 实例7:创建测量长度和面积自定义工具 (13)4.6M AP X地图符号样式的定制 (14)4.7在图层上添加自定义图元 (15)4.7.1 实例8:鼠标点击向图层上添加图元 (15)4.7.2 实例9:给定坐标向图层上自动添加图元 (17)4.8获得图元属性 (20)4.8.1实例10:获取选定图元的属性 (20)4.9图元的选取 (21)4.9.1 实例11:实现InfoTip功能 (21)4.10图元属性的修改 (22)4.10.1 实例12:修改图元属性 (22)4.11实例13:图元的查询 (23)4.12实例14:鹰眼图的实现 (24)4.13数据绑定 (26)4.14GPS在GIS系统中的应用 (27)4.14.1定位信息的接收 (27)4.14.2定位信息的提取 (27)4.14.3定位信息在MapX中的显示 (28)4.14.4 实例15:GPS定位系统的应用 (28)4.15多媒体信息在GIS系统中的应用 (33)4.15.1 GIS中嵌入多媒体的方法 (33)4.15.2 实例16:在MapX系统中嵌入多媒体数据 (33)第五章MAPX与ORACLE结合 (35)5.1O RACLE数据库对GIS的支持 (35)5.1.1面向对象的数据库支持 (35)5.1.2.Oracle spatial组件的引入 (35)5.2循序渐进学习O RACLE S PATIAL在M AP X中的应用 (36)5.2.1 oralce服务器的安装 (36)5.2.2 准备由Oracle Spatial存储的图层文件 (36)5.2.3 Easyloader上载工具 (36)5.2.4 图层信息在Oracle中的存储结构 (38)5.2.5用程序实现MapX图元到oracle数据库的上载 (42)5.2.6 用程序实现oracle数据表数据下载至MapX中显示 (44)5.2.7 图元样式的还原 (46)5.3在网络环境下实现图层信息共享 (47)第六章MAPCTRL控件的开发方法 (57)6.1主要功能 (57)6.2开发步骤 (57)6.3程序实现 (58)第七章分发基于.NET平台的MAPX应用程序 (91) F RAMEWORK 概述 (91) F RAMEWORK 的主要组件和功能 (92)7.2.1公共语言运行库 (92)7.2.2 .NET Framework 类库 (92)7.3安装.NET F RAMEWORK (93)7.4M AP客户安装 (93)7.5制作安装程序 (93)第四章MapX与C#实例这一章我们通过若干专题来介绍用C#如何开发MapX应用程序。
stk 二次开发手册

stk 二次开发手册(原创实用版)目录1.STK 二次开发手册概述2.STK 二次开发的流程3.STK 二次开发的工具和资源4.STK 二次开发的注意事项5.STK 二次开发的案例分析正文一、STK 二次开发手册概述STK 二次开发手册是一本关于软件开发工具包(Software Development Kit,简称 STK)的二次开发指南。
本手册旨在帮助开发者充分利用 STK 的功能,实现自定义化、高效化的软件开发。
手册内容涵盖了 STK 二次开发的基本概念、流程、工具和资源,以及注意事项和案例分析。
二、STK 二次开发的流程STK 二次开发流程主要包括以下几个步骤:1.了解 STK:首先,开发者需要对 STK 的架构、功能和接口有一定了解,以便在后续开发过程中更好地利用 STK 的功能。
2.确定需求:根据项目需求,分析需要使用 STK 的哪些功能,并确定相应的开发任务。
3.选择工具和资源:根据开发任务,选择合适的 STK 工具和资源,例如编程语言、库函数等。
4.开发实现:利用所选工具和资源,编写代码实现自定义功能。
5.测试与调试:对开发成果进行测试和调试,确保功能正确、稳定、高效。
6.集成与部署:将自定义功能集成到 STK 中,并进行部署。
三、STK 二次开发的工具和资源STK 提供了丰富的工具和资源,以支持开发者进行二次开发。
主要包括:1.编程语言:STK 支持多种编程语言,如 C、C++、Java 等。
2.库函数:STK 提供了丰富的库函数,包括基本函数、高级函数等,以满足不同开发需求。
3.开发工具:STK 提供了可视化的开发工具,如集成开发环境(IDE)等,以方便开发者编写、调试代码。
4.文档资料:STK 提供了详细的开发文档和案例,以帮助开发者快速上手和深入学习。
四、STK 二次开发的注意事项在进行 STK 二次开发时,开发者需要注意以下几点:1.确保对 STK 的正确理解,避免因误解导致的错误开发。
c++ vassistx使用技巧

c++ vassistx使用技巧CVassistX是一款功能强大的代码编辑器,广泛应用于各种软件开发中。
本文将介绍CVassistX的使用技巧,帮助读者更好地掌握这款工具,提高开发效率。
一、界面布局与操作1.启动CVassistX后,默认会打开一个空白的代码编辑窗口。
可以通过菜单栏中的“文件”->“新建”来创建一个新的项目或文件。
可以通过菜单栏中的“工具”->“选项”来调整高亮显示设置。
3.编辑器支持多种代码操作,如复制、粘贴、剪切、撤销等。
可以通过菜单栏中的相应选项进行操作,也可以使用快捷键进行快速操作。
二、代码编辑技巧1.CVassistX支持代码自动补全功能,可以通过键盘上的Tab键或鼠标点击自动补全提示框来快速完成代码编写。
2.编辑器支持代码折叠功能,可以通过菜单栏中的“查看”->“折叠”来折叠代码块,方便查看和管理代码。
3.编辑器支持代码注释和取消注释功能,可以通过菜单栏中的“编辑”->“注释”来进行操作。
4.编辑器支持代码行号显示,可以通过菜单栏中的“查看”->“显示行号”来开启或关闭行号显示。
三、搜索与替换技巧1.CVassistX支持文本搜索和替换功能,可以通过菜单栏中的“编辑”->“查找”来进行搜索,通过“编辑”->“替换”来进行替换。
2.搜索和替换支持正则表达式,可以根据需要使用正则表达式进行精确匹配和替换。
3.搜索和替换结果可以批量操作,如高亮显示、选中并复制等。
可以通过菜单栏中的“编辑”->“批量操作”来进行批量操作。
四、插件与扩展技巧1.CVassistX支持插件和扩展功能,可以通过安装第三方插件来扩展编辑器的功能。
可以在官方网站上下载插件并进行安装。
2.插件和扩展支持自定义配置,可以根据需要调整插件的参数和行为。
可以通过菜单栏中的“工具”->“插件管理器”来进行插件配置和管理。
3.插件和扩展的使用可以参考官方文档和示例代码,了解插件的原理和使用方法。
利用VC与STK设计实现飞行器航迹数字可视化仿真

It r 0 ain d r 5 n ep lto Or e #sTK的插值 Co r iae y tm F x d #航迹 文件 o dn tS se ie 采 用 的 坐 标 系统 ; E he rs p mei XYZ Ti Po Ve #文件 me s l 采 用 ECF -XYZ-P 组 合 形 式 { OS #纬度 ( i ) 纬 度( i ) 高 度( m) 经 k n k n k
可视化仿 真 中。
时 间 、 度 度 度 等 多 种组 合 。 仿 真 令 , “ 经 纬 高 本 如 Set i i POS t On”、“ C e s A C s ”等 ; 以 地心 直 角 坐标 系( C —XY - O ) E F Z P S 形式 <Ob e t t jc Pa h>指 明 一个 S TK的类 实 例 , 如 给出航迹数据信息 , 式如 下 : 格 sk V. . #版本 说 明 } t. 43
BE N E he r s # 外 部 数 据 文 件 GI p me i
的 开始 ;
Num be O f r Ephe e i Po nt l 1 m rs i s 1 l 4
“ c n r o St S e a i / kVi w/Ai c a t e r r f /Ai 0 t rl
连接 。 ( ) : o d tr a F e )载 入用VC设 2 : L a Ex e n l n (, 置 好 的飞 行 航 迹 文 件 。
本 文 设 计以 Vc 成 的航 迹 文件 为 仿真 数 量 ; 生
回 传 的 数 据 信 息 , 分 析 飞 行 器 的 飞 行 状 为 态提 供 可 视 化的 数 据 支 持 。 案 以 Co e t 方 nn c 模块 为核 心 , 现VC与S 实 TK交 互 类 , 建立 飞 行 器视 景 平 台 , 时 间为 仿真 主 线 , 以 完成 对 仿真 过 程 的 控 制 。 要 设计 三 部 分 : 主
基于STK二次开发的链路测控仿真

基于STK二次开发的链路测控仿真丁学勇;崔津华【摘要】在航空航天任务过程中,测控覆盖率高就能提供实时、连续、可靠的信息支持.利用VC结合STK二次开发,建立了测控链路仿真模型.软件利用STK/X模块较好的显示效果与Access模块计算、显示测控链路的余量和测控链路覆盖范围.针对不同的地面站部署,可计算空间飞行器的测控覆盖率.实现VC与STK集成的二次开发可大幅节省了开发时间,该仿真方法对测控系统的设计具有参考价值.【期刊名称】《电子科技》【年(卷),期】2015(028)006【总页数】3页(P21-23)【关键词】测控链路;STK二次开发;STK/X;仿真建模【作者】丁学勇;崔津华【作者单位】西安电子科技大学电子信息攻防对抗与仿真重点实验室,陕西西安710071;西安电子科技大学电子信息攻防对抗与仿真重点实验室,陕西西安710071【正文语种】中文【中图分类】TP391.9;V556STK(Satellite Tool Kit)是航天领域系统分析可视化工具,可用于航天任务整个周期包括概念、需求、设计、制造、测试、发射、运行和应用等,其可支援、防御和情报任务。
卫星仿真软件在军事任务中体现出越来越多的优势,比如有较真实的3D和2D场景显示、集成化的仿真模块等,其分析仿真结果被大量实验证实,应用领域广泛[1]。
1 STK二次开发仿真模型的建立算法利用STK提供的高级可视化模块、姿态可视化、轨道机动分析、覆盖分析、链路分析、雷达分析、分布式交互仿真等模块化工具,能够快速开发解决方案。
将STK提供的二维和三维引擎STK\X作为COM组件嵌入在用户软件中[2-5],再利用 STK提供组合命令与STK/X进行命令交互,用 STK提供的函数 Execute Command(CString str)向STK/X发送交互命令,交互命令[6-7]可以在 STK 安装目录 X:/STK9/Help/connectCmds.chm中查找到。
s-function c++原理

s-function c++原理"S-function" 是 Simulink 模型中使用的一种函数。
Simulink 是MATLAB 的一个组件,用于模拟动态系统和设计控制系统。
S-function 可以用于扩展 Simulink 的功能,使得用户可以自定义他们的模型行为。
在C++ 中实现 S-function,需要编写一个类,该类需要实现Simulink 提供的 S-function 接口。
这个接口包括一系列的函数,如 ssGetNumSFcnParams、ssGetSFcnParamInfo、ssGetNumInputPorts、ssGetInputPortInfo、ssGetNumOutputPorts、ssGetOutputPortInfo、ssGetPortWidth、ssSetInputPortDirectFeedThrough、ssSetOutputPortDirectFeedThrough 等。
在 C++ 中实现 S-function 的步骤大致如下:创建一个类,该类继承自 Simulink 提供的 S-function 基类(例如,SimstrucSFunction)。
实现上述提到的 S-function 接口函数。
这些函数的实现取决于你的模型需求。
例如,ssGetNumInputPorts 和 ssGetInputPortInfo 函数用于描述输入端口的信息,ssGetNumOutputPorts 和ssGetOutputPortInfo 函数用于描述输出端口的信息。
在你的类中,实现用于模拟系统行为的函数。
这个函数将根据输入的信号计算输出的信号。
这个函数的输入和输出参数都是通过S-function 的输入和输出端口获取和设置的。
最后,将你的类编译成动态链接库(例如,.dll 或 .so 文件),然后在Simulink 中使用sfcnload 命令加载这个库,并使用sfcncreate 命令创建一个新的 S-function。
STK基础教程

STK基础教程By appe1943 西安交通大学目录1 STK软件简介 (1)1.1 STK软件简介 (1)1.2 STK软件发展历程 (2)1.3 安装STK软件 (2)1.4 STK软件的功能模块 (2)1.4.1 先进的分析模块(AMM) (2)1.4.2 Connect模块 (2)1.4.3 高精度轨道生成函数(HPOP) (3)1.4.4 长周期轨道预测器(LOP) (3)1.4.5 生命周期 (3)1.4.6 地形 (3)1.4.7 高分辨率地图 (3)1.5 章节安排........................................................................................ 错误!未定义书签。
2 创建第一个STK场景 (5)2.1 引言 (5)2.2 创建场景 (5)2.3 创建对象 (5)2.3.1 创建地面站 (6)2.3.2 创建城市 (6)2.3.3 创建卫星 (6)2.3.4 创建传感器 (7)2.4 计算访问窗口 (8)2.5 约束条件下访问窗口的计算 (8)2.5.1 升交角(Elevation Angle)约束 (8)2.5.2 时间约束 (8)2.6 报告和图表 (9)2.6.1 纬度、经度和高度(LLA Position) (9)2.6.2 光照时间(Lighting Times) (9)2.7 3D动画演示 (9)2.7.1 设置地球3D属性 (10)2.7.2 设置传感器显示属性 (10)目录3 利用Comm Constraints设计通信链路 (12)3.1 引言 (12)3.2 设置链路 (12)3.3 设置COMM CONSTRAINTS (16)3.3.1 接收各向同性功率约束 (17)3.3.2 多普勒频移约束 (18)3.3.3 通量密度约束 (18)3.3.4 载波噪声比约束 (18)3.3.5 数字通信系统约束 (19)3.3.6 折射高度和距离约束 (19)3.3.7 系统噪声温度约束 (22)3.4 经常用到的C/N Constraints (23)4 使用Comm模块对转发器建模 (24)4.1 概述 (24)4.2 环境设置 (24)4.3 定义Comm参数 (26)4.4 模拟转发器 (28)4.5 数字转发器 (29)4.6 比较链路性能 (30)5 利用STK分析雷达干扰 (31)5.1 概述 (31)5.2 场景设置 (31)5.2.1 添加一个地面设施和带有干扰雷达的飞机 (31)5.2.2 在地面设施中添加雷达 (32)5.3 雷达干扰报告 (34)5.4 设置约束条件 (34)6 使用地形和地貌数据 (36)6.1 概述 (36)6.2 将地形数据导入到场景中 (36)6.3 使用图像转换器(Image Converter) (37)6.3.1 创建3D图像纹理 (37)6.3.2 在2D窗口中显示图像纹理 (40)6.4 使用地形转换器(Terrain Converter) (41)6.4.1 在3D图形窗口中显示 (41)6.4.2 在2D图形窗口中显示 (42)6.5 结论 (42)7 使用天线对象 (43)7.1 概述 (43)7.2 嵌入式天线vs. 链接式天线 (43)7.3 创建场景 (43)7.4 添加地面设施和卫星 (43)7.5 在地面设施中添加天线和接收机 (44)7.6 在卫星上添加天线 (45)7.7 创建报告 (45)8 使用多路径对象 (47)9 使用飞机任务模块 (52)9.1 概述 (52)9.2 在3D图形窗口中定义任务 (52)9.2.1 环境设置 (53)9.2.2 选择飞机模型 (54)9.2.3 添加过程 (55)9.3 在属性里定义任务 (57)9.3.1 环境设置 (57)9.3.2 选择飞机对象 (57)9.3.3 过程定义 (57)9.4 使用目录 (60)9.5 地形跟踪 (63)9.6 使用阶段性能模块 (66)9.6.1 环境设置 (66)9.6.2 选择飞机模型 (66)9.6.3 定义性能模块 (66)9.6.4 增加阶段和过程 (67)10 在STK里使用矢量工具 (71)10.1 引言 (71)10.2 矢量图形 (71)10.3 显示矢量 (72)10.4 平面 (74)10.5 创建新的矢量 (75)10.6 姿态球 (79)10.7 创建和显示角度 (81)10.8 始终显示矢量 (84)11 使用STK X (86)目录11.1 STK X与C++ (86)11.1.1 创建工程 (86)11.1.2 将STK X添加到工具栏中 (87)11.1.3 向STK X发送指令 (88)11.1.4 为Map控件添加缩放功能 (91)11.1.5 响应STK X事件 (92)11.1.6 添加地图选择事件 (94)11.1.7 设置STK X属性 (96)11.2 STK X与C# (98)11.2.1 创建工程 (98)11.2.2 将STK X控件添加到工具栏中 (98)11.2.3 向STK X发送指令 (99)11.2.4 为Map控件添加缩放功能 (101)11.2.5 响应STK X事件 (102)11.2.6 添加地图选择事件 (104)11.2.7 设置STK X属性 (105)11.3 STK X与Html (107)11.3.1 向STK X传递指令 (107)11.3.2 为Map控件添加缩放功能 (109)11.3.3 响应STK X事件 (109)11.3.4 添加地图选择事件 (110)11.3.5 设置STK X属性 (111)11.4 STK X与Java (113)11.4.1 利用J-Integra创建Java COM代码 (113)11.4.2 编译JIntegra输出java代码 (114)11.4.3 创建应用 (115)11.4.4 在窗口中添加STK X控件 (116)11.4.5 向STK X发送命令 (117)11.4.6 为Map控件添加缩放功能 (118)11.4.7 响应STK X事件 (119)11.4.8 添加地图选择事件 (121)11.4.9 设置STK X属性 (122)11.5 STK X与Matlab (122)11.5.1 创建工程 (123)11.5.2 在表单中添加STK X控件 (123)11.5.3 向STK X发送指令 (126)11.5.4 为Map控件添加缩放功能 (129)11.5.5 响应STK X事件 (131)11.5.6 添加地图选择事件 (133)11.5.7 设置STK X属性 (135)11.5.8 添加Connect命令接口 (139)11.6 STK X与MFC (139)11.6.1 创建工程 (139)11.6.2 将STK X控件添加到工具栏中 (140)11.6.3 向STK X发送指令 (142)11.6.4 为Map控件添加缩放功能 (145)11.6.5 响应STK X事件 (146)11.6.6 添加Map选择事件 (148)11.6.7 设置STK X属性 (150)11.7 STK X与Visual C++ 6.0 (152)11.7.1 创建工程 (152)11.7.2 在对话框中添加STK X控件 (155)11.7.3 向STK X发送指令 (156)11.7.4 为Map控件添加缩放功能 (161)11.7.5 响应STK X事件 (162)11.7.6 添加地图选择事件 (166)11.7.7 设置STK X属性 (168)12 AzEI方位角/仰角遮罩工具的使用 (171)12.1 设置环境 (171)12.2 制作BMSK文件 (173)12.3 利用BMSK限制访问 (174)12.4 在3D图形窗口中观察对象 (174)13 导弹建模工具箱的使用 (177)13.1 导弹建模工具箱介绍 (177)13.2 导弹防御系统功能介绍 (181)13.3 利用MFT规划导弹试验 (183)13.3.1 载入场景 (183)13.3.2 打开STK/Analyzer (184)13.3.3 影响雷达跟踪时间的因素 (185)13.3.4 最优试验安排 (192)13.4 利用IFT评估末段杀伤概率 (195)13.4.1 载入场景 (196)目录13.4.2 打开STK/Analyzer (197)13.4.3 作战管理系统时间延迟影响 (198)13.4.4 蒙特卡罗仿真 (204)13.5 利用MFT & IFT分析受保护区域 (209)13.5.1 载入场景 (210)13.5.2 设置目标位置网格 (211)13.5.3 打开STK/Analyzer (212)13.5.4 设置拦截事件 (213)13.5.5 使用Analyzer宏 (220)13.5.6 其它注意事项 (224)14 Analyzer使用方法 (226)14.1 卫星覆盖能力分析 (226)14.1.1 载入场景 (227)14.1.2 打开STK/Analyzer (227)14.1.3 计算卫星的覆盖能力 (228)14.1.4 轨道倾角对覆盖能力的影响 (230)14.1.5 RAAN对覆盖能力的影响 (234)14.1.6 高度对覆盖能力的影响 (236)14.1.7 轨道倾角和高度相互间的影响 (239)14.1.8 传感器对覆盖能力的影响 (240)14.1.9 最优化传感器参数 (245)14.2 卫星发射机参数对覆盖能力的影响 (247)14.2.1 载入场景 (248)14.2.2 打开STK/Analyzer (249)14.2.3 计算覆盖统计数据 (250)14.2.4 功率对覆盖的影响 (251)14.2.5 频率对覆盖的影响 (254)14.2.6 数据传输速率对覆盖的影响 (256)14.2.7 功率及频率是否相互影响? (257)14.2.8 最优发射机参数 (259)15 Astrogator使用方法 (262)15.1 最优真近点角 (262)15.2 发射错误 (266)15.3 飞向月球 (271)附录1 Matlab与STK互连 (277)附录2 STK图像转换器工作流程 (282)附录3 STK地形转换器工作流程 (283)附录4 视线的计算 (284)附录5 常用的STK指令 (287)附录5 NORAD双行轨道根数 (289)1 STK软件简介1 STK软件简介1.1STK软件简介卫星工具软件STK(Satellite Tool Kit,STK)是航天领域中先进的系统分析软件,由美国分析图形有限公司(Analytical Graphics Inc, AGI)研制,用于分析复杂的陆地、海洋、航空及航天任务。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
STK X Tutorial - C#In this exercise you will gain hands-on experience using STK X to embed STK functionality in a container application created with C#.N OTE:Except where otherwise noted, the instructions in this tutorial areapplicable whether you are using Visual Studio 2005 or Visual (2003). All pictures are of the Visual Studio 2005 interface.C ONTENTSCREATE THE PROJECT (1)ADD THE STK X CONTROLS TO THE TOOLBOX (1)SEND COMMANDS TO STK X (2)ADD ZOOM IN/OUT TO THE MAP CONTROL (4)RESPOND TO EVENTS RAISED BY STK X (5)ADD MAP PICKING (8)SET STK X PROPERTIES (9)Create the project1)Start Visual Studio.2)From the File menu, select New, and then Project….3)Select Visual C# as the Project type and the Windows Application template. Enter aproject name and location of your choice.4)The Form1.cs windows form is opened in Design mode.Add the STK X controls to the Toolbox1)If the Toolbox is not already displayed, select it from the View menu.2)Go to the General section of the toolbox, and right-click in the toolbox background.3)In the context menu, select Choose Items… (or Add/Remove Items… if you areusing Visual 2003).STK X Tutorial – C# 14)In the Choose Toolbox Items dialog (Customize Toolbox in Visual 2003), select the COM Components tab.5)Check AGI Globe Control 8 and AGI Map Control 8in the list of controls, and clickOK to close the dialog.6)The AGI Map Control and AGI Globe Control now appear in the Toolbox underthe General tab:Send commands to STK X1)Drag the AGI Globe Control onto Form1.cs. Place and size the control it so that itapproximately fills the right-hand portion of the form. Then drag the AGI MapControl onto the left-hand portion of the form, sizing it so that it leaves some spacefor other controls to be added.STK X Tutorial – C# 22)Add 3 buttons and a label to the form, arranged as shown here:STK X Tutorial – C# 3N OTE:If you are using Visual 2003, the label may appear larger,since it does not automatically resize by default as it does in Visual Studio2005.3)Change the Text property for the top button to New Scenario.4)Double-click the New Scenario button in the Designer to expose the code for itsClick event handler.5)Modify the button1_Click method by adding the following line:this.axAgUiAx2DCntrl1.Application.ExecuteCommand("New / ScenarioTest");6)Build and run the application.7)Click the New Scenario button. It may take a few minutes for the results to display.8)Move the mouse in the Globe window to rotate the globe (holding down the leftmouse button) or zoom in and out on it (holding down the right mouse button).Add Zoom In/Out to the Map control1)Change the Text properties of the remaining 2 buttons to Zoom In and Zoom Out.2)Double-click on the Zoom In button to expose the code for the click event handler.STK X Tutorial – C# 43)Add the following line to the event handler:this.axAgUiAx2DCntrl1.ZoomIn();4)Similarly, modify the click event handler for the Zoom Out button by adding thefollowing:this.axAgUiAx2DCntrl1.ZoomOut();5)Build and run the application, and click the New Scenario button.6)Click the Zoom In button. Use the mouse to define the zoom area in the Mapwindow.7)You can zoom out by clicking the Zoom Out button.Respond to events raised by STK X1)In the Visual Studio IDE, switch to the Design view.2)Select the Map control, and display its Properties dialog.3)In the Properties dialog, click the (lightning bolt) icon.4)On the line for the DblClick event, enter On2DMapDblClick and press Enter.STK X Tutorial – C# 55)This exposes the code for the new event handler that you added. Modify that code asfollows:private void On2DMapDblClick(object sender, System.EventArgs e){MessageBox.Show("2D Map double click");}6)Build and run the application.7)Double-click in the Map window. The message box will be displayed.8)You can use the same approach to hook up to Globe control events.9)You will now respond to STK X application events. Add the line below to the formcode at the beginning of the Form1 class definition (see note below). This adds thestkxApp member variable to your form. Through this variable you can access theSTK X application object.private AGI.STKX.AgSTKXApplication stkxApp;N OTE:Strictly speaking, Form1 is handled as 2 partial classes in Visual Studio2005, appearing in two separate source files. The intent of the aboveinstruction is that you add the stkxApp declaration to the beginning of the STK X Tutorial – C# 6partial class defined in Form1.cs, though you could instead have added it tothe list of global variable declarations found in Form1.Designer.cs. In Visual 2003 this is not an issue, and you can place the stkxAppdeclaration at the beginning of the class definition or order it moresystematically among the other variable declarations, as you choose.10)You will now subscribe for notification on the STK X application object. As thisobject is not a control, the procedure is a little bit different. Add the following lines tothe form constructor, after the call to InitializeComponent():this.stkxApp = new AGI.STKX.AgSTKXApplicationClass();this.stkxApp.OnScenarioNew +=newAGI.STKX.IAgSTKXApplicationEvents_OnScenarioNewEventHandler(this.OnNewScenario);11)Add the following callback function to the Form1 class:private void OnNewScenario(String path){MessageBox.Show("New scenario created: " + path);}12)You will now have to make sure that your stkxApp object is released properly. Go toDesign view, display the Properties dialog for the form, click the (lightningbolt) icon, and select the FormClosing event (Closing in Visual 2003);type in “FinalRelease” and press Enter.13)Add the following code to your new event handler:this.stkxApp.OnScenarioNew -= newAGI.STKX.IAgSTKXApplicationEvents_OnScenarioNewEventHandler(OnNewScenario);System.Runtime.InteropServices.Marshal.FinalReleaseComObject(stkxApp);GC.WaitForPendingFinalizers();14)Build and run the application.15)Click the New Scenario button. A message box will be displayed as a result of thisevent.STK X Tutorial – C# 7Add map picking1)Return to the Design view of Form1 in Visual Studio. Bring up the Propertiesdialog for the label, and clear the Text property (so that no text displays initially).2)If you are using Visual 2003, change the label's AutoSize property toTrue (it is True by default in Visual Studio 2005).3)Select the Globe control. In its Properties dialog, click the (lightning bolt)icon.4)On the line for the MouseMoveEvent event, enter On3DMouseMove and pressEnter.5)Enter the following code for your new event handler:AGI.STKX.IAgPickInfoData pickInfoData =e.y);this.axAgUiAxVOCntrl1.PickInfo(e.x,(pickInfoData.IsLatLonAltValid)if{bel1.Text= "Lat: " + t+ "\r\n Lon: " +pickInfoData.Lon + "\r\n Alt: " + pickInfoData.Alt;}STK X Tutorial – C# 8else{bel1.Text="";}6)Build and run the application.7)Click the New Scenario button. Move the mouse over the Globe control. The mousemove event will be called. The mouse coordinates are converted tolatitude/longitude/altitude and displayed in the label.N OTE:Altitude is zero because there is no terrain data.Set STK X properties1)Right-click on the Globe control and select Properties. The STK X Propertiesdialog will be displayed.2)The Color tab allows you to set the background color of the Globe control’s viewingsquare. Set the color to Dark Red, and then click Apply. The background color onthe Globe object will change.STK X Tutorial – C# 93)Click on the Picture tab to bring up the Picture properties. These properties allowyou to change or remove the splash panel displayed in the STK X control.4)Click on Browse… and navigate to an alternate picture.5)Select the picture, and then click Apply. Your picture will now be shown as thesplash panel when no scenario is loaded.STK X Tutorial – C# 10STK X Tutorial – C# 11。