Class DataArray
Last update: 09.03.2026Namespace: OpenTD.Results.Dataset
Assembly: OpenTD.Results.dll
Data is returned from Datasets in the form of DataArrays, which in addition to containing the actual data, also know the physical dimension of the data, what units it is in, and have a reference to the Dataset it came from. Use the GetValues methods to get the data as lists of doubles, or use DataArrays directly as inputs to SimplePlots.
public class DataArray : IEnumerable<double>, IEnumerable
Inheritance
Derived
Implements
IEnumerable<double>, IEnumerable
Inherited Members
object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()
Constructors
DataArray(DataItemIdentifier, IEnumerable<double>, UnitsData)
public DataArray(DataItemIdentifier dataItem, IEnumerable<double> values, UnitsData units)
Parameters
dataItem DataItemIdentifier
values IEnumerable<double>
units UnitsData
DataArray()
public DataArray()
DataArray(IEnumerable<double>)
Initializes a new instance of the
public DataArray(IEnumerable<double> values)
Parameters
values IEnumerable<double>
The values.
DataArray(DataSubtype, IEnumerable<double>, UnitsData, ItemIdentifier)
public DataArray(DataSubtype subtype, IEnumerable<double> values, UnitsData units, ItemIdentifier item = null)
Parameters
subtype DataSubtype
values IEnumerable<double>
units UnitsData
item ItemIdentifier
DataArray(DataArray)
public DataArray(DataArray x)
Parameters
Fields
ValuesSI
protected List<double> ValuesSI
Field Value
Properties
AutoCommenter
protected AutoCommenter AutoCommenter { get; set; }
Property Value
AutoCommenter
AutoNamer
protected AutoNamer AutoNamer { get; set; }
Property Value
AutoNamer
Comment
public string Comment { get; set; }
Property Value
Count
The number of items in this DataArray.
public virtual int Count { get; }
Property Value
Dimension
The physical dimension of this data.
public UnitsData.UnitsType Dimension { get; }
Property Value
UnitsData.UnitsType
InternalSuggestedComment
public string InternalSuggestedComment { get; set; }
Property Value
InternalSuggestedName
public string InternalSuggestedName { get; set; }
Property Value
IsInteger
Returns true if the subtype of this data represents integer data.
public bool IsInteger { get; }
Property Value
Name
public string Name { get; set; }
Property Value
SourceDataItem
Combines the SourceItem and Subtype. If either are null, this is null.
public DataItemIdentifier SourceDataItem { get; }
Property Value
SourceDataset
The source Dataset for this data.
public virtual IDataset SourceDataset { get; }
Property Value
SourceItem
Identifies the item (node, lump, register, etc.) this data came from.
public virtual ItemIdentifier SourceItem { get; }
Property Value
Subtype
The DataSubtype (T, TL, PL, GTX, etc.)
public virtual DataSubtype Subtype { get; set; }
Property Value
this[int]
public virtual double this[int index] { get; set; }
Property Value
Methods
CheckData()
protected virtual void CheckData()
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<double> GetEnumerator()
Returns
An enumerator that can be used to iterate through the collection.
GetSelfSuggestedComment()
protected virtual string GetSelfSuggestedComment()
Returns
GetSelfSuggestedName()
protected virtual string GetSelfSuggestedName()
Returns
GetValues()
Gets the data in the current WorkingUnits.
public List<double> GetValues()
Returns
List<System.Double>.
See Also
Units.WorkingUnits
GetValues(UnitsData)
Gets the data in the units provided.
public virtual List<double> GetValues(UnitsData units)
Parameters
units UnitsData
The units to return the data in.
Returns
List<System.Double>.
SetValues(IEnumerable<double>, DataSubtype, UnitsData, ItemIdentifier)
public virtual void SetValues(IEnumerable<double> values, DataSubtype subtype = null, UnitsData units = null, ItemIdentifier item = null)
Parameters
values IEnumerable<double>
subtype DataSubtype
units UnitsData
item ItemIdentifier
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
A string that represents the current object.
Operators
implicit operator List<double>(DataArray)
public static implicit operator List<double>(DataArray x)
Parameters
Returns
implicit operator List<DataArray>(DataArray)
public static implicit operator List<DataArray>(DataArray x)
Parameters
Returns
See Also
Dataset, IAutoName, SimplePlot