Description
Coverage interval: the time period over which
coverage is computed.
Public Properties
AnalysisInterval |
The coverage analysis
interval. |
Start |
This property is
deprecated. Use AnalysisInterval instead. Beginning of the coverage
interval. Uses DateFormat Dimension. |
Stop |
This property is
deprecated. Use AnalysisInterval instead. End of the coverage
interval. Uses DateFormat Dimension. |
UseScenarioInterval |
Use the scenario time
period as the coverage interval. |
Example
Set the coverage
analysis time to the asset object time periods.
[C#] |
Copy Code
|
string currentDateFormat = stkRoot.UnitPreferences.GetCurrentUnitAbbrv("DateFormat");
IAgDate minStartTime = null;
IAgDate maxStartTime = null;
foreach (IAgCvAssetListElement cvAsset in coverage.AssetList)
{
IAgStkObject subAsset = stkRoot.GetObjectFromPath(cvAsset.ObjectName);
if (subAsset.Vgt.EventIntervals.Contains("AvailabilityTimeSpan"))
{
IAgCrdnEventIntervalResult availableTimeSpan = subAsset.Vgt.EventIntervals["AvailabilityTimeSpan"].FindInterval();
IAgDate startDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Start.ToString());
if (!(minStartTime != null) || startDate.OLEDate < minStartTime.OLEDate)
{
minStartTime = startDate;
}
IAgDate stopTime = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Stop.ToString());
if (!(maxStartTime != null) || stopTime.OLEDate > maxStartTime.OLEDate)
{
maxStartTime = stopTime;
}
}
}
if (minStartTime != null && maxStartTime != null)
{
coverage.Interval.AnalysisInterval.SetExplicitInterval(minStartTime.Format(currentDateFormat), maxStartTime.Format(currentDateFormat));
}
Console.WriteLine(
"Coverage Analysis Interval, StartTime = {0}, StopTime = {1}",
coverage.Interval.AnalysisInterval.FindStartTime(),
coverage.Interval.AnalysisInterval.FindStopTime());
|
|
Set the coverage
analysis time to the asset object time periods.
[Visual Basic .NET] |
Copy Code
|
Dim currentDateFormat As String =
stkRoot.UnitPreferences.GetCurrentUnitAbbrv("DateFormat")
Dim minStartTime As IAgDate = Nothing
Dim maxStartTime As IAgDate = Nothing
For Each
cvAsset As IAgCvAssetListElement
In coverage.AssetList
Dim subAsset
As IAgStkObject =
stkRoot.GetObjectFromPath(cvAsset.ObjectName)
If
subAsset.Vgt.EventIntervals.Contains("AvailabilityTimeSpan") Then
Dim availableTimeSpan As IAgCrdnEventIntervalResult =
subAsset.Vgt.EventIntervals("AvailabilityTimeSpan").FindInterval()
Dim startDate As
IAgDate = stkRoot.ConversionUtility.NewDate(currentDateFormat,
availableTimeSpan.Interval.Start.ToString())
If Not (minStartTime
IsNot Nothing) OrElse
startDate.OLEDate < minstarttime.oledate="">Then
minStartTime
= startDate
End If
Dim stopTime As
IAgDate = stkRoot.ConversionUtility.NewDate(currentDateFormat,
availableTimeSpan.Interval.[Stop].ToString())
If Not (maxStartTime
IsNot Nothing) OrElse stopTime.OLEDate
> maxStartTime.OLEDate Then
maxStartTime
= stopTime
End If
End
If
Next
If minStartTime IsNot Nothing AndAlso maxStartTime IsNot Nothing Then
coverage.Interval.AnalysisInterval.SetExplicitInterval(minStartTime.Format(currentDateFormat),
maxStartTime.Format(currentDateFormat))
End If
Console.WriteLine("Coverage Analysis Interval,
StartTime = {0}, StopTime = {1}",
coverage.Interval.AnalysisInterval.FindStartTime(),
coverage.Interval.AnalysisInterval.FindStopTime())
|
|