The DRE namespace

Import and export datasets in the DRE (Daimler Result Exchange) format.

Namespace List

ImportSettings
Settings used for the import of DRE datasets. ImportSettings is part of the DRE namespace.

Function List

DiscoverHierarchy (filename string, startPoint string)
Discovers the layout and contents of the specified DRE file starting at startPoint and returns it as a Lua table. No DataSet data is read. (Returns a table object.)
DiscoverHierarchy (filename string)
Discovers the layout and contents of the specified DRE file starting at the root and returns it as a Lua table. No DataSet data is read. (Returns a table object.)
ExportDataSet (dataset DataSet, filename string, dataSetPath string)
Writes the given DataSet object to a DRE file, using the label dataSetPath to determine the full path in the file. (Returns a boolean object.)
ImportDataSet (filename string, dataSetPath string)
Reads the specified DataSet from the specified DRE file and returns it as a Feko DataSet. (Returns a DataSet object.)
ImportDataSet (filename string, dataSetPath string, importSettings table)
Reads the specified DataSet from the specified DRE file and returns it as a Feko DataSet. (Returns a DataSet object.)
StoreData (filename string, dataSetPath string, type StoredDataTypeEnum)
Reads the specified DataSet from the specified DRE file and creates a stored copy of the DataSet. (Returns a ResultData object.)
StoreData (filename string, dataSetPath string, type StoredDataTypeEnum, importSettings table)
Reads the specified DataSet from the specified DRE file and creates a stored copy of the DataSet. (Returns a ResultData object.)

Function Details

DiscoverHierarchy (filename string, startPoint string)
Discovers the layout and contents of the specified DRE file starting at startPoint and returns it as a Lua table. No DataSet data is read.
Input Parameters
filename(string)
The name of the file to read.
startPoint(string)
A location in the file where reading will be started from.
Return
table
Table.
DiscoverHierarchy (filename string)
Discovers the layout and contents of the specified DRE file starting at the root and returns it as a Lua table. No DataSet data is read.
Input Parameters
filename(string)
The name of the file to read.
Return
table
Table.
Example
app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])

    -- Retrieve the far field data set

local farFieldDataSet = pf.FarField.GetDataSet("startup.StandardConfiguration1.FarFields")

    -- Export the data set to a new DRE file

local fileName = [[temp_startup.dre]]
pf.DRE.ExportDataSet(farFieldDataSet, fileName, "/")

    -- Inspect the DRE file hierarchy to determine the location of the data to import
    
local dreFileHierarchy = pf.DRE.DiscoverHierarchy(fileName)
inspect(dreFileHierarchy)

    -- The hierarchy is returned in a table containing the following notation:
    -- Attribute = { Name, Class, Data }
    -- Compound = { Name, Class, {Members} }
    -- Data = { {Dimensions}, Type, Class }
    -- DataSet = { Name, Class, {Attributes}, Data }
    -- Target = { Path , {Filename} }
    -- Error = { Message }
    -- Link = { Name, Class, LinkType, Target, {Error} }
    -- Group = { Name, Class, {Group|Link}, {Attributes}, {DataSet|Link} }

local drePath = "/"..dreFileHierarchy["Groups"][1].Name

local importedFarFieldDataSet = pf.DRE.ImportDataSet(fileName, drePath)
importedFarFieldDataSet:StoreData(pf.Enums.StoredDataTypeEnum.FarField)
ExportDataSet (dataset DataSet, filename string, dataSetPath string)
Writes the given DataSet object to a DRE file, using the label dataSetPath to determine the full path in the file.
Input Parameters
dataset(DataSet)
The dataset to export.
filename(string)
The name of the file to export the DataSet to.
dataSetPath(string)
The path that the DataSet will be exported to in the file.
Return
boolean
Boolean indicating success.
ImportDataSet (filename string, dataSetPath string)
Reads the specified DataSet from the specified DRE file and returns it as a Feko DataSet.
Input Parameters
filename(string)
The name of the file to import the DataSet from.
dataSetPath(string)
The path to the DRE data set to import.
Return
DataSet
DataSet.
ImportDataSet (filename string, dataSetPath string, importSettings table)
Reads the specified DataSet from the specified DRE file and returns it as a Feko DataSet.
Input Parameters
filename(string)
The name of the file to import the DataSet from.
dataSetPath(string)
The path to the DRE data set to import.
importSettings(table)
The settings used for DRE data import.
Return
DataSet
DataSet.
StoreData (filename string, dataSetPath string, type StoredDataTypeEnum)
Reads the specified DataSet from the specified DRE file and creates a stored copy of the DataSet.
Input Parameters
filename(string)
The name of the file to import the DataSet from.
dataSetPath(string)
The path to the DRE data set to import.
type(StoredDataTypeEnum)
The type of stored data entity specified by StoredDataTypeEnum, e.g. FarField, NearField, Custom, etc.
Return
ResultData
The new stored data.
StoreData (filename string, dataSetPath string, type StoredDataTypeEnum, importSettings table)
Reads the specified DataSet from the specified DRE file and creates a stored copy of the DataSet.
Input Parameters
filename(string)
The name of the file to import the DataSet from.
dataSetPath(string)
The path to the DRE data set to import.
type(StoredDataTypeEnum)
The type of stored data entity specified by StoredDataTypeEnum, e.g. FarField, NearField, Custom, etc.
importSettings(table)
The settings used for DRE data import.
Return
ResultData
The new stored data.