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





Description

Provides access to the Data Providers on an ObjectCoverage Object.

Object Model




Public Methods

Public Method Clear Removes the computation on the object coverage.
Public Method ClearCoverage Clear object coverage.
Public Method Compute Computes the object coverage.

Public Properties

Public Property AccessInterval The object coverage's access interval.
Public Property Assets The asset list collection.
Public Property DataProviders Returns the object representing a list of available data providers for the object.
Public Property FOM The figure of merit on the object coverage.
Public Property IsCoverageConfigurationSaved Save the single-object coverage definitions when the scenario is saved to disk, if a compute has been done.
Public Property StartTime The start time of object coverage. Uses DateFormat Dimension.
Public Property StopTime The stop time of object coverage. Uses DateFormat Dimension.
Public Property UseObjectTimes Use object interval times.

Example

Execute an object coverage data provider and dump its result
[C#] Copy Code
IAgStkObject aircraft = root.CurrentScenario.Children["aircraft340"]; 
 
IAgStkObjectCoverage objectCoverage = aircraft.ObjectCoverage; 
objectCoverage.Clear(); 
objectCoverage.Assets.Add("Constellation/gps_const"); 
objectCoverage.Compute(); 
 
IAgDataPrvTimeVar provider = objectCoverage.DataProviders["FOM by Time"as IAgDataPrvTimeVar; 
 
IAgDrResult result = provider.Exec("1 Jan 2012 12:00:00.00""1 Jan 2012 13:00:00.00"1); 
 
foreach (IAgDrSubSection section in result.Sections) 

    foreach (IAgDrInterval interval in section.Intervals) 
    { 
        Array arBoundaries = new object[] 
                             { 
                                 1.02.03.04.05.0 
                             }; 
 
        // MultipleThresholdCrossings expects the second parameter 
        // to be a one demensional array of boundary index values 
        Array arRanges = interval.MultipleThresholdCrossings("FOM Value"ref arBoundaries); 
 
        for (int iRange = 0; iRange < arRanges.GetLength(0); iRange++) 
        { 
            Console.Write("\nRange: {0}\n", iRange); 
 
            Array arTimeSpans = arRanges.GetValue(iRange) as Array
            for (int iSpan = 0; iSpan < arTimeSpans.GetLength(0); iSpan++) 
            { 
                string strStart = arTimeSpans.GetValue(iSpan, 0).ToString(); 
                string strStop = arTimeSpans.GetValue(iSpan, 1).ToString(); 
 
                Console.Write("Start: {0}    Stop: {1}\n", strStart, strStop); 
            } 
        } 
    } 

 

Sets the interval of the object coverage to the sunlight times of an object
[C#] Copy Code
// For this example, set the access times to use the light intervals of the area target. 
IAgStkObject uavAircraft = root.GetObjectFromPath("Aircraft/UAV/Sensor/UAV_Camera"); 
IAgStkObject airspaceAreaTarget = root.GetObjectFromPath("AreaTarget/Airspace"); 
 
IAgCrdnEvent firstSunlightEpoch = airspaceAreaTarget.Vgt.Events["LightingIntervals.Sunlight.First.Start"]; 
IAgCrdnEvent lastSunlightEpoch = airspaceAreaTarget.Vgt.Events["LightingIntervals.Sunlight.First.Stop"]; 
 
uavAircraft.ObjectCoverage.UseObjectTimes = false
IAgCrdnEventSmartEpoch startEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStartEpoch(); 
startEpoch.SetImplicitTime(firstSunlightEpoch); 
 
IAgCrdnEventSmartEpoch stopEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStopEpoch(); 
stopEpoch.SetImplicitTime(lastSunlightEpoch); 
 
uavAircraft.ObjectCoverage.AccessInterval.SetStartAndStopEpochs(startEpoch, stopEpoch); 
 

Execute an object coverage data provider and dump its result
[Visual Basic .NET] Copy Code
Dim aircraft As IAgStkObject = root.CurrentScenario.Children("aircraft340")

Dim objectCoverage As IAgStkObjectCoverage = aircraft.ObjectCoverage
objectCoverage.Clear()
objectCoverage.Assets.Add("Constellation/gps_const")
objectCoverage.Compute()

Dim provider As IAgDataPrvTimeVar = TryCast(objectCoverage.DataProviders("FOM by Time"), IAgDataPrvTimeVar)

Dim result As IAgDrResult = provider.Exec("1 Jan 2012 12:00:00.00", "1 Jan 2012 13:00:00.00", 1)

For Each section As IAgDrSubSection In result.Sections
    For Each interval As IAgDrInterval In section.Intervals
        #If Not CSToJava Then
        #Else
        #End If
        Dim arBoundaries As Array = New Object() {1, 2, 3, 4, 5}

        ' MultipleThresholdCrossings expects the second parameter
        ' to be a one demensional array of boundary index values
        #If Not CSToJava Then
        Dim arRanges As Array = interval.MultipleThresholdCrossings("FOM Value", arBoundaries)
        #Else
        #End If

        Dim iRange As Integer = 0
        While iRange <>
            Console.Write(vbLf & "Range: {0}" & vbLf, iRange)

            Dim arTimeSpans As Array = TryCast(arRanges.GetValue(iRange), Array)
            Dim iSpan As Integer = 0
            While iSpan <>
                Dim strStart As String = arTimeSpans.GetValue(iSpan, 0).ToString()
                Dim strStop As String = arTimeSpans.GetValue(iSpan, 1).ToString()

                Console.Write("Start: {0}" & vbTab & "Stop: {1}" & vbLf, strStart, strStop)
                System.Math.Max(System.Threading.Interlocked.Increment(iSpan),iSpan - 1)
            End While
            System.Math.Max(System.Threading.Interlocked.Increment(iRange),iRange - 1)
        End While
    Next
Next

Sets the interval of the object coverage to the sunlight times of an object
[Visual Basic .NET] Copy Code
' For this example, set the access times to use the light intervals of the area target.
Dim uavAircraft As IAgStkObject = root.GetObjectFromPath("Aircraft/UAV/Sensor/UAV_Camera")
Dim airspaceAreaTarget As IAgStkObject = root.GetObjectFromPath("AreaTarget/Airspace")

Dim firstSunlightEpoch As IAgCrdnEvent = airspaceAreaTarget.Vgt.Events("LightingIntervals.Sunlight.First.Start")
Dim lastSunlightEpoch As IAgCrdnEvent = airspaceAreaTarget.Vgt.Events("LightingIntervals.Sunlight.First.Stop")

uavAircraft.ObjectCoverage.UseObjectTimes = False
Dim startEpoch As IAgCrdnEventSmartEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStartEpoch()
startEpoch.SetImplicitTime(firstSunlightEpoch)

Dim stopEpoch As IAgCrdnEventSmartEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStopEpoch()
stopEpoch.SetImplicitTime(lastSunlightEpoch)

uavAircraft.ObjectCoverage.AccessInterval.SetStartAndStopEpochs(startEpoch, stopEpoch)

Compute Object Coverage
[MATLAB] Copy Code
% IAgAircraft aircraft: Aircraft object 
objCoverage = aircraft.ObjectCoverage; 
objCoverage.Assets.RemoveAll; 
objCoverage.Assets.Add('Satellite/MySatellite'); 
objCoverage.UseObjectTimes = true; 
objCoverage.Compute; 
 
objCoverageFOM = objCoverage.FOM; 
objCoverageFOM.SetDefinitionType('eFmCoverageTime'); 
objCoverageFOM.Definition.SetComputeType('eTotal'); 
 
 
© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1