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






Windows & Linux

Description

A smart interval.

Object Model




Public Methods

Public Method FindStartTimeFinds 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 FindStopTimeFinds 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 GetStartEpochReturns a copy of the start epoch. Changes to the epoch will not affect the state of the interval.
Public Method GetStopEpochReturns a copy of the stop epoch. Changes to the epoch will not affect the state of the interval.
Public Method SetExplicitIntervalSet the interval's start and the stop times changes the interval's state to explicit. Exception is thrown if specified start time is greater than stop time.
Public Method SetImplicitIntervalSet the reference interval and changes the state to Implicit.
Public Method SetStartAndStopEpochsSets the interval's start and stop epochs as two smart epoch components. Exception is thrown if specified start time is greater than stop time.
Public Method SetStartAndStopTimesSets the interval's start and stop epochs as explicit times. Exception is thrown if specified start time is greater than stop time.
Public Method SetStartEpochSets a start of the interval using specified epoch component.
Public Method SetStartEpochAndDurationSets the interval's start epoch and the interval's duration.
Public Method SetStartTimeAndDurationSets the interval's start time and the interval's duration.
Public Method SetStopEpochSets a stop of the interval using specified epoch component.

Public Properties

Public Property DurationAsStringThe duration of the interval
Public Property ReferenceIntervalThe reference interval used to compute start/stop times of this interval if the state of the interval is set to implicit.
Public Property StateA 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

© 2018 Analytical Graphics, Inc. All Rights Reserved.