Class FormulaDataArray
Last update: 09.03.2026Namespace: OpenTD.Results.Dataset
Assembly: OpenTD.Results.dll
A DerivedDataArray that generate values using a formula that references 0 or more arrays from its InputCollection.
public class FormulaDataArray : DerivedDataArray, IEnumerable<double>, IEnumerable
Inheritance
object ← DataArray ← DerivedDataArray ← FormulaDataArray
Implements
IEnumerable<double>, IEnumerable
Inherited Members
DerivedDataArray.InputCollection, DerivedDataArray.IgnoreNaNInCalculations, DerivedDataArray.SourceDataset, DerivedDataArray.SourceItem, DerivedDataArray.GetValues(UnitsData), DerivedDataArray.Count, DerivedDataArray.this[int], DerivedDataArray.GetSelfSuggestedName(), DerivedDataArray.SetDerivedData(), DerivedDataArray.CheckData(), DataArray.SetValues(IEnumerable<double>, DataSubtype, UnitsData, ItemIdentifier), DataArray.SourceDataset, DataArray.SourceItem, DataArray.Subtype, DataArray.SourceDataItem, DataArray.Dimension, DataArray.IsInteger, DataArray.GetValues(), DataArray.GetValues(UnitsData), DataArray.Count, DataArray.this[int], DataArray.ValuesSI, DataArray.CheckData(), DataArray.AutoNamer, DataArray.Name, DataArray.InternalSuggestedName, DataArray.GetSelfSuggestedName(), DataArray.ToString(), DataArray.AutoCommenter, DataArray.Comment, DataArray.InternalSuggestedComment, DataArray.GetSelfSuggestedComment(), DataArray.GetEnumerator(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
FormulaDataArray(DataArrayCollection)
public FormulaDataArray(DataArrayCollection inputCollection)
Parameters
inputCollection DataArrayCollection
FormulaDataArray()
public FormulaDataArray()
Properties
Formula
The formula to generate array values. Use "X0" to refer to the first array in the InputCollection, "X1" to refer to the second, etc. For formula syntax, see .NET docs for DataColumn.Expression. (https://docs.microsoft.com/en-us/dotnet/api/system.data.datacolumn.expression?view=netcore-3.1)
public string Formula { get; set; }
Property Value
FormulaUnits
The units the forumla is written in, if applicable. The FormulaDataArray will automatically convert the InputCollection to these units before applying the formula. This is necessary for a formula like "X0 + 30", for example, when X0 is a temperature and 30 is in deg C. Defaults to the WorkingUnits.
public UnitsData FormulaUnits { get; set; }
Property Value
UnitsData
OutputCount
The number of items contained in the output array. This defaults to the maximum Count of any input array (if there are input arrays) or to 1 if there are no input arrays. This value can be set by the user.
public int OutputCount { get; set; }
Property Value
Subtype
The subtype of the formula result. Defaults to dimensionless, but can be set by the user.
public override DataSubtype Subtype { get; set; }
Property Value
Methods
CheckData()
protected override void CheckData()
GetSelfSuggestedName()
protected override string GetSelfSuggestedName()
Returns
SetDerivedData()
For setting ValuesSI, any other derived data
protected override void SetDerivedData()