Skip to main content

OpenTD .NET4 reference 2025 R2

OpenTD.Results.Dataset.FormulaDataArray Class Reference

Last update: 16.07.2025

A DerivedDataArray that generate values using a formula that references 0 or more arrays from its InputCollection. More...

Inheritance diagram for OpenTD.Results.Dataset.FormulaDataArray:
OpenTD.Results.Dataset.DerivedDataArrayOpenTD.Results.Dataset.DataArrayOpenTD.Results.Dataset.IAutoNameOpenTD.Results.Dataset.IAutoComment

Public Member Functions

 FormulaDataArray (DataArrayCollection inputCollection)
 
 FormulaDataArray ()
 
override List< double > GetValues (UnitsData units)
 Gets the data in the units provided.
 
List< double > GetValues ()
 Gets the data in the current WorkingUnits.
 
virtual void SetValues (IEnumerable< double > values, DataSubtype subtype=null, UnitsData units=null, ItemIdentifier item=null)
 
override string ToString ()
 
IEnumerator< double > GetEnumerator ()
 

Static Public Member Functions

static implicit operator List< double > (DataArray x)
 
static implicit operator List< DataArray > (DataArray x)
 

Protected Member Functions

override string GetSelfSuggestedName ()
 
override void SetDerivedData ()
 For setting ValuesSI, any other derived data.
 
override void CheckData ()
 
virtual string GetSelfSuggestedComment ()
 

Protected Attributes

List< double > ValuesSI
 

Properties

string Formula [get, set]
 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)
 
UnitsData FormulaUnits [get, set]
 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.
 
override DataSubtype Subtype [get, set]
 The subtype of the formula result. Defaults to dimensionless, but can be set by the user.
 
int OutputCount [get, set]
 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.
 
DataArrayCollection InputCollection [get, set]
 The collection of DataArrays operated upon to derive data.
 
bool IgnoreNaNInCalculations [get, set]
 
override IDataset SourceDataset [get, set]
 The source Dataset for the InputCollection.
 
override ItemIdentifier SourceItem [get, set]
 The SourceItem for the InputCollection.
 
override int Count [get]
 
override double this[int index] [get, set]
 
DataItemIdentifier SourceDataItem [get]
 Combines the SourceItem and Subtype. If either are null, this is null.
 
UnitsData.UnitsType Dimension [get]
 The physical dimension of this data.
 
bool IsInteger [get]
 Returns true if the subtype of this data represents integer data.
 
AutoNamer AutoNamer [get, set]
 
string Name [get, set]
 
string InternalSuggestedName [get, set]
 
AutoCommenter AutoCommenter [get, set]
 
string Comment [get, set]
 
string InternalSuggestedComment [get, set]
 

Detailed Description

A DerivedDataArray that generate values using a formula that references 0 or more arrays from its InputCollection.

Constructor & Destructor Documentation

◆ FormulaDataArray() [1/2]

OpenTD.Results.Dataset.FormulaDataArray.FormulaDataArray ( DataArrayCollection inputCollection)
inline

◆ FormulaDataArray() [2/2]

OpenTD.Results.Dataset.FormulaDataArray.FormulaDataArray ( )
inline

Member Function Documentation

◆ CheckData()

override void OpenTD.Results.Dataset.FormulaDataArray.CheckData ( )
inlineprotectedvirtual

◆ GetEnumerator()

IEnumerator< double > OpenTD.Results.Dataset.DataArray.GetEnumerator ( )
inlineinherited

◆ GetSelfSuggestedComment()

virtual string OpenTD.Results.Dataset.DataArray.GetSelfSuggestedComment ( )
inlineprotectedvirtualinherited

◆ GetSelfSuggestedName()

override string OpenTD.Results.Dataset.FormulaDataArray.GetSelfSuggestedName ( )
inlineprotectedvirtual

◆ GetValues() [1/2]

List< double > OpenTD.Results.Dataset.DataArray.GetValues ( )
inlineinherited

Gets the data in the current WorkingUnits.

Returns
List<System.Double>.
See also
OpenTD.Units.WorkingUnits

◆ GetValues() [2/2]

override List< double > OpenTD.Results.Dataset.DerivedDataArray.GetValues ( UnitsData units)
inlinevirtualinherited

Gets the data in the units provided.

Parameters
unitsThe units to return the data in.
Returns
List<System.Double>.

