AGI STK VGT 11 Send comments on this topic.
CreateEventArrayFiltered Method (IAgCrdnEventArrayFactory)
See Also  Example
Name
Description





Description

Create an event array by filtering times from an original time array according to specified filtering method.

Syntax

[Visual Basic .NET]
Public Function CreateEventArrayFiltered( _
   ByVal Name As String, _
   ByVal Description As String _
) As IAgCrdnEventArray

[C#]
public IAgCrdnEventArray CreateEventArrayFiltered(
string Name,
string Description
);

[Managed C++]
public: IAgCrdnEventArray^ CreateEventArrayFiltered(
String __gc ^ Name,
String __gc ^ Description
);

[Java]
public IAgCrdnEventArray createEventArrayFiltered(
String Name,
String Description
);

[Unmanaged C++]
public: HRESULT CreateEventArrayFiltered(
BSTR Name,
BSTR Description,
IAgCrdnEventArray ** ReturnValue
);

Parameters

Name
Description

Remarks

Spaces and most punctuation ( except for "-_().") cannot be used as a part of a component name when creating new components via VGT API.

Example

Create and configure filtered event array.
[C#] Copy Code
IAgCrdnEventArray eventArray = provider.EventArrays.Factory.CreateEventArrayFiltered("MyEventArrayFiltered",  "MyDescription"); 
IAgCrdnEventArrayFiltered asFiltered = eventArray as IAgCrdnEventArrayFiltered; 
 
asFiltered.OriginalTimeArray = provider.EventArrays["EphemerisTimes"]; 
 
asFiltered.FilterType = AgECrdnEventArrayFilterType.eCrdnEventArrayFilterTypeSkipTimeStep; 
asFiltered.IncludeIntervalStopTimes = true
 
// Uses current Time unit preference, this code snippet assumes seconds. 
asFiltered.Step = 240
 
IAgCrdnFindTimesResult timeArrays = eventArray.FindTimes(); 
if (timeArrays.IsValid) 

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

 

Create and configure filtered event array.
[Visual Basic .NET] Copy Code
Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.CreateEventArrayFiltered("MyEventArrayFiltered", "MyDescription")
Dim asFiltered As IAgCrdnEventArrayFiltered = TryCast(eventArray, IAgCrdnEventArrayFiltered)

asFiltered.OriginalTimeArray = provider.EventArrays("EphemerisTimes")

asFiltered.FilterType = AgECrdnEventArrayFilterType.eCrdnEventArrayFilterTypeSkipTimeStep
asFiltered.IncludeIntervalStopTimes = True

' Uses current Time unit preference, this code snippet assumes seconds.
asFiltered.[Step] = 240

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

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

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1