DataSetQuantityCollection

A data set contains a collection of quantities. A handle can be obtained on an individual quantity, or new quantity can be added to the collection by using the DataSetQuantityCollection.

Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])

    -- Retrieve the far field data set
    
farFieldDataSet = app.Models[1].Configurations[1].FarFields["FarFields"]:GetDataSet(51)

    -- Print a list of the far field quantities
    
printlist( farFieldDataSet.Quantities:Items() )

    -- Access information about the "EFieldTheta" quantity
    
EFieldThetaQuantity = farFieldDataSet.Quantities["EFieldTheta"]
quantityName = EFieldThetaQuantity.Name
quantityType = EFieldThetaQuantity.QuantityType
quantityUnit = EFieldThetaQuantity.Unit

    -- Add a new quantity to the collection
    
farFieldDataSet.Quantities:Add("Threshold", pf.Enums.DataSetQuantityTypeEnum.Scalar, "")

    -- Access the 'EFieldTheta' value at the first frequency, theta and phi point

EFieldThetaValue = farFieldDataSet[1][1][1].EFieldTheta

    -- Set the value of the new 'Threshold' quantity at the first frequency, theta and phi point
    
farFieldDataSet[1][1][1].Threshold = 2

Usage locations

The DataSetQuantityCollection object can be accessed from the following locations:

Property List

Count
The number of DataSetQuantity items in the collection. (Read only number)
Type
The object type string. (Read only string)

Method List

Add (name string, type DataSetQuantityTypeEnum, unit Unit)
Adds a new quantity to the data set. (Returns a DataSetQuantity object.)
Add (quantity DataSetQuantity)
Adds a copy of the quantity. (Returns a DataSetQuantity object.)
Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
Item (index number)
Returns the DataSetQuantity at the given index. (Returns a DataSetQuantity object.)
Item (label string)
Returns the DataSetQuantity with the given label. (Returns a DataSetQuantity object.)
Items ()
Returns a table of DataSetQuantity. (Returns a List of DataSetQuantity object.)
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated. (Returns a boolean object.)

Index List

[number]
Returns the DataSetQuantity at the given index in the collection. (Read DataSetQuantity)
[string]
Returns the DataSetQuantity with the given name in the collection. (Read DataSetQuantity)

Property Details

Count
The number of DataSetQuantity items in the collection.
Type
number
Access
Read only
Type
The object type string.
Type
string
Access
Read only

Method Details

Add (name string, type DataSetQuantityTypeEnum, unit Unit)
Adds a new quantity to the data set.
Input Parameters
name(string)
The name of the quantity.
type(DataSetQuantityTypeEnum)
The type of the quantity (e.g. “Complex” or “Scalar”).
unit(Unit)
The SI unit of the quantity.
Return
DataSetQuantity
The new quantity.
Add (quantity DataSetQuantity)
Adds a copy of the quantity.
Input Parameters
quantity(DataSetQuantity)
The quantity to add a copy of. This is used when copying quantities of existing DataSets.
Return
DataSetQuantity
A replica of the provided quantity.
Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the DataSetQuantity.
Return
boolean
The success of the check.
Item (index number)
Returns the DataSetQuantity at the given index.
Input Parameters
index(number)
The index of the DataSetQuantity.
Return
DataSetQuantity
The DataSetQuantity at the given index.
Item (label string)
Returns the DataSetQuantity with the given label.
Input Parameters
label(string)
The label of the DataSetQuantity.
Return
DataSetQuantity
The DataSetQuantity with the given label.
Items ()
Returns a table of DataSetQuantity.
Return
List of DataSetQuantity
A table of DataSetQuantity.
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated.
Input Parameters
label(string)
The base name.
Return
boolean
The generated unique name label for DataSetQuantity.