AGI STK VGT 11 Send comments on this topic.
IAgCrdnEventIntervalSmartInterval Interface





Description

A smart interval.

Object Model




Public Methods

Public Method FindStartTime Finds a start time of the interval. An exception is thrown if the start time cannot be determined from the interval's current state.
Public Method FindStopTime Finds a stop time of the interval. An exception is thrown if the stop time cannot be determined from the interval's current state.
Public Method GetStartEpoch Returns a copy of the start epoch. Changes to the epoch will not affect the state of the interval.
Public Method GetStopEpoch Returns a copy of the stop epoch. Changes to the epoch will not affect the state of the interval.
Public Method SetExplicitInterval Set the interval's start and the stop times changes the interval's state to explicit.
Public Method SetImplicitInterval Set the reference interval and changes the state to Implicit.
Public Method SetStartAndStopEpochs Sets the interval's start and stop epochs as two smart epoch components.
Public Method SetStartAndStopTimes Sets the interval's start and stop epochs as explicit times.
Public Method SetStartEpoch Sets a start of the interval using specified epoch component.
Public Method SetStartEpochAndDuration Sets the interval's start epoch and the interval's duration.
Public Method SetStartTimeAndDuration Sets the interval's start time and the interval's duration.
Public Method SetStopEpoch Sets a stop of the interval using specified epoch component.

Public Properties

Public Property DurationAsString The duration of the interval
Public Property ReferenceInterval The reference interval used to compute start/stop times of this interval if the state of the interval is set to implicit.
Public Property State A state of the smart interval.

Example

Sets the start and stop epoch time with smart epochs.
[C#] Copy Code
smartInterval.SetExplicitInterval("Today""Tomorrow"); 
 

Configure the start and stop epoch time with smart epochs.
[C#] Copy Code
smartInterval.State = AgECrdnSmartIntervalState.eCrdnSmartIntervalStateStartStop; 
 
IAgCrdnEventSmartEpoch accessStartEpoch = smartInterval.GetStartEpoch(); 
accessStartEpoch.SetImplicitTime(startEventEpoch); 
smartInterval.SetStartEpoch(accessStartEpoch); 
 
IAgCrdnEventSmartEpoch accessStopEpoch = smartInterval.GetStopEpoch(); 
accessStopEpoch.SetImplicitTime(stopEventEpoch); 
smartInterval.SetStopEpoch(accessStopEpoch); 
 

Configure the smart interval epoch and the duration.
[C#] Copy Code
// Change the time interval to 1 week after the dependent interval. 
IAgCrdnEventSmartEpoch epochOfInterest = smartInterval.GetStopEpoch(); 
smartInterval.SetStartEpochAndDuration(epochOfInterest, "+1 week"); 
 
// Or if you want a specific time, use SetStartTimeAndDuration. 
smartInterval.SetStartTimeAndDuration("1 Jan 2015 16:00:00.000""+1 day"); 
 
// You can find the event times, such as 
Console.WriteLine("Start Time: " + smartInterval.FindStartTime()); 
Console.WriteLine("Stop Time: " + smartInterval.FindStopTime()); 
Console.WriteLine("Duration: " + smartInterval.DurationAsString); // Note, only works if you specified duration. 
 

Convert the start and stop times of the interval into a time.
[C#] Copy Code
smartInterval.SetStartTimeAndDuration("Now""+100 day"); 
object startTime = smartInterval.FindStartTime(); 
object stopTime = smartInterval.FindStopTime(); 
 
Console.WriteLine("StartTime = {0}, StopTime = {1}", startTime, stopTime); 
 

Sets the start and stop epoch time with smart epochs.
[Visual Basic .NET] Copy Code
smartInterval.SetExplicitInterval("Today", "Tomorrow")

Configure the start and stop epoch time with smart epochs.
[Visual Basic .NET] Copy Code
smartInterval.State = AgECrdnSmartIntervalState.eCrdnSmartIntervalStateStartStop

Dim accessStartEpoch As IAgCrdnEventSmartEpoch = smartInterval.GetStartEpoch()
accessStartEpoch.SetImplicitTime(startEventEpoch)
smartInterval.SetStartEpoch(accessStartEpoch)

Dim accessStopEpoch As IAgCrdnEventSmartEpoch = smartInterval.GetStopEpoch()
accessStopEpoch.SetImplicitTime(stopEventEpoch)
smartInterval.SetStopEpoch(accessStopEpoch)

Configure the smart interval epoch and the duration.
[Visual Basic .NET] Copy Code
' Change the time interval to 1 week after the dependent interval.
Dim epochOfInterest As IAgCrdnEventSmartEpoch = smartInterval.GetStopEpoch()
smartInterval.SetStartEpochAndDuration(epochOfInterest, "+1 week")

' Or if you want a specific time, use SetStartTimeAndDuration.
smartInterval.SetStartTimeAndDuration("1 Jan 2015 16:00:00.000", "+1 day")

' You can find the event times, such as
Console.WriteLine("Start Time: " + smartInterval.FindStartTime())
Console.WriteLine("Stop Time: " + smartInterval.FindStopTime())
Console.WriteLine("Duration: " + smartInterval.DurationAsString)
' Note, only works if you specified duration.

Convert the start and stop times of the interval into a time.
[Visual Basic .NET] Copy Code
smartInterval.SetStartTimeAndDuration("Now", "+100 day")
Dim startTime As Object = smartInterval.FindStartTime()
Dim stopTime As Object = smartInterval.FindStopTime()

Console.WriteLine("StartTime = {0}, StopTime = {1}", startTime, stopTime)

CoClasses that Implement IAgCrdnEventIntervalSmartInterval

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1