STK Vector Geometry ToolSend comments on this topic.
IAgCrdnEvent Interface

Description

Defines an event (time instant).

Public Methods

Public Method FindOccurrenceReturn computed time instance if it occurs.
Public Method OccursBeforeReturn true if computed time instance occurs before or at specified time, return false otherwise.

Public Properties

Public Property NoonTodayReturn time instant that corresponds to today's GMT noon.
Public Property NoonTomorrowReturn time instant that corresponds to tomorrow's GMT noon.
Public Property TodayReturn time instant that corresponds to today's GMT midnight.
Public Property TomorrowReturn time instant that corresponds to tomorrow's GMT midnight.
Public Property TypeReturn the type of time instant.

Interfaces

Implemented Interface
IAgCrdn

CoClasses that Implement IAgCrdnEvent

Example

Determine if event occurs before an epoch.
[C#]
// The event you are interested in.
IAgCrdnEvent timeEvent1 = provider.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMax"];

// The reference event you want to determine if event of interest happened before.
IAgCrdnEvent timeEvent2 = provider.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMin"];
IAgCrdnEventFindOccurrenceResult occurrence2 = timeEvent2.FindOccurrence();

if (occurrence2.IsValid)
{
    if (timeEvent1.OccursBefore(occurrence2.Epoch))
    {
        Console.WriteLine("The time of maximum altitude happend before time of minimum altitude");
    }
    else
    {
        Console.WriteLine("The time of minimum altitude happend before time of maximum altitude");
    }
}
Determine the time of an event.
[C#]
IAgCrdnProvider provider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt;
IAgCrdnEvent timeEvent = provider.Events["PassIntervals.First.Start"];

IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence();

if (occurrence.IsValid)
{
    Console.WriteLine("The first pass interval happened at: " + occurrence.Epoch);
}
else
{
    Console.WriteLine("The first pass interval never occurred");
}

// create a satellite with no ephem and find that there's no ocurrence of PassIntervals.First.Start
IAgStkObject noEphemObj = stkRoot.CurrentScenario.Children.New(AgESTKObjectType.eSatellite, "NoEphem_FindOccurenceTest");
IAgCrdnProvider provider2 = noEphemObj.Vgt;
IAgCrdnEvent timeEvent2 = provider2.Events["EphemerisStartTime"];
IAgCrdnEventFindOccurrenceResult occurrence2 = timeEvent2.FindOccurrence();

Assert.IsFalse(occurrence2.IsValid);

noEphemObj.Unload();
Determine if event occurs before an epoch.
[Visual Basic .NET]
' The event you are interested in.
Dim timeEvent1 As IAgCrdnEvent = provider.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMax")

' The reference event you want to determine if event of interest happened before.
Dim timeEvent2 As IAgCrdnEvent = provider.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMin")
Dim occurrence2 As IAgCrdnEventFindOccurrenceResult = timeEvent2.FindOccurrence()

If occurrence2.IsValid Then
	If timeEvent1.OccursBefore(occurrence2.Epoch) Then
		Console.WriteLine("The time of maximum altitude happend before time of minimum altitude")
	Else
		Console.WriteLine("The time of minimum altitude happend before time of maximum altitude")
	End If
End If
Determine the time of an event.
[Visual Basic .NET]
Dim provider As IAgCrdnProvider = stkRoot.GetObjectFromPath("Satellite/LEO").Vgt
Dim timeEvent As IAgCrdnEvent = provider.Events("PassIntervals.First.Start")

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()

If occurrence.IsValid Then
	Console.WriteLine("The first pass interval happened at: " + occurrence.Epoch)
Else
	Console.WriteLine("The first pass interval never occurred")
End If

' create a satellite with no ephem and find that there's no ocurrence of PassIntervals.First.Start
Dim noEphemObj As IAgStkObject = stkRoot.CurrentScenario.Children.[New](AgESTKObjectType.eSatellite, "NoEphem_FindOccurenceTest")
Dim provider2 As IAgCrdnProvider = noEphemObj.Vgt
Dim timeEvent2 As IAgCrdnEvent = provider2.Events("EphemerisStartTime")
Dim occurrence2 As IAgCrdnEventFindOccurrenceResult = timeEvent2.FindOccurrence()

Assert.IsFalse(occurrence2.IsValid)

noEphemObj.Unload()
© 2024 Analytical Graphics, Inc. All Rights Reserved.