STK Vector Geometry ToolSend comments on this topic.
Occurred Method (IAgCrdnEventIntervalCollection)
See Also
Epoch
Specify an epoch. The method may throw an exception if the epoch parameter specified cannot be converted to a currently selected date unit.
Windows





Windows & Linux

Description

Determine if specified time falls within any of the computed interval lists in the collection.

Syntax

[Visual Basic .NET]
Public Function Occurred( _
    ByVal Epoch As System.Object _
) As IAgCrdnEventIntervalCollectionOccurredResult
[C#]
public IAgCrdnEventIntervalCollectionOccurredResult Occurred(
    System.Object Epoch
);
[Managed C++]
public: IAgCrdnEventIntervalCollectionOccurredResult^ Occurred(
    VARIANT Epoch
);
[Unmanaged C++]
public: HRESULT Occurred(
    VARIANT Epoch,
    IAgCrdnEventIntervalCollectionOccurredResult ** ppRetVal
);
[Java]
public IAgCrdnEventIntervalCollectionOccurredResult occurred(
    AgVariant Epoch
);
[Python - STK API ]
def Occurred(self, Epoch:typing.Any) -> "IAgCrdnEventIntervalCollectionOccurredResult":

Parameters

Epoch
Specify an epoch. The method may throw an exception if the epoch parameter specified cannot be converted to a currently selected date unit.

See Also

Example

Determine if epoch occurred in interval collection.
[C#]
string eventCollName = "LightingIntervals";
IAgCrdnEventIntervalCollection intervalVectorCollection = provider.EventIntervalCollections[ eventCollName];

// any time that the vehicle has ephemeris its time will occur in the LightingIntervals collection (as a sunlit, penumbra or umbra time)
string dateDuringEphem = "1 Jan 2012 20:00:00";

IAgCrdnEventIntervalCollectionOccurredResult occurredResult = intervalVectorCollection.Occurred( dateDuringEphem);

Assert.IsTrue(occurredResult.IsValid);

Console.WriteLine("Occurred at {0} index", occurredResult.Index);

// Use the index from IAgCrdnEventIntervalCollectionOccurredResult as the index to IAgCrdnIntervalsVectorResult.IntervalCollections
IAgCrdnIntervalsVectorResult intervalResult = intervalVectorCollection.FindIntervalCollection();
IAgCrdnIntervalCollection intervalCollection = intervalResult.IntervalCollections[occurredResult.Index];

string dateNotDuringEphem = "1 May 1980 04:30:00.000";
IAgCrdnEventIntervalCollectionOccurredResult occurredResult2 = intervalVectorCollection.Occurred( dateNotDuringEphem);

Assert.IsFalse(occurredResult2.IsValid);
Console.WriteLine("Did not find time {0} during eventIntervalCollection {1}'s times.", dateNotDuringEphem, eventCollName);
Determine if epoch occurred in interval collection.
[Visual Basic .NET]
Dim eventCollName As String = "LightingIntervals"
Dim intervalVectorCollection As IAgCrdnEventIntervalCollection = provider.EventIntervalCollections(eventCollName)

' any time that the vehicle has ephemeris its time will occur in the LightingIntervals collection (as a sunlit, penumbra or umbra time)
Dim dateDuringEphem As String = "1 Jan 2012 20:00:00"

Dim occurredResult As IAgCrdnEventIntervalCollectionOccurredResult = intervalVectorCollection.Occurred(dateDuringEphem)

Assert.IsTrue(occurredResult.IsValid)

Console.WriteLine("Occurred at {0} index", occurredResult.Index)

' Use the index from IAgCrdnEventIntervalCollectionOccurredResult as the index to IAgCrdnIntervalsVectorResult.IntervalCollections
Dim intervalResult As IAgCrdnIntervalsVectorResult = intervalVectorCollection.FindIntervalCollection()
Dim intervalCollection As IAgCrdnIntervalCollection = intervalResult.IntervalCollections(occurredResult.Index)

Dim dateNotDuringEphem As String = "1 May 1980 04:30:00.000"
Dim occurredResult2 As IAgCrdnEventIntervalCollectionOccurredResult = intervalVectorCollection.Occurred(dateNotDuringEphem)

Assert.IsFalse(occurredResult2.IsValid)
Console.WriteLine("Did not find time {0} during eventIntervalCollection {1}'s times.", dateNotDuringEphem, eventCollName)
© 2024 Analytical Graphics, Inc. All Rights Reserved.