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





Description

User-specified time period for the chain.

Public Methods

Public Method SetTimePeriod This property is deprecated. Use the TimeInterval property to configure the time interval. The user-specified time period. Start/Stop use DateFormat Dimension.

Public Properties

Public Property Start This property is deprecated. Use the TimeInterval property to configure the time interval. Start Time: beginning of the user-specified time period for the chain. Uses DateFormat Dimension.
Public Property Stop This property is deprecated. Use the TimeInterval property to configure the time interval. Stop Time: end of the user-specified time period for the chain. Uses DateFormat Dimension.
Public Property TimeInterval Allows configuring the time interval.

Interfaces

Implemented Interface
IAgChTimePeriodBase

Example

Define and compute a chain (advance)
[C#] Copy Code
// Remove all previous accesses 
chain.ClearAccess(); 
 
// Add some objects to chain 
chain.Objects.Add("Facility/fac1"); 
chain.Objects.Add("Satellite/sat1"); 
chain.Objects.Add("Satellite/sat2"); 
chain.Objects.Add("Aircraft/air1"); 
 
// Configure chain parameters 
chain.AutoRecompute = false
chain.EnableLightTimeDelay = false
chain.TimeConvergence = 0.001
chain.DataSaveMode = AgEDataSaveMode.eSaveAccesses; 
 
// Specify our own time period 
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod); 
 
// Get chain time period interface 
IAgChUserSpecifiedTimePeriod chainUserTimePeriod = chain.TimePeriod as IAgChUserSpecifiedTimePeriod; 
chainUserTimePeriod.SetTimePeriod("1 Jul 2005 12:00:00""2 Jul 2005 12:00:00"); 
 
// Compute the chain 
chain.ComputeAccess(); 
 

Configure the chain compute time period.
[C#] Copy Code
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod); 
IAgChUserSpecifiedTimePeriod userSpecifiedTimePeriod = chain.TimePeriod as IAgChUserSpecifiedTimePeriod; 
userSpecifiedTimePeriod.TimeInterval.SetExplicitInterval("1 May 2015 04:00:00.000""1 May 2015 05:00:00.000"); 
 

Prints the strand intervals of chain object
[C#] Copy Code
IAgStkObject chainAsStkObject = chain as IAgStkObject; 
 
// Compute the chain access if not done already. 
chain.ComputeAccess(); 
 
// Considered Start and Stop time 
Console.WriteLine("Chain considered start time: {0}", chainAsStkObject.Vgt.Events["ConsideredStartTime"].FindOccurrence().Epoch); 
Console.WriteLine("Chain considered stop time: {0}", chainAsStkObject.Vgt.Events["ConsideredStopTime"].FindOccurrence().Epoch); 
 
IAgCrdnEventIntervalCollection objectParticipationIntervals = chainAsStkObject.Vgt.EventIntervalCollections["StrandAccessIntervals"]; 
IAgCrdnIntervalsVectorResult intervalListResult = objectParticipationIntervals.FindIntervalCollection(); 
 
for (int i = 0; i < intervalListResult.IntervalCollections.Count; ++i) 

    if (intervalListResult.IsValid) 
    { 
        Console.WriteLine("Link Name: {0}", objectParticipationIntervals.Labels.GetValue(i)); 
        Console.WriteLine("--------------"); 
        for (int j = 0; j < intervalListResult.IntervalCollections[i].Count; ++j) 
        { 
            object startTime = intervalListResult.IntervalCollections[i][j].Start; 
            object stopTime = intervalListResult.IntervalCollections[i][j].Stop; 
            Console.WriteLine("Start: {0}, Stop: {1}", startTime, stopTime); 
        } 
    } 

 

Define and compute a chain (advance)
[Visual Basic .NET] Copy Code
' Remove all previous accesses
chain.ClearAccess()

' Add some objects to chain
chain.Objects.Add("Facility/fac1")
chain.Objects.Add("Satellite/sat1")
chain.Objects.Add("Satellite/sat2")
chain.Objects.Add("Aircraft/air1")

' Configure chain parameters
chain.AutoRecompute = False
chain.EnableLightTimeDelay = False
chain.TimeConvergence = 0.001
chain.DataSaveMode = AgEDataSaveMode.eSaveAccesses

' Specify our own time period
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod)

' Get chain time period interface
Dim chainUserTimePeriod As IAgChUserSpecifiedTimePeriod = TryCast(chain.TimePeriod, IAgChUserSpecifiedTimePeriod)
chainUserTimePeriod.SetTimePeriod("1 Jul 2005 12:00:00", "2 Jul 2005 12:00:00")

' Compute the chain
chain.ComputeAccess()

Configure the chain compute time period.
[Visual Basic .NET] Copy Code
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod)
Dim userSpecifiedTimePeriod As IAgChUserSpecifiedTimePeriod = TryCast(chain.TimePeriod, IAgChUserSpecifiedTimePeriod)
userSpecifiedTimePeriod.TimeInterval.SetExplicitInterval("1 May 2015 04:00:00.000", "1 May 2015 05:00:00.000")

Prints the strand intervals of chain object
[Visual Basic .NET] Copy Code
Dim chainAsStkObject As IAgStkObject = TryCast(chain, IAgStkObject)

' Compute the chain access if not done already.
chain.ComputeAccess()

' Considered Start and Stop time
Console.WriteLine("Chain considered start time: {0}", chainAsStkObject.Vgt.Events("ConsideredStartTime").FindOccurrence().Epoch)
Console.WriteLine("Chain considered stop time: {0}", chainAsStkObject.Vgt.Events("ConsideredStopTime").FindOccurrence().Epoch)

Dim objectParticipationIntervals As IAgCrdnEventIntervalCollection = chainAsStkObject.Vgt.EventIntervalCollections("StrandAccessIntervals")
Dim intervalListResult As IAgCrdnIntervalsVectorResult = objectParticipationIntervals.FindIntervalCollection()

Dim i As Integer = 0
While i <>
    If intervalListResult.IsValid Then
        Console.WriteLine("Link Name: {0}", objectParticipationIntervals.Labels.GetValue(i))
        Console.WriteLine("--------------")
        Dim j As Integer = 0
        While j <>
            Dim startTime As Object = intervalListResult.IntervalCollections(i)(j).Start
            Dim stopTime As Object = intervalListResult.IntervalCollections(i)(j).[Stop]
            Console.WriteLine("Start: {0}, Stop: {1}", startTime, stopTime)
            System.Threading.Interlocked.Increment(j)
        End While
    End If
    System.Threading.Interlocked.Increment(i)
End While

CoClasses that Implement IAgChUserSpecifiedTimePeriod

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1