STK ObjectsSend comments on this topic.
IAgAccessConstraintCollection Interface

Description

AgAccessConstraintCollection used to access the list of constraints.

Public Methods

Public Method AddConstraint

Adds a constraint to the Constraint Collection.



To determine the interface to use for a specific constraint, scroll down to the EConstraint Parameter table near the bottom of this help page. This table lists all possible values for the AgEAccessConstraints enumeration. The description column provides the corresponding interface to use with each constraint. For example, IAgAccessCnstrMinMax is the interface used with the Range constraint, eCstrRange.



Code snippet examples that show how to add and configure constraints are provided at the bottom of this help page.



Deprecation - The functionality to add eCstrApparentTime, eCstrDuration, eCstrGMT, eCstrIntervals, eCstrLocalTime constraint types multiple times to the constraint collection is being deprecated.

Public Method AddNamedConstraintAdds a constraint with the given name to the collection.
Public Method AvailableConstraintsReturns a rectangular two-dimensional array of available constraints. A row of the array consists of two elements where the first element is a symbolic name of the constraint and the second is a corresponding enumeration value.
Public Method GetActiveConstraintRetrieves the active constraint.
Public Method GetActiveNamedConstraintRetrieves an active constraint with the given name.
Public Method IsConstraintActiveGiven an AgEAccessConstraints enum, informs the user if the constraint is active.
Public Method IsConstraintSupportedIs the constraint supported for this object.
Public Method IsNamedConstraintActiveGiven a constraint name, returns whether the specified constraint is active.
Public Method IsNamedConstraintSupportedIs the named constraint supported for this object.
Public Method RemoveConstraintRemoves a constraint from the collection.
Public Method RemoveNamedConstraintThis method is deprecated. Use RemoveNamedConstraintEx instead. Removes a constraint with the given name from the collection.
Public Method RemoveNamedConstraintExRemoves a constraint with the given name from the collection.

Public Properties

Public Property AWBConstraintsReturns a AgAccessCnstrAWBCollection constraint used to access angle, vector and condition constraint.
Public Property CountReturns the size of the collection.
Public Property ItemReturns an AccessConstraint interface using an index.
Public Property PreferredMaxTimeStepMaximum time step to be considered in access computations. New access computations consider this value when determining a suitable maximum step size.
Public Property UsePreferredMaxTimeStepFlag indicating that the preferred max time step should be used in access computations.

Example

