AGI STK Objects 11 Send comments on this topic.
IAgCvInterval Interface





Description

Coverage interval: the time period over which coverage is computed.

Public Properties

Public Property AnalysisInterval The coverage analysis interval.
Public Property Start This property is deprecated. Use AnalysisInterval instead. Beginning of the coverage interval. Uses DateFormat Dimension.
Public Property Stop This property is deprecated. Use AnalysisInterval instead. End of the coverage interval. Uses DateFormat Dimension.
Public Property UseScenarioInterval Use the scenario time period as the coverage interval.

Example

Set the coverage analysis time to the asset object time periods.
[C#] Copy Code
string currentDateFormat = stkRoot.UnitPreferences.GetCurrentUnitAbbrv("DateFormat"); 
 
// For this example, we will set the coverage analysis time to the times the asset is available. 
// Note, this doesn't handle subassets. To do that, you'll just have to iterate through the subasset list. 
IAgDate minStartTime = null
IAgDate maxStartTime = null
 
foreach (IAgCvAssetListElement cvAsset in coverage.AssetList) 

    IAgStkObject subAsset = stkRoot.GetObjectFromPath(cvAsset.ObjectName); 
    if (subAsset.Vgt.EventIntervals.Contains("AvailabilityTimeSpan")) 
    { 
        IAgCrdnEventIntervalResult availableTimeSpan = subAsset.Vgt.EventIntervals["AvailabilityTimeSpan"].FindInterval(); 
        IAgDate startDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Start.ToString()); 
        if (!(minStartTime != null) || startDate.OLEDate < minStartTime.OLEDate) 
        { 
            minStartTime = startDate; 
        } 
 
        IAgDate stopTime = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Stop.ToString()); 
        if (!(maxStartTime != null) || stopTime.OLEDate > maxStartTime.OLEDate) 
        { 
            maxStartTime = stopTime; 
        } 
    } 

 
if (minStartTime != null && maxStartTime != null

    // Now, that we have the minimum start time and the maximum stop time of the asset list, we can explicitly set the coverage analysis time. 
    coverage.Interval.AnalysisInterval.SetExplicitInterval(minStartTime.Format(currentDateFormat), maxStartTime.Format(currentDateFormat)); 

 
Console.WriteLine( 
    "Coverage Analysis Interval, StartTime = {0}, StopTime = {1}"
    coverage.Interval.AnalysisInterval.FindStartTime(), 
    coverage.Interval.AnalysisInterval.FindStopTime()); 
 

Set the coverage analysis time to the asset object time periods.
[Visual Basic .NET] Copy Code
Dim currentDateFormat As String = stkRoot.UnitPreferences.GetCurrentUnitAbbrv("DateFormat")

' For this example, we will set the coverage analysis time to the times the asset is available.
' Note, this doesn't handle subassets. To do that, you'll just have to iterate through the subasset list.
Dim minStartTime As IAgDate = Nothing
Dim maxStartTime As IAgDate = Nothing

For Each cvAsset As IAgCvAssetListElement In coverage.AssetList
    Dim subAsset As IAgStkObject = stkRoot.GetObjectFromPath(cvAsset.ObjectName)
    If subAsset.Vgt.EventIntervals.Contains("AvailabilityTimeSpan") Then
        Dim availableTimeSpan As IAgCrdnEventIntervalResult = subAsset.Vgt.EventIntervals("AvailabilityTimeSpan").FindInterval()
        Dim startDate As IAgDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Start.ToString())
        If Not (minStartTime IsNot Nothing) OrElse startDate.OLEDate < minstarttime.oledate="">Then
            minStartTime = startDate
        End If

        Dim stopTime As IAgDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.[Stop].ToString())
        If Not (maxStartTime IsNot Nothing) OrElse stopTime.OLEDate > maxStartTime.OLEDate Then
            maxStartTime = stopTime
        End If
    End If
Next

If minStartTime IsNot Nothing AndAlso maxStartTime IsNot Nothing Then
    ' Now, that we have the minimum start time and the maximum stop time of the asset list, we can explicitly set the coverage analysis time.
    coverage.Interval.AnalysisInterval.SetExplicitInterval(minStartTime.Format(currentDateFormat), maxStartTime.Format(currentDateFormat))
End If

Console.WriteLine("Coverage Analysis Interval, StartTime = {0}, StopTime = {1}", coverage.Interval.AnalysisInterval.FindStartTime(), coverage.Interval.AnalysisInterval.FindStopTime())

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1