-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStkEngineHelper.GetSatelliteMCSDriver.cs
44 lines (36 loc) · 1.35 KB
/
StkEngineHelper.GetSatelliteMCSDriver.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Data;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Globalization;
using AGI.STKObjects;
using AGI.STKUtil;
using AGI.STKObjects.Astrogator;
using AGI.Ui.Application;
//=============================================================================
// Edit By: Li Yunfei
// 20170503: 初次创建
namespace StkEngineHelper
{
//#########################################################################
/// <summary>
/// StkEngine Object Model相关函数
/// </summary>
public static partial class StkObjectHelper
{
/// <summary>
/// 获取卫星的Astrogator
/// </summary>
/// <param name="step"></param>
public static IAgVADriverMCS GetSatelliteMCSDriver(IAgStkObject obj)
{
IAgSatellite satellite = obj as IAgSatellite;
if (satellite == null) throw new Exception("此物体不是卫星类型:" + obj.InstanceName);
IAgVADriverMCS driver = satellite.Propagator as IAgVADriverMCS;
if (driver == null) throw new Exception("此卫星的积分器不是Astrogator!卫星名:" + obj.InstanceName);
return driver;
}
}
}