STK Vector Geometry ToolSend comments on this topic.
IAgCrdnEventIntervalFactory Interface

Description

The factory creates event intervals.

Public Methods

Public Method CreateCreate and register an interval using specified name, description, and type.
Public Method CreateEventIntervalBetweenTimeInstantsCreate an interval using specified start and stop time instants.
Public Method CreateEventIntervalFixedCreate an interval defined between two explicitly specified start and stop times.
Public Method CreateEventIntervalFixedDurationCreate an interval of fixed duration specified using start and stop offsets relative to specified reference time instant.
Public Method CreateEventIntervalFromIntervalListCreate an interval from a specified interval list by using one of several selection methods.
Public Method CreateEventIntervalScaledCreate an interval by scaling an original interval using either absolute or relative scale.
Public Method CreateEventIntervalSignaledCreate an interval that is recorded at target clock location by performing signal transmission of original interval between base and target clock locations.
Public Method CreateEventIntervalTimeOffsetCreate an interval defined by shifting the specified reference interval by a fixed time offset.
Public Method IsTypeSupportedReturns whether the specified type is supported.

Example

Determine if the specified event interval type is supported.
[C#]
// Check if the specified event interval type is supported.
if (provider.EventIntervals.Factory.IsTypeSupported(eventIntervalType))
{
    //Create an EventInterval with the supported Type
    IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.Create(
        "MyEventInterval", string.Empty,
        eventIntervalType);
}
Create and configure event interval between two instants.
[C#]
IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.CreateEventIntervalBetweenTimeInstants("MyIntervalBetweenTwoInstants",  "MyDescription");
IAgCrdnEventIntervalBetweenTimeInstants asTimeInstant = eventInterval as IAgCrdnEventIntervalBetweenTimeInstants;

asTimeInstant.StartTimeInstant = provider.Events["EphemerisStartTime"];
asTimeInstant.StopTimeInstant = provider.Events["EphemerisStopTime"];

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure fixed duration event interval.
[C#]
IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.CreateEventIntervalFixedDuration("MyIntervalFixedDuration",  "MyDescription");
IAgCrdnEventIntervalFixedDuration asFixedDuration = eventInterval as IAgCrdnEventIntervalFixedDuration;

asFixedDuration.ReferenceTimeInstant = provider.Events["AvailabilityStartTime"];

// Uses current Time unit preference, this code snippet assumes seconds.
asFixedDuration.StartOffset = 10;

// Uses current Time unit preference, this code snippet assumes seconds.
asFixedDuration.StopOffset = 360;

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure fixed event interval.
[C#]
IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.CreateEventIntervalFixed("MyIntervalFixed",  "MyDescription");
IAgCrdnEventIntervalFixed asFixed = eventInterval as IAgCrdnEventIntervalFixed;

asFixed.SetInterval(
    provider.Events["AvailabilityStartTime"].FindOccurrence().Epoch,
    provider.Events["AvailabilityStopTime"].FindOccurrence().Epoch);

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure time offset event interval.
[C#]
IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.CreateEventIntervalTimeOffset("MyIntervalFixedTimeOffset",  "MyDescription");
IAgCrdnEventIntervalTimeOffset asFixedTimeOffset = eventInterval as IAgCrdnEventIntervalTimeOffset;

asFixedTimeOffset.ReferenceInterval = provider.EventIntervals["AvailabilityTimeSpan"];

// Uses current Time unit preference, this code snippet assumes seconds.
asFixedTimeOffset.TimeOffset = 30;

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure event interval from an interval list.
[C#]
IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.CreateEventIntervalFromIntervalList("MyIntervalList",  "MyDescription");
IAgCrdnEventIntervalFromIntervalList asIntervalList = eventInterval as IAgCrdnEventIntervalFromIntervalList;

asIntervalList.ReferenceIntervals = provider.EventIntervalLists["AttitudeIntervals"];
asIntervalList.IntervalSelection = AgECrdnIntervalSelection.eCrdnIntervalSelectionMaxGap;

// Or from start
asIntervalList.IntervalSelection = AgECrdnIntervalSelection.eCrdnIntervalSelectionFromStart;
asIntervalList.IntervalNumber = 1;

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure scaled event interval.
[C#]
IAgCrdnEventInterval eventInterval = provider.EventIntervals.Factory.CreateEventIntervalScaled("MyIntervalScaled",  "MyDescription");
IAgCrdnEventIntervalScaled asScaled = eventInterval as IAgCrdnEventIntervalScaled;

asScaled.OriginalInterval = provider.EventIntervals["AvailabilityTimeSpan"];

asScaled.AbsoluteIncrement = 30;

// Or use Relative
asScaled.UseAbsoluteIncrement = false;
asScaled.RelativeIncrement = 45; // Percentage

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure signaled event interval.
[C#]
IAgCrdnProvider satelliteVgtProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt;
IAgCrdnProvider aircraftVgtProvider = stkRoot.GetObjectFromPath("Aircraft/UAV").Vgt;

IAgCrdnEventInterval eventInterval = satelliteVgtProvider.EventIntervals.Factory.CreateEventIntervalSignaled("MyIntervalSignaled",  "MyDescription");
IAgCrdnEventIntervalSignaled asSignaled = eventInterval as IAgCrdnEventIntervalSignaled;

asSignaled.OriginalInterval = aircraftVgtProvider.EventIntervals["AvailabilityTimeSpan"];
asSignaled.BaseClockLocation = satelliteVgtProvider.Points["Center"];
asSignaled.TargetClockLocation = aircraftVgtProvider.Points["Center"];

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

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

IAgCrdnEventIntervalResult intervalResult = eventInterval.FindInterval();
if (intervalResult.IsValid)
{
    Console.WriteLine("Interval Start: " + intervalResult.Interval.Start);
    Console.WriteLine("Interval Stop: " + intervalResult.Interval.Stop);
}
Create and configure event interval between two instants.
[Visual Basic .NET]
Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.CreateEventIntervalBetweenTimeInstants("MyIntervalBetweenTwoInstants", "MyDescription")
Dim asTimeInstant As IAgCrdnEventIntervalBetweenTimeInstants = TryCast(eventInterval, IAgCrdnEventIntervalBetweenTimeInstants)

asTimeInstant.StartTimeInstant = provider.Events("EphemerisStartTime")
asTimeInstant.StopTimeInstant = provider.Events("EphemerisStopTime")

Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Create and configure fixed duration event interval.
[Visual Basic .NET]
Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.CreateEventIntervalFixedDuration("MyIntervalFixedDuration", "MyDescription")
Dim asFixedDuration As IAgCrdnEventIntervalFixedDuration = TryCast(eventInterval, IAgCrdnEventIntervalFixedDuration)

asFixedDuration.ReferenceTimeInstant = provider.Events("AvailabilityStartTime")

' Uses current Time unit preference, this code snippet assumes seconds.
asFixedDuration.StartOffset = 10

' Uses current Time unit preference, this code snippet assumes seconds.
asFixedDuration.StopOffset = 360

Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Create and configure fixed event interval.
[Visual Basic .NET]
Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.CreateEventIntervalFixed("MyIntervalFixed", "MyDescription")
Dim asFixed As IAgCrdnEventIntervalFixed = TryCast(eventInterval, IAgCrdnEventIntervalFixed)

asFixed.SetInterval(provider.Events("AvailabilityStartTime").FindOccurrence().Epoch, provider.Events("AvailabilityStopTime").FindOccurrence().Epoch)

Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Create and configure time offset event interval.
[Visual Basic .NET]
Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.CreateEventIntervalTimeOffset("MyIntervalFixedTimeOffset", "MyDescription")
Dim asFixedTimeOffset As IAgCrdnEventIntervalTimeOffset = TryCast(eventInterval, IAgCrdnEventIntervalTimeOffset)

asFixedTimeOffset.ReferenceInterval = provider.EventIntervals("AvailabilityTimeSpan")

' Uses current Time unit preference, this code snippet assumes seconds.
asFixedTimeOffset.TimeOffset = 30

Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Create and configure event interval from an interval list.
[Visual Basic .NET]
Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.CreateEventIntervalFromIntervalList("MyIntervalList", "MyDescription")
Dim asIntervalList As IAgCrdnEventIntervalFromIntervalList = TryCast(eventInterval, IAgCrdnEventIntervalFromIntervalList)

asIntervalList.ReferenceIntervals = provider.EventIntervalLists("AttitudeIntervals")
asIntervalList.IntervalSelection = AgECrdnIntervalSelection.eCrdnIntervalSelectionMaxGap

' Or from start
asIntervalList.IntervalSelection = AgECrdnIntervalSelection.eCrdnIntervalSelectionFromStart
asIntervalList.IntervalNumber = 1

Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Create and configure scaled event interval.
[Visual Basic .NET]
Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.CreateEventIntervalScaled("MyIntervalScaled", "MyDescription")
Dim asScaled As IAgCrdnEventIntervalScaled = TryCast(eventInterval, IAgCrdnEventIntervalScaled)

asScaled.OriginalInterval = provider.EventIntervals("AvailabilityTimeSpan")

asScaled.AbsoluteIncrement = 30

' Or use Relative
asScaled.UseAbsoluteIncrement = False
asScaled.RelativeIncrement = 45
' Percentage
Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Create and configure signaled event interval.
[Visual Basic .NET]
Dim satelliteVgtProvider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt
Dim aircraftVgtProvider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Aircraft/UAV").Vgt

Dim eventInterval As IAgCrdnEventInterval = satelliteVgtProvider.EventIntervals.Factory.CreateEventIntervalSignaled("MyIntervalSignaled", "MyDescription")
Dim asSignaled As IAgCrdnEventIntervalSignaled = TryCast(eventInterval, IAgCrdnEventIntervalSignaled)

asSignaled.OriginalInterval = aircraftVgtProvider.EventIntervals("AvailabilityTimeSpan")
asSignaled.BaseClockLocation = satelliteVgtProvider.Points("Center")
asSignaled.TargetClockLocation = aircraftVgtProvider.Points("Center")

asSignaled.SignalSense = AgECrdnSignalSense.eCrdnSignalSenseReceive
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.002

Dim intervalResult As IAgCrdnEventIntervalResult = eventInterval.FindInterval()
If intervalResult.IsValid Then
	Console.WriteLine("Interval Start: " + intervalResult.Interval.Start)
	Console.WriteLine("Interval Stop: " + intervalResult.Interval.[Stop])
End If
Determine if the specified event interval type is supported.
[Visual Basic .NET]
' Check if the specified event interval type is supported.
If provider.EventIntervals.Factory.IsTypeSupported(eventIntervalType) Then
	'Create an EventInterval with the supported Type
	Dim eventInterval As IAgCrdnEventInterval = provider.EventIntervals.Factory.Create("MyEventInterval", String.Empty, eventIntervalType)
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.