STK Vector Geometry ToolSend comments on this topic.
IAgCrdnEventArrayFactory Interface

Description

The factory creates event arrays.

Public Methods

Public Method CreateCreate and register an event array using specified name, description, and type.
Public Method CreateEventArrayConditionCrossingsCreate an event array containing times at which the specified condition will change its satisfaction status.
Public Method CreateEventArrayExtremaCreate an event array by determining times of local minimum and/or maximum of specified scalar calculation.
Public Method CreateEventArrayFilteredCreate an event array by filtering times from an original time array according to specified filtering method.
Public Method CreateEventArrayFixedStepCreate an event array using fixed time steps from the specified time reference and adding sampled times to array if they fall within specified bounding interval list.
Public Method CreateEventArrayFixedTimesCreate an event array using specified times.
Public Method CreateEventArrayMergedCreate an event array by merging times from two other arrays by creating a union of bounding intervals from two constituent arrays.
Public Method CreateEventArraySignaledCreate an event array recorded at target clock location by performing signal transmission of original time array between base and target clock locations.
Public Method CreateEventArrayStartStopTimesCreate an event array by taking start and/or stop times of every interval in the specified reference interval list and adding them to array.
Public Method IsTypeSupportedReturns whether the specified type is supported.

Example

Determine if the specified event array type is supported.
[C#]
// Check if the specified event array type is supported.
if (provider.EventArrays.Factory.IsTypeSupported(eventArrayType))
{
    //Create an EventArray with the supported Type
    IAgCrdnEventArray eventArray = provider.EventArrays.Factory.Create(
        "MyEventArray", string.Empty,
        eventArrayType);
}
Create and configure fixed step event array.
[C#]
IAgCrdnEventArray eventArray = provider.EventArrays.Factory.CreateEventArrayFixedStep("MyEventArrayFixedStep",  "MyDescription");
IAgCrdnEventArrayFixedStep asFixedStep = eventArray as IAgCrdnEventArrayFixedStep;

asFixedStep.BoundingIntervalList = provider.EventIntervalLists["AfterStart.SatisfactionIntervals"];
asFixedStep.IncludeIntervalEdges = true;

// Uses current Time unit preference, this code snippet assumes seconds.
asFixedStep.SamplingTimeStep = 240;
asFixedStep.ReferenceType = AgECrdnSampledReferenceTime.eCrdnSampledReferenceTimeStartOfIntervalList;

// or using time instants
asFixedStep.ReferenceType = AgECrdnSampledReferenceTime.eCrdnSampledReferenceTimeReferenceEvent;
asFixedStep.ReferenceTimeInstant = provider.Events["EphemerisStartTime"];

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.
[C#]
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 signaled event array.
[C#]
IAgCrdnProvider satelliteVgtProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt;
IAgCrdnProvider aircraftVgtProvider = stkRoot.GetObjectFromPath("Aircraft/UAV").Vgt;

IAgCrdnEventArray eventArray = satelliteVgtProvider.EventArrays.Factory.CreateEventArraySignaled("MyEventArraySignaled",  "MyDescription");
IAgCrdnEventArraySignaled asSignaled = eventArray as IAgCrdnEventArraySignaled;

asSignaled.OriginalTimeArray = aircraftVgtProvider.EventArrays["OneMinuteSampleTimes"];
asSignaled.BaseClockLocation = satelliteVgtProvider.Points["Center"];
asSignaled.TargetClockLocation = aircraftVgtProvider.Points["Center"];

asSignaled.SignalSense = AgECrdnSignalSense.eCrdnSignalSenseTransmit;
IAgCrdnSignalDelayBasic basicSignalDelay = asSignaled.SignalDelay as IAgCrdnSignalDelayBasic;
basicSignalDelay.SpeedOption = AgECrdnSpeedOptions.eCrdnLightTransmissionSpeed;

// Uses current Time unit preference, this code snippet assumes seconds.
basicSignalDelay.TimeDelayConvergence = 0.01;

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 start stop times event array.
[C#]
IAgCrdnEventArray eventArray = provider.EventArrays.Factory.CreateEventArrayStartStopTimes("MyEventArrayStartStopTimes",  "MyDescription");
IAgCrdnEventArrayStartStopTimes asStartStopTimes = eventArray as IAgCrdnEventArrayStartStopTimes;

asStartStopTimes.ReferenceIntervals = provider.EventIntervalLists["LightingIntervals.Sunlight"];
asStartStopTimes.StartStopOption = AgECrdnStartStopOption.eCrdnStartStopOptionCountStartOnly;

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 condition crossings event array.
[C#]
IAgCrdnEventArray eventArray = provider.EventArrays.Factory.CreateEventArrayConditionCrossings("MyEventArrayConditionCrossings", "MyDescription");
IAgCrdnEventArrayConditionCrossings asConditionCrossings = eventArray as IAgCrdnEventArrayConditionCrossings;

IAgCrdnCondition scalarBound = provider.Conditions.Factory.CreateConditionScalarBounds("Bound", "MyDescription");
IAgCrdnConditionScalarBounds asScalarBounds = scalarBound as IAgCrdnConditionScalarBounds;
asScalarBounds.Scalar = provider.CalcScalars["GroundTrajectory.Detic.LLA.Latitude"];
asScalarBounds.Operation = AgECrdnConditionThresholdOption.eCrdnConditionThresholdOptionInsideMinMax;
//asScalarBounds.Set(-0.349, 0);

asConditionCrossings.Condition = scalarBound;

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 extrema event array.
[C#]
IAgCrdnEventArray eventArray = provider.EventArrays.Factory.CreateEventArrayExtrema("MyEventArrayExtrema",  "MyDescription");
IAgCrdnEventArrayExtrema asExtrema = eventArray as IAgCrdnEventArrayExtrema;

asExtrema.Calculation = provider.CalcScalars["GroundTrajectory.Detic.LLA.Altitude"];

asExtrema.IsGlobal = true;
asExtrema.ExtremumType = AgECrdnExtremumConstants.eCrdnExtremumMaximum;

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 fixed step event array.
[Visual Basic .NET]
Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.CreateEventArrayFixedStep("MyEventArrayFixedStep", "MyDescription")
Dim asFixedStep As IAgCrdnEventArrayFixedStep = TryCast(eventArray, IAgCrdnEventArrayFixedStep)

asFixedStep.BoundingIntervalList = provider.EventIntervalLists("AfterStart.SatisfactionIntervals")
asFixedStep.IncludeIntervalEdges = True

' Uses current Time unit preference, this code snippet assumes seconds.
asFixedStep.SamplingTimeStep = 240
asFixedStep.ReferenceType = AgECrdnSampledReferenceTime.eCrdnSampledReferenceTimeStartOfIntervalList

' or using time instants
asFixedStep.ReferenceType = AgECrdnSampledReferenceTime.eCrdnSampledReferenceTimeReferenceEvent
asFixedStep.ReferenceTimeInstant = provider.Events("EphemerisStartTime")

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
Create and configure merged event array.
[Visual Basic .NET]
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
Create and configure signaled event array.
[Visual Basic .NET]
Dim satelliteVgtProvider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt
Dim aircraftVgtProvider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Aircraft/UAV").Vgt

Dim eventArray As IAgCrdnEventArray = satelliteVgtProvider.EventArrays.Factory.CreateEventArraySignaled("MyEventArraySignaled", "MyDescription")
Dim asSignaled As IAgCrdnEventArraySignaled = TryCast(eventArray, IAgCrdnEventArraySignaled)

asSignaled.OriginalTimeArray = aircraftVgtProvider.EventArrays("OneMinuteSampleTimes")
asSignaled.BaseClockLocation = satelliteVgtProvider.Points("Center")
asSignaled.TargetClockLocation = aircraftVgtProvider.Points("Center")

asSignaled.SignalSense = AgECrdnSignalSense.eCrdnSignalSenseTransmit
Dim basicSignalDelay As IAgCrdnSignalDelayBasic = TryCast(asSignaled.SignalDelay, IAgCrdnSignalDelayBasic)
basicSignalDelay.SpeedOption = AgECrdnSpeedOptions.eCrdnLightTransmissionSpeed

' Uses current Time unit preference, this code snippet assumes seconds.
basicSignalDelay.TimeDelayConvergence = 0.01

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
Create and configure start stop times event array.
[Visual Basic .NET]
Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.CreateEventArrayStartStopTimes("MyEventArrayStartStopTimes", "MyDescription")
Dim asStartStopTimes As IAgCrdnEventArrayStartStopTimes = TryCast(eventArray, IAgCrdnEventArrayStartStopTimes)

asStartStopTimes.ReferenceIntervals = provider.EventIntervalLists("LightingIntervals.Sunlight")
asStartStopTimes.StartStopOption = AgECrdnStartStopOption.eCrdnStartStopOptionCountStartOnly

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
Create and configure condition crossings event array.
[Visual Basic .NET]
Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.CreateEventArrayConditionCrossings("MyEventArrayConditionCrossings", "MyDescription")
Dim asConditionCrossings As IAgCrdnEventArrayConditionCrossings = TryCast(eventArray, IAgCrdnEventArrayConditionCrossings)

Dim scalarBound As IAgCrdnCondition = provider.Conditions.Factory.CreateConditionScalarBounds("Bound", "MyDescription")
Dim asScalarBounds As IAgCrdnConditionScalarBounds = TryCast(scalarBound, IAgCrdnConditionScalarBounds)
asScalarBounds.Scalar = provider.CalcScalars("GroundTrajectory.Detic.LLA.Latitude")
asScalarBounds.Operation = AgECrdnConditionThresholdOption.eCrdnConditionThresholdOptionInsideMinMax
'asScalarBounds.Set(-0.349, 0);

asConditionCrossings.Condition = scalarBound

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
Create and configure extrema event array.
[Visual Basic .NET]
Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.CreateEventArrayExtrema("MyEventArrayExtrema", "MyDescription")
Dim asExtrema As IAgCrdnEventArrayExtrema = TryCast(eventArray, IAgCrdnEventArrayExtrema)

asExtrema.Calculation = provider.CalcScalars("GroundTrajectory.Detic.LLA.Altitude")

asExtrema.IsGlobal = True
asExtrema.ExtremumType = AgECrdnExtremumConstants.eCrdnExtremumMaximum

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
Determine if the specified event array type is supported.
[Visual Basic .NET]
' Check if the specified event array type is supported.
If provider.EventArrays.Factory.IsTypeSupported(eventArrayType) Then
	'Create an EventArray with the supported Type
	Dim eventArray As IAgCrdnEventArray = provider.EventArrays.Factory.Create("MyEventArray", String.Empty, eventArrayType)
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.