Click or drag to resize
OSIsoft, LLC

AFValues Class

This collection holds the values returned from a call to one of the AFAttribute.GetValues Overload, AFAttributes.GetValue Overload, or AFAttributeList.GetValue Overload methods.

Inheritance Hierarchy
SystemObject
  System.Collections.GenericListAFValue
    OSIsoft.AF.AssetAFValues

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.6.195
Syntax
[SerializableAttribute]
public sealed class AFValues : List<AFValue>

The AFValues type exposes the following members.

Constructors
  NameDescription
Public methodAFValues
This is the default constructor which creates a new AFValues list that is empty and has the default initial capacity.
Public methodAFValues(Int32)
This constructor will create a new AFValues list that is empty and has the specified initial capacity.
Public methodAFValues(Object, DateTime, AFValueStatus, UOM)
This constructor will create a new AFValues list from the specified values, timestamps, and statuses all with the same UOM.
Public methodAFValues(Object, DateTime, AFValueStatus, UOM)
This constructor will create a new AFValues list from the specified values, timestamps, statuses, and with each UOM specified.
Top
Properties
  NameDescription
Public propertyAttribute
This property returns the AFAttribute associated with the list of values.
Public propertyCapacity
Gets or sets the total number of elements the internal data structure can hold without resizing.
(Inherited from ListAFValue.)
Public propertyCount (Inherited from ListAFValue.)
Public propertyItem
Gets or sets the element at the specified index.
(Inherited from ListAFValue.)
Public propertyPIPoint
This property returns the PIPoint associated with the list of values.
Top
Methods
  NameDescription