Add and configure a sun elevation angle access constraint
[C#]
// To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
IAgAccessCnstrMinMax minmax = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrSunElevationAngle) as IAgAccessCnstrMinMax;
minmax.EnableMin = true;
minmax.Min = 22.2;
minmax.EnableMax = true;
minmax.Max = 77.7;
Add and configure a lunar elevation angle access constraint
[C#]
// To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
IAgAccessCnstrMinMax minmax = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLunarElevationAngle) as IAgAccessCnstrMinMax;
minmax.EnableMin = true;
minmax.Min = 11.1;
minmax.EnableMax = true;
minmax.Max = 88.8;
Add and configure a LOS sun exclusion access constraint
[C#]
// Angle constraint
IAgAccessCnstrAngle cnstrAngle = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLOSSunExclusion) as IAgAccessCnstrAngle;
cnstrAngle.Angle = 176.0;
Add and configure a lighting condition access constraint
[C#]
// Condition constraint
IAgAccessCnstrCondition light = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLighting) as IAgAccessCnstrCondition;
light.Condition = AgECnstrLighting.eDirectSun;
Add and configure an altitude access constraint
[C#]
// To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
// Attitude constraint
IAgAccessCnstrMinMax altitude = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrAltitude) as IAgAccessCnstrMinMax;
altitude.EnableMin = true;
altitude.Min = 20.5;
List all exclusion zones of an access constraint
[C#]
IAgAccessCnstrExclZonesCollection excZones = accessconstraints.GetActiveConstraint(AgEAccessConstraints.eCstrExclusionZone) as IAgAccessCnstrExclZonesCollection;

if (excZones != null)
{
    // ToArray returns a two dimensional array
    // The second dimension is an array of minLon, minLat, maxLon, maxLat values
    Array zones = excZones.ToArray(0, -1);

    for (int i = 0; i <= zones.GetUpperBound(0); i++)
    {
        Console.WriteLine("MinLon: {0}, MinLat: {1}, MaxLon: {2}, MaxLat {3}", zones.GetValue(i, 0), zones.GetValue(i, 1), zones.GetValue(i, 2), zones.GetValue(i, 3));
    }
}
Enumerate the available constraints collection
[C#]
// The AvailableConstraints method returns a rectangular two-dimensional array of available constraints. 
// A row of the array consists of two elements where the first element is a symbolic name of the constraint,
// and the second is a corresponding enumeration value.

Array arAvailable = accessConstraints.AvailableConstraints();
for (int i = 0; i < arAvailable.GetLength(0); i++)
{
    string availName = (string)arAvailable.GetValue(i, 0);
    AgEAccessConstraints eAccessConstraint = (AgEAccessConstraints)(int)arAvailable.GetValue(i, 1);
    Console.WriteLine("\tConstraint {0}: {1} ({2})", i, availName, eAccessConstraint);
}
Add and configure a sun elevation angle access constraint
[Visual Basic .NET]
' To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
Dim minmax As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrSunElevationAngle), IAgAccessCnstrMinMax)
minmax.EnableMin = True
minmax.Min = 22.2
minmax.EnableMax = True
minmax.Max = 77.7
Add and configure a lunar elevation angle access constraint
[Visual Basic .NET]
' To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
Dim minmax As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLunarElevationAngle), IAgAccessCnstrMinMax)
minmax.EnableMin = True
minmax.Min = 11.1
minmax.EnableMax = True
minmax.Max = 88.8
Add and configure a LOS sun exclusion access constraint
[Visual Basic .NET]
' Angle constraint
Dim cnstrAngle As IAgAccessCnstrAngle = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLOSSunExclusion), IAgAccessCnstrAngle)
cnstrAngle.Angle = 176
Add and configure a lighting condition access constraint
[Visual Basic .NET]
' Condition constraint
Dim light As IAgAccessCnstrCondition = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLighting), IAgAccessCnstrCondition)
light.Condition = AgECnstrLighting.eDirectSun
Add and configure an altitude access constraint
[Visual Basic .NET]
' To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
' Attitude constraint
Dim altitude As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrAltitude), IAgAccessCnstrMinMax)
altitude.EnableMin = True
altitude.Min = 20.5
List all exclusion zones of an access constraint
[Visual Basic .NET]
Dim excZones As IAgAccessCnstrExclZonesCollection = TryCast(accessconstraints.GetActiveConstraint(AgEAccessConstraints.eCstrExclusionZone), IAgAccessCnstrExclZonesCollection)

If excZones IsNot Nothing Then
	' ToArray returns a two dimensional array
	' The second dimension is an array of minLon, minLat, maxLon, maxLat values
	Dim zones As Array = excZones.ToArray(0, -1)

	Dim i As Integer = 0
	While i <= zones.GetUpperBound(0)
		Console.WriteLine("MinLon: {0}, MinLat: {1}, MaxLon: {2}, MaxLat {3}", zones.GetValue(i, 0), zones.GetValue(i, 1), zones.GetValue(i, 2), zones.GetValue(i, 3))
		System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
	End While
End If
Enumerate the available constraints collection
[Visual Basic .NET]
' The AvailableConstraints method returns a rectangular two-dimensional array of available constraints. 
' A row of the array consists of two elements where the first element is a symbolic name of the constraint,
' and the second is a corresponding enumeration value.

Dim arAvailable As Array = accessConstraints.AvailableConstraints()
Dim i As Integer = 0
While i < arAvailable.GetLength(0)
	Dim availName As String = DirectCast(arAvailable.GetValue(i, 0), String)
	Dim eAccessConstraint As AgEAccessConstraints = DirectCast(DirectCast(arAvailable.GetValue(i, 1), Integer), AgEAccessConstraints)
	Console.WriteLine(vbTab & "Constraint {0}: {1} ({2})", i, availName, eAccessConstraint)
	System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
Get handle to the object access constraints
[Python - STK API]
# IAgSatellite satellite: Satellite object
accessConstraints = satellite.AccessConstraints

Get handle to the object access constraints
[MATLAB]
% IAgSatellite satellite: Satellite object
accessConstraints = satellite.AccessConstraints;


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.