STK ObjectsSend comments on this topic.
IAgAccessInterval Interface

Description

Base interface for IAgTimePeriod and IAgIntervalCollection.

CoClasses that Implement IAgAccessInterval

Example

Configure the access analysis time period to specified time instants.
[C#]
IAgStkObject uav = stkRoot.GetObjectFromPath("/Aircraft/UAV");
IAgStkObject sensor = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor");
IAgStkObject coloradoSprings = stkRoot.GetObjectFromPath("/Place/ColoradoSprings");

// For this code snippet, let's use the time interval when the UAV reached min and max altitude values.
// Note, this assumes time at min happens before time at max.
IAgCrdnEvent timeOfAltMin = uav.Vgt.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMin"];
IAgCrdnEvent timeOfAltMax = uav.Vgt.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMax"];

// Set the access time period with the times we figured out above.
IAgStkAccess access = sensor.GetAccessToObject(coloradoSprings);
access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime;
IAgAccessTimePeriod accessTimePeriod = access.AccessTimePeriodData as IAgAccessTimePeriod;

accessTimePeriod.AccessInterval.State = AgECrdnSmartIntervalState.eCrdnSmartIntervalStateStartStop;

IAgCrdnEventSmartEpoch accessStartEpoch = accessTimePeriod.AccessInterval.GetStartEpoch();
accessStartEpoch.SetImplicitTime(timeOfAltMin);
accessTimePeriod.AccessInterval.SetStartEpoch(accessStartEpoch);

IAgCrdnEventSmartEpoch accessStopEpoch = accessTimePeriod.AccessInterval.GetStopEpoch();
accessStopEpoch.SetImplicitTime(timeOfAltMax);
accessTimePeriod.AccessInterval.SetStopEpoch(accessStopEpoch);
Configure the access interval to the availability time span of the object where access is being computed to.
[C#]
IAgStkObject satellite = stkRoot.GetObjectFromPath("/Satellite/GEO");
IAgStkObject otherObject = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor");
IAgStkAccess access = satellite.GetAccessToObject(otherObject);

access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime;
IAgAccessTimePeriod accessTimePeriod = access.AccessTimePeriodData as IAgAccessTimePeriod;

if (otherObject.Vgt.EventIntervals.Contains("AvailabilityTimeSpan"))
{
    IAgCrdnEventInterval availabilityTimeSpan = otherObject.Vgt.EventIntervals["AvailabilityTimeSpan"];
    accessTimePeriod.AccessInterval.SetImplicitInterval(availabilityTimeSpan);
}
Configure the access analysis time period to specified time instants.
[Visual Basic .NET]
Dim uav As IAgStkObject = stkRoot.GetObjectFromPath("/Aircraft/UAV")
Dim sensor As IAgStkObject = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor")
Dim coloradoSprings As IAgStkObject = stkRoot.GetObjectFromPath("/Place/ColoradoSprings")

' For this code snippet, let's use the time interval when the UAV reached min and max altitude values.
' Note, this assumes time at min happens before time at max.
Dim timeOfAltMin As IAgCrdnEvent = uav.Vgt.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMin")
Dim timeOfAltMax As IAgCrdnEvent = uav.Vgt.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMax")

' Set the access time period with the times we figured out above.
Dim access As IAgStkAccess = sensor.GetAccessToObject(coloradoSprings)
access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime
Dim accessTimePeriod As IAgAccessTimePeriod = TryCast(access.AccessTimePeriodData, IAgAccessTimePeriod)

accessTimePeriod.AccessInterval.State = AgECrdnSmartIntervalState.eCrdnSmartIntervalStateStartStop

Dim accessStartEpoch As IAgCrdnEventSmartEpoch = accessTimePeriod.AccessInterval.GetStartEpoch()
accessStartEpoch.SetImplicitTime(timeOfAltMin)
accessTimePeriod.AccessInterval.SetStartEpoch(accessStartEpoch)

Dim accessStopEpoch As IAgCrdnEventSmartEpoch = accessTimePeriod.AccessInterval.GetStopEpoch()
accessStopEpoch.SetImplicitTime(timeOfAltMax)
accessTimePeriod.AccessInterval.SetStopEpoch(accessStopEpoch)
Configure the access interval to the availability time span of the object where access is being computed to.
[Visual Basic .NET]
Dim satellite As IAgStkObject = stkRoot.GetObjectFromPath("/Satellite/GEO")
Dim otherObject As IAgStkObject = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor")
Dim access As IAgStkAccess = satellite.GetAccessToObject(otherObject)

access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime
Dim accessTimePeriod As IAgAccessTimePeriod = TryCast(access.AccessTimePeriodData, IAgAccessTimePeriod)

If otherObject.Vgt.EventIntervals.Contains("AvailabilityTimeSpan") Then
	Dim availabilityTimeSpan As IAgCrdnEventInterval = otherObject.Vgt.EventIntervals("AvailabilityTimeSpan")
	accessTimePeriod.AccessInterval.SetImplicitInterval(availabilityTimeSpan)
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.