AGI STK VGT 11 Send comments on this topic.
OccursBefore Method (IAgCrdnEvent)
See Also  Example
Epoch
A time specified in seconds since scenario epoch.





Description

Return true if computed time instance occurs before or at specified time, return false otherwise.

Syntax

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

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

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

[Java]
public bool occursBefore(
Variant Epoch
);

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

Parameters

Epoch
A time specified in seconds since scenario epoch.

Example

Determine if event occurs before an epoch.
[C#] Copy Code
// 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 if event occurs before an epoch.
[Visual Basic .NET] Copy Code
' 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

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1