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






Windows & Linux

Description

Create an event array by merging times from two other arrays by creating a union of bounding intervals from two constituent arrays.

Syntax

[Visual Basic .NET]
Public Function CreateEventArrayMerged( _
   ByVal Name As String, _
   ByVal Description As String _
) As IAgCrdnEventArray
[C#]
public IAgCrdnEventArray CreateEventArrayMerged(
   string Name,
   string Description
);
[Managed C++]
public: IAgCrdnEventArray^ CreateEventArrayMerged(
   String __gc ^ Name,
   String __gc ^ Description
);
[Java]
public IAgCrdnEventArray createEventArrayMerged(
   String Name,
   String Description
);
[Unmanaged C++]
public: HRESULT CreateEventArrayMerged(
   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 merged event array.
[C#]Copy Code
IAgCrdnEventArray eventArray = provider.EventArrays.Factory.CreateEventArrayMerged("MyEventArrayMerged",  "MyDescription"); 
IAgCrdnEventArrayMerged asMerged = eventArray as IAgCrdnEventArrayMerged; 
 
asMerged.TimeArrayA = provider.EventArrays["GroundTrajectory.Detic.LLA.Altitude.TimesOfLocalMin"]; 
asMerged.TimeArrayB = provider.EventArrays["GroundTrajectory.Detic.LLA.Altitude.TimesOfLocalMax"]; 
 
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 merged event array.
[Visual Basic .NET]Copy Code
Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.CreateEventArrayMerged("MyEventArrayMerged", "MyDescription")
Dim asMerged As IAgCrdnEventArrayMerged = TryCast(eventArray, IAgCrdnEventArrayMerged)

asMerged.TimeArrayA = provider.EventArrays("GroundTrajectory.Detic.LLA.Altitude.TimesOfLocalMin")
asMerged.TimeArrayB = provider.EventArrays("GroundTrajectory.Detic.LLA.Altitude.TimesOfLocalMax")

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

© 2018 Analytical Graphics, Inc. All Rights Reserved.