AGI STK VGT 11 Send comments on this topic.
Occurred Method (IAgCrdnEventInterval)
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 computed interval if it exists.

Syntax

[Visual Basic .NET]
Public Function Occurred( _
   ByVal Epoch As System.Object _
) As Boolean

[C#]
public bool Occurred(
System.Object Epoch
);

[Managed C++]
public: bool Occurred(
VARIANT Epoch
);

[Java]
public bool occurred(
Variant Epoch
);

[Unmanaged C++]
public: HRESULT Occurred(
VARIANT Epoch,
VARIANT_BOOL * 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 event occurred in interval.
[C#] Copy Code
// The event you are interested in. 
IAgCrdnEventInterval timeEventInterval = provider.EventIntervals["LightingIntervals.Sunlight.First"]; 
 
// The reference event you want to determine if event occurred in the interval. 
IAgCrdnEvent timeEvent = provider.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMax"]; 
IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence(); 
 
if (occurrence.IsValid) 

    if (timeEventInterval.Occurred(occurrence.Epoch)) 
    { 
        Console.WriteLine("Our highest altitude was reached on the first lighting pass"); 
    } 
    else 
    { 
        Console.WriteLine("Our highest altitude was not reached on the first lighting pass"); 
    } 

 

Determine if event occurred in interval.
[Visual Basic .NET] Copy Code
' The event you are interested in.
Dim timeEventInterval As IAgCrdnEventInterval = provider.EventIntervals("LightingIntervals.Sunlight.First")

' The reference event you want to determine if event occurred in the interval.
Dim timeEvent As IAgCrdnEvent = provider.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMax")
Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()

If occurrence.IsValid Then
    If timeEventInterval.Occurred(occurrence.Epoch) Then
        Console.WriteLine("Our highest altitude was reached on the first lighting pass")
    Else
        Console.WriteLine("Our highest altitude was not reached on the first lighting pass")
    End If
End If

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1