Description
AgAccessConstraintCollection used to access the list of constraints.
Public Methods
Public Properties
AWBConstraints | Returns a AgAccessCnstrAWBCollection constraint used to access angle, vector and condition constraint. |
Count | Returns the size of the collection. |
Item | Returns an AccessConstraint interface using an index. |
PreferredMaxTimeStep | Maximum time step to be considered in access computations. New access computations consider this value when determining a suitable maximum step size. |
UsePreferredMaxTimeStep | Flag 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;
|
|