Public methodAdd (Inherited from ListAFValue.)
Public methodAddRange (Inherited from ListAFValue.)
Public methodAsReadOnly (Inherited from ListAFValue.)
Public methodBinarySearch(T)
Searches the entire sorted ListT for an element using the default comparer and returns the zero-based index of the element.
(Inherited from ListAFValue.)
Public methodBinarySearch(T, IComparerT)
Searches the entire sorted ListT for an element using the specified comparer and returns the zero-based index of the element.
(Inherited from ListAFValue.)
Public methodBinarySearch(Int32, Int32, T, IComparerT)
Searches a range of elements in the sorted ListT for an element using the specified comparer and returns the zero-based index of the element.
(Inherited from ListAFValue.)
Public methodClear (Inherited from ListAFValue.)
Public methodContains (Inherited from ListAFValue.)
Public methodConvert(UOM)
Returns a new AFValues list with each AFValue in the specified UOM.
Public methodConvert(UOMGroup)
Returns a new AFValues list with each AFValue in the UOM specified by the UOMGroup.
Public methodConvertAllTOutput (Inherited from ListAFValue.)
Public methodCopyTo(T) (Inherited from ListAFValue.)
Public methodCopyTo(T, Int32) (Inherited from ListAFValue.)
Public methodCopyTo(Int32, T, Int32, Int32)
Copies a range of elements from the ListT to a compatible one-dimensional array, starting at the specified index of the target array.
(Inherited from ListAFValue.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExists (Inherited from ListAFValue.)
Public methodFind
Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire ListT.
(Inherited from ListAFValue.)
Public methodFindAll
Retrieves all the elements that match the conditions defined by the specified predicate.
(Inherited from ListAFValue.)
Public methodFindIndex(PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire ListT.
(Inherited from ListAFValue.)
Public methodFindIndex(Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ListT that extends from the specified index to the last element.
(Inherited from ListAFValue.)
Public methodFindIndex(Int32, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the ListT that starts at the specified index and contains the specified number of elements.
(Inherited from ListAFValue.)
Public methodFindLast
Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire ListT.
(Inherited from ListAFValue.)
Public methodFindLastIndex(PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire ListT.
(Inherited from ListAFValue.)
Public methodFindLastIndex(Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the ListT that extends from the first element to the specified index.
(Inherited from ListAFValue.)
Public methodFindLastIndex(Int32, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the ListT that contains the specified number of elements and ends at the specified index.
(Inherited from ListAFValue.)
Public methodForEach (Inherited from ListAFValue.)
Public methodGetEnumerator (Inherited from ListAFValue.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRange (Inherited from ListAFValue.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValueArrays
This method returns the values of this collection as three (3) synchronized arrays of value, timestamp, and flags.
Public methodIndexOf(T) (Inherited from ListAFValue.)
Public methodIndexOf(T, Int32)
Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ListT that extends from the specified index to the last element.
(Inherited from ListAFValue.)
Public methodIndexOf(T, Int32, Int32)
Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ListT that starts at the specified index and contains the specified number of elements.
(Inherited from ListAFValue.)
Public methodInsert (Inherited from ListAFValue.)
Public methodInsertRange (Inherited from ListAFValue.)
Public methodInterpolatedValuesAtTimes
This method returns calculated interpolated values at the specified times.
Public methodLastIndexOf(T) (Inherited from ListAFValue.)
Public methodLastIndexOf(T, Int32)
Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the ListT that extends from the first element to the specified index.
(Inherited from ListAFValue.)
Public methodLastIndexOf(T, Int32, Int32)
Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the ListT that contains the specified number of elements and ends at the specified index.
(Inherited from ListAFValue.)
Public methodPlotValues
Reduces the number of values over the specified time range to minimum necessary for producing an accurate trend over the number of intervals (typically represents pixels).
Public methodRemove (Inherited from ListAFValue.)
Public methodRemoveAll
Removes all the elements that match the conditions defined by the specified predicate.
(Inherited from ListAFValue.)
Public methodRemoveAt (Inherited from ListAFValue.)
Public methodRemoveRange (Inherited from ListAFValue.)
Public methodReverse (Inherited from ListAFValue.)
Public methodReverse(Int32, Int32)
Reverses the order of the elements in the specified range.
(Inherited from ListAFValue.)
Public methodSort (Inherited from ListAFValue.)
Public methodSort(IComparerT) (Inherited from ListAFValue.)
Public methodSort(ComparisonT) (Inherited from ListAFValue.)
Public methodSort(Int32, Int32, IComparerT) (Inherited from ListAFValue.)
Public methodSummaries
Returns several summaries for this set of values over a time range for each interval within the range.
Public methodSummary
Returns several summaries for this set of values over a single time range.
Public methodToArray (Inherited from ListAFValue.)
Public methodToPIValues Obsolete.
This method returns the values of this collection as a new collection of PISDK.PIValue objects.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTrimExcess (Inherited from ListAFValue.)
Public methodTrueForAll (Inherited from ListAFValue.)
Top
Remarks
Examples
// This example shows how to create a dynamic attribute and obtain
// the values of an attribute over a specified time range.

// Get the Database
PISystems myPISystems = new PISystems();
PISystem myPISystem = myPISystems.DefaultPISystem;
AFDatabase myDB = myPISystem.Databases.DefaultDatabase;

// Create the Attribute
AFAttribute myAttribute = new AFAttribute(myDB);
myAttribute.Name = "Sinusoid";
myAttribute.Type = typeof(float);
myAttribute.DefaultUOM = myPISystem.UOMDatabase.UOMs["m"];
myAttribute.DataReferencePlugIn = AFDataReference.GetPIPointDataReference(myPISystem);
myAttribute.ConfigString = @"\\%Server%\Sinusoid";

// Set the Time Range
AFTimeRange myTimeRange = new AFTimeRange();
myTimeRange.StartTime = new AFTime(DateTime.UtcNow.AddHours(-1));
myTimeRange.EndTime = AFTime.Now;

// Display each Value of the Attribute during the Time Range
AFValues myValues = myAttribute.GetValues(myTimeRange, 0, null);
Console.WriteLine("Number of values = {0}", myValues.Count);
foreach (AFValue myValue in myValues)
{
    Console.WriteLine("Annotated = {0}", myValue.Annotated);
    Console.WriteLine("IsGood = {0}", myValue.IsGood);
    Console.WriteLine("Questionable = {0}", myValue.Questionable);
    Console.WriteLine("Substituted = {0}", myValue.Substituted);
    Console.WriteLine("TimeStamp = {0}", myValue.Timestamp.LocalTime);
    Console.WriteLine("UOM = {0}", myValue.UOM);
    Console.WriteLine("Value = {0}", myValue.Value);
}
Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
See Also
Enabling Operational Intelligence