PowerCollection

A collection of power results.

Example

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

powerCollection = app.Models[1].Configurations[1].Power

    -- Add the first power to a Cartesian graph 
    
graph = app.CartesianGraphs:Add()
powerTrace1 = graph.Traces:Add(powerCollection[1]) -- Index method
powerTrace2 = graph.Traces:Add(powerCollection["Power"]) -- Name method

    -- Add all the powers in the collection to the graph

for index, powerData in pairs(powerCollection) do
    powerTrace = graph.Traces:Add(powerData)
end

Usage locations (collections)

The following objects contain the PowerCollection collection:

Property List

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

Method List

Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
Item (index number)
Returns the PowerData at the given index. (Returns a PowerData object.)
Item (label string)
Returns the PowerData with the given label. (Returns a PowerData object.)
Items ()
Returns a table of PowerData. (Returns a List of PowerData 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 PowerData at the given index in the collection. (Read PowerData)
[string]
Returns the PowerData with the given name in the collection. (Read PowerData)

Property Details

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

Method Details

Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the PowerData.
Return
boolean
The success of the check.
Item (index number)
Returns the PowerData at the given index.
Input Parameters
index(number)
The index of the PowerData.
Return
PowerData
The PowerData at the given index.
Item (label string)
Returns the PowerData with the given label.
Input Parameters
label(string)
The label of the PowerData.
Return
PowerData
The PowerData with the given label.
Items ()
Returns a table of PowerData.
Return
List of PowerData
A table of PowerData.
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 PowerData.