ModelMappingItem

class ModelMappingItem

Returned by

AddEnumeration(text, value)

Adds a (text: value) pair to an existing enumeration. Creates a new enumeration if none exists.

Parameters:
text : str

Text to show instead of the value

value : int

Value that should be mapped

AllowOtherRaster(forceRaster)

Set that the registration of the raster should be enforced

Parameters:
forceRaster : bool

Set if the specified raster should be enforced or not

Clone()

Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.

Returns:

A copy of this object

Return type:

ModelMappingItem

GetAccessType()

Returns a string identifying the mapping item’s type. (such as MODEL, BUS, MEASUREMENT, …)

Returns:

access type

Return type:

str

GetCategory()

Returns the category

Returns:

Category

Return type:

str

GetDataType()

Returns the data type.

Returns:

The data type or an empty string if the mapping item does not support enforcing a data type.

Return type:

str

GetDescription()

Returns the description

Returns:

Description

Return type:

str

GetDisplayedType()

Returns a “nice” representation of the type as displayed in the “type” column of the mapping panel

Returns:

the displayed mapping type

Return type:

str

GetEnumeration()

Returns the enumeration of the mapping item.

Returns:

Dictionary with the (text: value) pairs.

Return type:

dict[str, int]

GetFallbackUnit()

Returns name of the fallback unit of the mapping item.

Returns:

The fallback unit name

Return type:

str

GetRaster()

Returns the raster of the mapping item.

Returns:

Raster

Return type:

str

GetReferenceName()

Returns the reference name of the mapping.

Returns:

The reference name of the mapping

Return type:

str

GetSubMapping()

Returns contained Mapping or None if item does not support sub-mappings.

Returns:

Mapping with all submappings of the mapping item

Return type:

Mapping

GetSystemIdentifier()

Returns the system identifier providing the currently mapped test quantity

Returns:

system identifier

Return type:

str

GetTargetPath()

Returns the path this mapping item is currently pointing at

Returns:

complete path to the destination test quantity

Return type:

str

GetUnit()

Returns the unit of the mapping item. The returned unit depends on the current state of ecu.test. If the mapping item points to an invalid path (e.g. if no configuration has been started) this method will always return ‘dont care’. If the mapping is valid this method returns the unit provided by the corresponding model tool. If the tool does not provide a unit, the fallback unit will be returned.

Returns:

The unit of the mapping item. May be None if the unit is not set.

Return type:

str

GetVariableType()

Returns the type of the target variable or None if target has no type.

Returns:

The type of the target variable. (e.g. VALUE, MATRIX, CURVE, …)

Return type:

str

IsAutogenerated()

Returns whether the mapping item is autogenerated.

Returns:

True, if autogenerated flag is set, else False

Return type:

boolean

IsOtherRasterAllowed()

Returns if the registration of the raster should be enforced

Returns:

Name of selected raster

Return type:

bool

RemoveEnumeration()

Removes the enumeration of the mapping item.

SetAutogenerated(value=True)

Sets whether the mapping item is autogenerated.

Parameters:
value : boolean

The new state.

SetCategory(category)

Sets the category

Parameters:
category : str

The new category to be used

SetDescription(description)

Sets the description

Parameters:
description : str

The new description to be used

SetEnumeration(vtabDict)

Sets the enumeration of the mapping item.

Parameters:
vtabDict : dict[str, int]

Dictionary with the (text: value) pairs.

SetFallbackUnit(reference)

Sets the fallback unit that will be used if the model does not provide a unit for this variable. An empty string deletes the currently set fallback unit. You can find a full list of units in the .workspace folder in “units.spec” in the ecu.test workspace. Please specify the short name of the corresponding unit.

Parameters:
reference : str

The unit reference (short name)

SetRaster(rasterName)

Sets the enumeration of the mapping item.

Parameters:
rasterName : str

Raster to be set

Returns:

True if the raster has changed, else False

Return type:

bool

SetReferenceName(name, updateTestSteps=False)

Sets the reference name of the mapping.

Parameters:
name : str

The reference name of the mapping

updateTestSteps : bool

update all usages of this mapping item. Throws an error if it is used in a global mapping or if it is not yet part of a mapping space.