AGI STK Objects 11 Send comments on this topic.
ComputeRanges Method (IAgMtoAnalysisRange)
See Also  Example
Mode
TrackIds
Time





Description

Returns an array of track ids with a bool value if it's in range of the object.

Syntax

[Visual Basic .NET]
Public Function ComputeRanges( _
   ByVal Mode As AgEMtoRangeMode, _
   ByRef TrackIds As System.Array, _
   ByVal Time As System.Object _
) As System.Array

[C#]
public System.Array ComputeRanges(
AgEMtoRangeMode Mode,
ref System.Array TrackIds,
System.Object Time
);

[Managed C++]
public: System::Array ComputeRanges(
AgEMtoRangeMode Mode,
System::Array ^^ TrackIds,
VARIANT Time
);

[Java]
public Object[] computeRanges(
AgEMtoRangeMode Mode,
Object[] TrackIds,
Variant Time
);

[Unmanaged C++]
public: HRESULT ComputeRanges(
AgEMtoRangeMode Mode,
SAFEARRAY ** TrackIds,
VARIANT Time,
SAFEARRAY ** Array
);

Parameters

Mode
Member Value Description
eMtoRangeModeEach 2 For every track, returns the track id, 1 (within range) or 0 (not in range), and the range value in Connect distance units.
eMtoRangeModeEachInRange 3 Returns the Track_id for each track in range, a 1 and the range value in Connect distance units.
eMtoRangeModeEachNotInRange 4 Returns the Track_id for each track not in range, a 0 and the range value in Connect distance units.
TrackIds
Time

Example

Compute MTO ranges
[C#] Copy Code
IAgMtoAnalysisRange range = mto.Analysis.Range; 
range.StkObjectPath = "Satellite/J2Satellite"
 
// ComputeRanges expects a one dimensional array of mto track ids 
// ComputeRanges returns a two dimensional array of track id, visibility, and range 
Array tracks = new object[] 
               { 
                   14 
               }; 
 
Array result = range.ComputeRanges(AgEMtoRangeMode.eMtoRangeModeEach, ref tracks, "1 Jan 2012 12:00:00.000"); 
 
// Print results 
for (int i = 0; i < result.GetLength(0); i++) 

    Console.WriteLine("Track #: {0}, Visible: {1}, Range: {2}", result.GetValue(i, 0), result.GetValue(i, 1), result.GetValue(i, 2)); 

 

Compute MTO ranges
[Visual Basic .NET] Copy Code
Dim range As IAgMtoAnalysisRange = mto.Analysis.Range
range.StkObjectPath = "Satellite/J2Satellite"

' ComputeRanges expects a one dimensional array of mto track ids
' ComputeRanges returns a two dimensional array of track id, visibility, and range
#If Not CSToJava Then
#Else
#End If
Dim tracks As Array = New Object() {1, 4}

#If Not CSToJava Then
Dim result As Array = range.ComputeRanges(AgEMtoRangeMode.eMtoRangeModeEach, tracks, "1 Jan 2012 12:00:00.000")
#Else
#End If

' Print results
Dim i As Integer = 0
While i < result.GetLength(0)
    Console.WriteLine("Track #: {0}, Visible: {1}, Range: {2}", result.GetValue(i, 0), result.GetValue(i, 1), result.GetValue(i, 2))
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1