AGI STK VGT 11 Send comments on this topic.
Occurred Method (IAgCrdnEventIntervalCollection)
See Also  Example
Epoch
Specify an epoch. The method may throw an exception if the epoch parameter specified cannot be converted to a currently selected date unit.





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
);

[Java]
public IAgCrdnEventIntervalCollectionOccurredResult occurred(
Variant Epoch
);

[Unmanaged C++]
public: HRESULT Occurred(
VARIANT Epoch,
IAgCrdnEventIntervalCollectionOccurredResult ** ReturnValue
);

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.

Example

Determine if epoch occurred in interval collection.
[C#] Copy Code
IAgCrdnEventIntervalCollection intervalVectorCollection = provider.EventIntervalCollections["LightingIntervals"]; 
 
IAgCrdnEventIntervalCollectionOccurredResult occurredResult = intervalVectorCollection.Occurred("1 May 2015 04:30:00.000"); 
 
if (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]; 

 

Determine if epoch occurred in interval collection.
[Visual Basic .NET] Copy Code
Dim intervalVectorCollection As IAgCrdnEventIntervalCollection = provider.EventIntervalCollections("LightingIntervals")

Dim occurredResult As IAgCrdnEventIntervalCollectionOccurredResult = intervalVectorCollection.Occurred("1 May 2015 04:30:00.000")

If occurredResult.IsValid Then
    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)
End If

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1