STK Vector Geometry ToolSend comments on this topic.
IAgCrdnEventFactory Interface

Description

The factory creates events.

Public Methods

Public Method CreateCreates and registers an event using specified name, description, and type.
Public Method CreateEventEpochCreates an event set at a specified date/time.
Public Method CreateEventExtremumCreates an event that determines the time of global minimum or maximum of specified scalar calculation.
Public Method CreateEventSignaledCreates an event recorded on a specified clock via signal transmission from an original time instant recorded on different clock.
Public Method CreateEventStartStopTimeCreates an event that is either the start or stop time selected from a reference interval.
Public Method CreateEventTimeOffsetCreates an event at fixed offset from specified reference event.
Public Method CreateSmartEpochFromEventCreates a smart epoch from an event.
Public Method CreateSmartEpochFromTimeCreates a smart epoch from STK epoch.
Public Method IsTypeSupportedReturns whether the specified type is supported.

Public Properties

Public Property TodayReturns Today time instant.
Public Property TomorrowReturns Tomorrow time instant.

Example

Determine if the specified event type is supported.
[C#]
// Check if the specified event type is supported.
if (provider.Events.Factory.IsTypeSupported(eventType))
{
    //Create an Event with the supported Type
    IAgCrdnEvent @event = provider.Events.Factory.Create(
        "MyEvent", string.Empty,
        eventType);
}
Create and configure fixed epoch event.
[C#]
IAgCrdnEvent timeEvent = provider.Events.Factory.CreateEventEpoch("MyEventFixed", "MyDescription");
IAgCrdnEventEpoch asEpoch = timeEvent as IAgCrdnEventEpoch;

// Epoch can be set explicitly (Uses current DateTime unit preference, this code snippet assumes UTCG)
asEpoch.Epoch = "1 May 2016 04:00:00.000";

// Epoch can also be set with the epoch of another event
IAgCrdnEventFindOccurrenceResult startTime = provider.Events["AvailabilityStartTime"].FindOccurrence();
asEpoch.Epoch = startTime.Epoch;

IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence();
if (occurrence.IsValid)
{
    Console.WriteLine("Event occurred at: " + occurrence.Epoch);
}
Create and configure fixed time offset event.
[C#]
IAgCrdnEvent timeEvent = provider.Events.Factory.CreateEventTimeOffset("MyEventTimeOffset", "MyDescription");
IAgCrdnEventTimeOffset asTimeOffset = timeEvent as IAgCrdnEventTimeOffset;

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

// Uses current Time unit preference, this code snippet assumes seconds.
asTimeOffset.TimeOffset2 = 3;

IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence();
if (occurrence.IsValid)
{
    Console.WriteLine("Event occurred at: " + occurrence.Epoch);
}
Create and configure signaled event.
[C#]
IAgCrdnProvider satelliteVgtProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt;
IAgCrdnProvider aircraftVgtProvider = stkRoot.GetObjectFromPath("Aircraft/UAV").Vgt;

IAgCrdnEvent timeEvent = satelliteVgtProvider.Events.Factory.CreateEventSignaled("MyEventSignaled", "MyDescription");
IAgCrdnEventSignaled asSignaled = timeEvent as IAgCrdnEventSignaled;

asSignaled.OriginalTimeInstant = aircraftVgtProvider.Events["EphemerisStartTime"];
asSignaled.BaseClockLocation = satelliteVgtProvider.Points["Center"];
asSignaled.TargetClockLocation = aircraftVgtProvider.Points["Center"];

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

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

IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence();
if (occurrence.IsValid)
{
    Console.WriteLine("Event occurred at: " + occurrence.Epoch);
}
Create and configure start stop time event.
[C#]
IAgCrdnEvent timeEvent = provider.Events.Factory.CreateEventStartStopTime("MyEventStartStopTime", "MyDescription");
IAgCrdnEventStartStopTime asStartStopTime = timeEvent as IAgCrdnEventStartStopTime;

asStartStopTime.ReferenceEventInterval = provider.EventIntervals["EphemerisTimeSpan"];

asStartStopTime.UseStart = true;

IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence();
if (occurrence.IsValid)
{
    Console.WriteLine("Event occurred at: " + occurrence.Epoch);
}
Create and configure extremum event.
[C#]
IAgCrdnEvent timeEvent = provider.Events.Factory.CreateEventExtremum("MyEventExtremum", "MyDescription");
IAgCrdnEventExtremum asExtremum = timeEvent as IAgCrdnEventExtremum;

// For instance, time at highest altitude
asExtremum.Calculation = provider.CalcScalars["GroundTrajectory.Detic.LLA.Altitude"];
asExtremum.ExtremumType = AgECrdnExtremumConstants.eCrdnExtremumMaximum;

IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence();
if (occurrence.IsValid)
{
    Console.WriteLine("Event occurred at: " + occurrence.Epoch);
}
Create and configure fixed epoch event.
[Visual Basic .NET]
Dim timeEvent As IAgCrdnEvent = provider.Events.Factory.CreateEventEpoch("MyEventFixed", "MyDescription")
Dim asEpoch As IAgCrdnEventEpoch = TryCast(timeEvent, IAgCrdnEventEpoch)

' Epoch can be set explicitly (Uses current DateTime unit preference, this code snippet assumes UTCG)
asEpoch.Epoch = "1 May 2016 04:00:00.000"

' Epoch can also be set with the epoch of another event
Dim startTime As IAgCrdnEventFindOccurrenceResult = provider.Events("AvailabilityStartTime").FindOccurrence()
asEpoch.Epoch = startTime.Epoch

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
	Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If
Create and configure fixed time offset event.
[Visual Basic .NET]
Dim timeEvent As IAgCrdnEvent = provider.Events.Factory.CreateEventTimeOffset("MyEventTimeOffset", "MyDescription")
Dim asTimeOffset As IAgCrdnEventTimeOffset = TryCast(timeEvent, IAgCrdnEventTimeOffset)

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

' Uses current Time unit preference, this code snippet assumes seconds.
asTimeOffset.TimeOffset2 = 3

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
	Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If
Create and configure signaled event.
[Visual Basic .NET]
Dim satelliteVgtProvider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt
Dim aircraftVgtProvider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Aircraft/UAV").Vgt

Dim timeEvent As IAgCrdnEvent = satelliteVgtProvider.Events.Factory.CreateEventSignaled("MyEventSignaled", "MyDescription")
Dim asSignaled As IAgCrdnEventSignaled = TryCast(timeEvent, IAgCrdnEventSignaled)

asSignaled.OriginalTimeInstant = aircraftVgtProvider.Events("EphemerisStartTime")
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.eCrdnCustomTransmissionSpeed

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

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
	Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If
Create and configure start stop time event.
[Visual Basic .NET]
Dim timeEvent As IAgCrdnEvent = provider.Events.Factory.CreateEventStartStopTime("MyEventStartStopTime", "MyDescription")
Dim asStartStopTime As IAgCrdnEventStartStopTime = TryCast(timeEvent, IAgCrdnEventStartStopTime)

asStartStopTime.ReferenceEventInterval = provider.EventIntervals("EphemerisTimeSpan")

asStartStopTime.UseStart = True

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
	Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If
Create and configure extremum event.
[Visual Basic .NET]
Dim timeEvent As IAgCrdnEvent = provider.Events.Factory.CreateEventExtremum("MyEventExtremum", "MyDescription")
Dim asExtremum As IAgCrdnEventExtremum = TryCast(timeEvent, IAgCrdnEventExtremum)

' For instance, time at highest altitude
asExtremum.Calculation = provider.CalcScalars("GroundTrajectory.Detic.LLA.Altitude")
asExtremum.ExtremumType = AgECrdnExtremumConstants.eCrdnExtremumMaximum

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
	Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If
Determine if the specified event type is supported.
[Visual Basic .NET]
' Check if the specified event type is supported.
If provider.Events.Factory.IsTypeSupported(eventType) Then
	'Create an Event with the supported Type
	Dim [event] As IAgCrdnEvent = provider.Events.Factory.Create("MyEvent", String.Empty, eventType)
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.