AGI STK VGT 11 Send comments on this topic.
IAgCrdnEventArray Interface





Description

An ordered array of times, which may or may not be evenly spaced.

Object Model


Public Methods

Public Method FindTimes Return computed array of times.

Public Properties

Public Property Type Return the type of time array.

Example

Determines the time intervals of an event array.
[C#] Copy Code
IAgCrdnEventArray eventArray = provider.EventArrays["Orbit.Classical.SemimajorAxis.TimesOfLocalMax"]; 
 
IAgCrdnFindTimesResult foundTimes = eventArray.FindTimes(); 
if (foundTimes.IsValid) 

    Console.WriteLine("Times"); 
    int numTimes = foundTimes.Times.GetLength(0); 
    for (int i = 0; i < numTimes; ++i) 
    { 
        Console.WriteLine(foundTimes.Times.GetValue(i)); 
    } 
 
    foreach (IAgCrdnInterval timeArray in foundTimes.Intervals) 
    { 
        Console.WriteLine("Start: " + timeArray.Start); 
        Console.WriteLine("Stop: " + timeArray.Stop); 
    } 

 

Determine altitude of aircraft at one minute samples.
[C#] Copy Code
// Get the aircraft 
IAgStkObject aircraft = stkRoot.GetObjectFromPath("Aircraft/UAV"); 
 
// Configure a fixed step array that samples every 20 seconds. 
IAgCrdnEventArray twentySecondSample = aircraft.Vgt.EventArrays.Factory.CreateEventArrayFixedStep("TwentySecondSample",  "MyDescription"); 
IAgCrdnEventArrayFixedStep asFixedStep = twentySecondSample as IAgCrdnEventArrayFixedStep; 
asFixedStep.BoundingIntervalList = aircraft.Vgt.EventIntervalLists["AvailabilityIntervals"]; 
asFixedStep.SamplingTimeStep = 20
asFixedStep.ReferenceType = AgECrdnSampledReferenceTime.eCrdnSampledReferenceTimeStartOfIntervalList; 
 
// At each time step, get the aircraft's altitude and print the value. 
IAgCrdnFindTimesResult timeArrays = twentySecondSample.FindTimes(); 
if (timeArrays.IsValid) 

    Console.WriteLine("Times"); 
    int numTimes = timeArrays.Times.GetLength(0); 
    for (int i = 0; i < numTimes; ++i) 
    { 
        object epoch = timeArrays.Times.GetValue(i); 
        Array altitueAtTime = aircraft.Vgt.CalcScalars["GroundTrajectory.Detic.LLA.Altitude"].QuickEvaluate(epoch); 
        if ((bool)altitueAtTime.GetValue(0) == true
        { 
            Console.WriteLine("{0}: {1}", epoch, altitueAtTime.GetValue(1)); 
        } 
    } 

 

Determines the time intervals of an event array.
[Visual Basic .NET] Copy Code
Dim eventArray As IAgCrdnEventArray = provider.EventArrays("Orbit.Classical.SemimajorAxis.TimesOfLocalMax")

Dim foundTimes As IAgCrdnFindTimesResult = eventArray.FindTimes()
If foundTimes.IsValid Then
    Console.WriteLine("Times")
    Dim numTimes As Integer = foundTimes.Times.GetLength(0)
    Dim i As Integer = 0
    While i <>
        Console.WriteLine(foundTimes.Times.GetValue(i))
        System.Threading.Interlocked.Increment(i)
    End While

    For Each timeArray As IAgCrdnInterval In foundTimes.Intervals
        Console.WriteLine("Start: " + timeArray.Start)
        Console.WriteLine("Stop: " + timeArray.[Stop])
    Next
End If

Determine altitude of aircraft at one minute samples.
[Visual Basic .NET] Copy Code
' Get the aircraft
Dim aircraft As IAgStkObject = stkRoot.GetObjectFromPath("Aircraft/UAV")

' Configure a fixed step array that samples every 20 seconds.
Dim twentySecondSample As IAgCrdnEventArray = aircraft.Vgt.EventArrays.Factory.CreateEventArrayFixedStep("TwentySecondSample", "MyDescription")
Dim asFixedStep As IAgCrdnEventArrayFixedStep = TryCast(twentySecondSample, IAgCrdnEventArrayFixedStep)
asFixedStep.BoundingIntervalList = aircraft.Vgt.EventIntervalLists("AvailabilityIntervals")
asFixedStep.SamplingTimeStep = 20
asFixedStep.ReferenceType = AgECrdnSampledReferenceTime.eCrdnSampledReferenceTimeStartOfIntervalList

' At each time step, get the aircraft's altitude and print the value.
Dim timeArrays As IAgCrdnFindTimesResult = twentySecondSample.FindTimes()
If timeArrays.IsValid Then
    Console.WriteLine("Times")
    Dim numTimes As Integer = timeArrays.Times.GetLength(0)
    Dim i As Integer = 0
    While i <>
        Dim epoch As Object = timeArrays.Times.GetValue(i)
        Dim altitueAtTime As Array = aircraft.Vgt.CalcScalars("GroundTrajectory.Detic.LLA.Altitude").QuickEvaluate(epoch)
        If DirectCast(altitueAtTime.GetValue(0), Boolean) = True Then
            Console.WriteLine("{0}: {1}", epoch, altitueAtTime.GetValue(1))
        End If
        System.Threading.Interlocked.Increment(i)
    End While
End If

CoClasses that Implement IAgCrdnEventArray

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1