Description
Multi-Track Object (MTO) interface.
Object Model
Public Properties
Example
Configure MTO
[C#] | Copy Code |
---|
IAgScenario scenario = root.CurrentScenario as IAgScenario;
scenario.SetTimePeriod("1 Feb 2008 12:00:00.000", "2 Feb 2008 12:00:00.000");
double trackCount = 10;
double pointCount = 20;
double lat0 = 40.04;
double lon0 = -75.595;
double alt0 = 0;
root.BeginUpdate();
for (int i = 0; i < trackCount; ++i)
{
IAgMtoTrack track = mto.Tracks.Add(i);
IAgDate date = root.ConversionUtility.NewDate("UTCG", scenario.StartTime as string);
for (int j = 0; j < pointCount; ++j)
{
double lat = lat0 + 1 * i;
double lon = lon0 + 0.1 * j;
double alt = alt0;
date = date.Add("sec", 120);
track.Points.AddPoint(date.Format("UTCG"), lat, lon, alt);
}
}
root.EndUpdate();
|
|
Create a MTO (on current scenario central body)
[C#] | Copy Code |
---|
IAgMto mto = root.CurrentScenario.Children.New(AgESTKObjectType.eMTO, "mto1") as IAgMto;
|
|
Configure MTO
[Visual Basic .NET] | Copy Code |
---|
Dim scenario As IAgScenario = TryCast(root.CurrentScenario, IAgScenario) scenario.SetTimePeriod("1 Feb 2008 12:00:00.000", "2 Feb 2008 12:00:00.000")
Dim trackCount As Double = 10 Dim pointCount As Double = 20
Dim lat0 As Double = 40.04 Dim lon0 As Double = -75.595 Dim alt0 As Double = 0
root.BeginUpdate()
Dim i As Integer = 0 While i <> Dim track As IAgMtoTrack = mto.Tracks.Add(i) Dim [date] As IAgDate = root.ConversionUtility.NewDate("UTCG", TryCast(scenario.StartTime, String))
Dim j As Integer = 0 While j <> Dim lat As Double = lat0 + 1 * i Dim lon As Double = lon0 + 0.1 * j Dim alt As Double = alt0
[date] = [date].Add("sec", 120)
track.Points.AddPoint([date].Format("UTCG"), lat, lon, alt) System.Threading.Interlocked.Increment(j) End While System.Threading.Interlocked.Increment(i) End While
root.EndUpdate()
|
|
Create a MTO (on current scenario central body)
[Visual Basic .NET] | Copy Code |
---|
Dim mto As IAgMto = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eMTO, "mto1"), IAgMto)
|
|
Create a New MTO (on the current scenario central body)
[MATLAB] | Copy Code |
---|
% IAgScenario scenario: Scenario object mto = scenario.Children.New('eMTO','MyMTO'); mtoTimes = {0; 7200}; mtoLats = {36.77; 34.80}; mtoLons = {-77.25; -78.37}; mtoAlts = {5; 5}; track1 = mto.Tracks.AddTrack(1,mtoTimes,mtoLats,mtoLons,mtoAlts); track1.Interpolate = true; % Change the color of the track mto.Graphics.Tracks.GetTrackFromId(1).Color = 255;
|
|
Load MTO track points from file
[MATLAB] | Copy Code |
---|
% LoadPoints expects the path an Ephemeris file path % IAgMto mto: MTO Object track2 = mto.Tracks.Add(2); track2.Points.LoadPoints('C:\Program Files\AGI\STK 11\Help\stktraining\text\EphemerisLLATimePosVel_Example.e'); track2.Interpolate = true;
|
|
Create a New MTO (on the current scenario central body)
[Python] | Copy Code |
---|
# IAgScenario scenario: Scenario object mto = scenario.Children.New(12,'MyMTO') # eMTO mtoTimes = [ [0],[7200] ] mtoLats = [ [36.77],[34.80] ] mtoLons = [ [-77.25],[-78.37] ] mtoAlts = [ [5],[5] ] track1 = mto.Tracks.AddTrack(1,mtoTimes,mtoLats,mtoLons,mtoAlts) track1.Interpolate = True # Change the color of the track mto.Graphics.Tracks.GetTrackFromId(1).Color = 255
|
|
Load MTO track points from file
[Python] | Copy Code |
---|
# LoadPoints expects the path an Ephemeris file path # IAgMto mto: MTO Object track2 = mto.Tracks.Add(2) track2.Points.LoadPoints(r'C:\Program Files\AGI\STK 11\Help\stktraining\text\EphemerisLLATimePosVel_Example.e') track2.Interpolate = True
|
|
CoClasses that Implement IAgMto