Reimplemented from OpenTD.Results.Dataset.DataArray.

Reimplemented in OpenTD.Results.Dataset.SelectOneDataArray.

◆ operator List< DataArray >()

static implicit OpenTD.Results.Dataset.DataArray.operator List< DataArray > ( DataArray x)
inlinestaticinherited

◆ operator List< double >()

static implicit OpenTD.Results.Dataset.DataArray.operator List< double > ( DataArray x)
inlinestaticinherited

◆ SetDerivedData()

override void OpenTD.Results.Dataset.FormulaDataArray.SetDerivedData ( )
inlineprotectedvirtual

For setting ValuesSI, any other derived data.

Reimplemented from OpenTD.Results.Dataset.DerivedDataArray.

◆ SetValues()

virtual void OpenTD.Results.Dataset.DataArray.SetValues ( IEnumerable< double > values,
DataSubtype subtype = null,
UnitsData units = null,
ItemIdentifier item = null )
inlinevirtualinherited

◆ ToString()

override string OpenTD.Results.Dataset.DataArray.ToString ( )
inlineinherited

Member Data Documentation

◆ ValuesSI

List<double> OpenTD.Results.Dataset.DataArray.ValuesSI
protectedinherited

Property Documentation

◆ AutoCommenter

AutoCommenter OpenTD.Results.Dataset.DataArray.AutoCommenter
getsetprotectedinherited

◆ AutoNamer

AutoNamer OpenTD.Results.Dataset.DataArray.AutoNamer
getsetprotectedinherited

◆ Comment

string OpenTD.Results.Dataset.DataArray.Comment
getsetinherited

◆ Count

override int OpenTD.Results.Dataset.DerivedDataArray.Count
getinherited

◆ Dimension

UnitsData.UnitsType OpenTD.Results.Dataset.DataArray.Dimension
getinherited

The physical dimension of this data.

◆ Formula

string OpenTD.Results.Dataset.FormulaDataArray.Formula
getset

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)

◆ FormulaUnits

UnitsData OpenTD.Results.Dataset.FormulaDataArray.FormulaUnits
getset

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.

◆ IgnoreNaNInCalculations

bool OpenTD.Results.Dataset.DerivedDataArray.IgnoreNaNInCalculations
getsetinherited

◆ InputCollection

DataArrayCollection OpenTD.Results.Dataset.DerivedDataArray.InputCollection
getsetinherited

The collection of DataArrays operated upon to derive data.

The input collection.

◆ InternalSuggestedComment

string OpenTD.Results.Dataset.DataArray.InternalSuggestedComment
getsetinherited

◆ InternalSuggestedName

string OpenTD.Results.Dataset.DataArray.InternalSuggestedName
getsetinherited

◆ IsInteger

bool OpenTD.Results.Dataset.DataArray.IsInteger
getinherited

Returns true if the subtype of this data represents integer data.

◆ Name

string OpenTD.Results.Dataset.DataArray.Name
getsetinherited

◆ OutputCount

int OpenTD.Results.Dataset.FormulaDataArray.OutputCount
getset

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.

◆ SourceDataItem

DataItemIdentifier OpenTD.Results.Dataset.DataArray.SourceDataItem
getinherited

Combines the SourceItem and Subtype. If either are null, this is null.

◆ SourceDataset

override IDataset OpenTD.Results.Dataset.DerivedDataArray.SourceDataset
getsetinherited

The source Dataset for the InputCollection.

The source dataset.

Exceptions
OpenTDExceptionCannot set DerivedDataArray.SourceDataset directly. It will be derived from InputArrays.

◆ SourceItem

override ItemIdentifier OpenTD.Results.Dataset.DerivedDataArray.SourceItem
getsetinherited

The SourceItem for the InputCollection.

The source item.

Exceptions
OpenTDExceptionCannot set DerivedDataArray.SourceItem directly. It will be derived from InputArrays.

◆ Subtype

override DataSubtype OpenTD.Results.Dataset.FormulaDataArray.Subtype
getset

The subtype of the formula result. Defaults to dimensionless, but can be set by the user.

◆ this[int index]

override double OpenTD.Results.Dataset.DerivedDataArray.this[int index]
getsetinherited

The documentation for this class was generated from the following file:
  • C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/TDDEV_ALPHA/buildXX/OpenTD.Results/Dataset/FormulaDataArray.cs

Connect with Ansys