STK ObjectsSend comments on this topic.
IAgOnePtAccess Interface

Description

One Point Access.

Public Methods

Public Method ComputeComputes one point access results using the StartTime, StopTime, StepSize, and SummaryOption.
Public Method ComputeFirstSatisfactionComputes and reports the first N satisfaction intervals (where N <= MaxNumAccessesToFind) over the specified interval whose spans meet the specified minimum duration. Does not use output file.
Public Method RemoveRemoves the one point access component that was created.

Public Properties

Public Property OutputFileIf set to do so, results will be output to a file with this name.
Public Property OutputToFileWhether to output to a file.
Public Property StartTimeGets or sets the start time. Uses current animation time if none is entered.
Public Property StepSizeGets or sets the step size. Default is 60 seconds.
Public Property StopTimeGets or sets the stop time. Uses current animation time if none is entered. Set this to the same value as StartTime to report at a single time.
Public Property SummaryOptionSummary option that specifies the level of detail to provide in the computed results.

Example

Compute an access for one point
[C#]
IAgOnePtAccess onePtAccess = facility.CreateOnePointAccess("Satellite/Satellite1");

// Configure properties (if necessary)
onePtAccess.StartTime = "1 Jan 2012 12:00:00.000";
onePtAccess.StopTime = "1 Jan 2012 13:00:00.000";
onePtAccess.StepSize = 120;
onePtAccess.SummaryOption = AgEOnePtAccessSummary.eOnePtAccessSummaryDetailed;

// Compute results
IAgOnePtAccessResultCollection results = onePtAccess.Compute();

// Print results
for (int i = 0; i < results.Count; i++)
{
    IAgOnePtAccessResult result = results[i];

    Console.WriteLine("Time: {0}, HasAccess: {1}", result.Time, result.AccessSatisfied);

    for (int j = 0; j < result.Constraints.Count; j++)
    {
        IAgOnePtAccessConstraint constraint = result.Constraints[j];
        Console.WriteLine("Constraint: {0}, Object {1}, Status {2}, Value {3}",
            constraint.Constraint,
            constraint.ObjectPath,
            constraint.Status,
            constraint.Value);
    }
}
Compute an access for one point
[Visual Basic .NET]
Dim onePtAccess As IAgOnePtAccess = facility.CreateOnePointAccess("Satellite/Satellite1")

' Configure properties (if necessary)
onePtAccess.StartTime = "1 Jan 2012 12:00:00.000"
onePtAccess.StopTime = "1 Jan 2012 13:00:00.000"
onePtAccess.StepSize = 120
onePtAccess.SummaryOption = AgEOnePtAccessSummary.eOnePtAccessSummaryDetailed

' Compute results
Dim results As IAgOnePtAccessResultCollection = onePtAccess.Compute()

' Print results
Dim i As Integer = 0
While i < results.Count
	Dim result As IAgOnePtAccessResult = results(i)

	Console.WriteLine("Time: {0}, HasAccess: {1}", result.Time, result.AccessSatisfied)

	Dim j As Integer = 0
	While j < result.Constraints.Count
		Dim constraint As IAgOnePtAccessConstraint = result.Constraints(j)
		Console.WriteLine("Constraint: {0}, Object {1}, Status {2}, Value {3}", constraint.Constraint, constraint.ObjectPath, constraint.Status, constraint.Value)
		System.Math.Max(System.Threading.Interlocked.Increment(j),j - 1)
	End While
	System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
Compute an access for one point
[Python - STK API]
# IAgStkObject facility: Facility object
onePtAccess = facility.CreateOnePointAccess('Satellite/MySatellite')

# Configure properties (if necessary)
onePtAccess.StartTime = root.CurrentScenario.StartTime
onePtAccess.StopTime = root.CurrentScenario.StopTime
onePtAccess.StepSize = 600
onePtAccess.SummaryOption = AgEOnePtAccessSummary.eOnePtAccessSummaryDetailed

# Compute results
results = onePtAccess.Compute()

# Print results
for i in range(0, results.Count):
    result = results.Item(i)
    print('Time: %s HasAccess: %s' % (result.Time, str(result.AccessSatisfied)))

    for j in range(0, result.Constraints.Count):
        constraint = result.Constraints.Item(j)
        print('Constraint: %s Object: %s Status: %s Value:%s' % (constraint.Constraint, constraint.ObjectPath, constraint.Status, str(constraint.Value)))

Compute an access for one point
[MATLAB]
% IAgStkObject facility: Facility object
onePtAccess = facility.CreateOnePointAccess('Satellite/MySatellite');

% Configure properties (if necessary)
onePtAccess.StartTime = root.CurrentScenario.StartTime;
onePtAccess.StopTime = root.CurrentScenario.stopTime;
onePtAccess.StepSize = 600;
onePtAccess.SummaryOption = 'eOnePtAccessSummaryDetailed';

% Compute results
results = onePtAccess.Compute();

% Print results
for i = 0:results.Count - 1
    result = results.Item(i);
    disp(['Time: ' result.Time ' HasAccess: ' num2str(result.AccessSatisfied)]);

    for j = 0:result.Constraints.Count - 1
        constraint = result.Constraints.Item(j);
        disp(['Constraint: ' constraint.Constraint ' Object: ' constraint.ObjectPath ' Status: ' constraint.Status ' Value: ' num2str(constraint.Value)]);
    end
end


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.