StimulationPackageCall

class StimulationPackageCall

A stimulation package call (of a package) in a project.

Returned by

ActivateAutomaticValueRestore()

Activates value restore of test quantities after the execution of every Package.

AddParameterGenerator(name, generatorId)

Adds a parameter generator to the package call

Parameters:
name : str

Name of the parameter generator

generatorId : str

Unique generator id of generator to be added

Returns:

The parameter generator

Return type:

ParameterGenerator

AddParameterSet(name, index=None)

Adds a parameter set to the stimulation package call

Parameters:
name : str

Name of the parameter set

index : int

Zero base index to insert the parameter set inside the package call

Returns:

The parameter set

Return type:

ParameterSet

AddParameterVariationGenerator(name)

Adds a parameter variation generator to the stimulation package call.

Parameters:
name : str

Name of the parameter variation generator.

Returns:

The parameter variation generator.

Return type:

ParameterVariationGeneratorComponent

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:

StimulationPackageCall

CreateAnalysisPackageMappingCalls(onlyMissing=False)

Creates an analysis package mapping call for each analysis requested in the stimulation package.

Parameters:
onlyMissing : bool

If True, only analysis package mapping calls not yet added to the project are created.

Returns:

list of analysis package mapping calls

Return type:

list[AnalysisPackageMappingCall]

Raises:

ApiError – If called with onlyMissing=True, without adding the stimulation call to the project first.

DeactivateAutomaticValueRestore()

Deactivate value restore of test quantities after the execution of every Package.

GetAbsolutePath()

Returns the absolute path to referenced package.

Returns:

Absolute path to referenced package

Return type:

str

GetAnalysisBindings()

Returns the configured bindings between this stimulation package and the attached analysis packages.

Returns:

All signal group references

Return type:

AnalysisBindings

GetAnalysisPackageCalls(skipDisabled=True, noParameterSets=False)

Returns all analysis package calls of the project referencing this stimulation package call. Analysis package calls that reference “all previous stimulations” are included (if they are inserted behind the stimulation package call in the project).

Parameters:
skipDisabled : boolean

Defines whether disabled package calls should be excluded.

noParameterSets : boolean

Defines whether package calls with parameter sets should be excluded.

Returns:

Package calls

Return type:

list[AnalysisPackageCall]

GetComponents()

Returns all direct children of the package call.

Returns:

List with all children components

Return type:

list[ProjectComponent]

GetCustomRetryCondition()

Returns the condition of the custom retries. Returns one of the following:

  • ‘ERROR’

  • ‘FAILED’

  • ‘ERROR/FAILED’

Returns:

The condition of the custom retry

Return type:

str

GetCustomRetryCount()

Returns the number of the retries defined on the project component.

Returns:

Number of the custom retries

Return type:

integer

GetErrorRecoveryPkgLevel()

Returns the conditions under which the error recovery package (configured via SetErrorRecoveryPkgPath()) will be executed

This overrides settings from the parent element or from the test configuration.

Returns:

  • -1 = disabled

  • 0 = on abort only

  • 1 = on ERROR and on abort

  • 2 = on FAILED, ERROR and abort.

  • None: use inherited setting from parent element or test configuration

Return type:

int

GetErrorRecoveryPkgPath()

Returns the path of the error recovery Package to be executed upon abort of test execution or ERROR/FAILED, if this element has a custom setting which overrides inherited settings from the parent element or from the test configuration.

see also GetErrorRecoveryPkgLevel()

Returns:

Absolute path to Package file; None if inherited or explicitly disabled

Return type:

str

GetIndex()

Returns the zero based index in the parent.

Returns:

Zero based index

Return type:

int

GetLineNo()

Returns the line number within its project.

Returns:

Line number

Return type:

int

GetName()

Returns the name of the project component.

Returns:

Name of the component

Return type:

str

GetPackage()

Returns the referenced stimulation package.

Note:

The returned package object is a reference. If this object is used to manipulate the content all references in this project are affected.

Returns:

referenced package

Return type:

Package

Raises:

ApiError – If the referenced package file (*.pkg) does not exist.

GetParameterGenerators(skipDisabled=True)

Returns all parameter generators of the package call.

Parameters:
skipDisabled : bool

Defines whether disabled components should be included.

Returns:

The parameter generators.

Return type:

list[ParameterGenerator]

GetParameterSets(skipDisabled=True)

Returns all parameter sets of the package call.

Parameters:
skipDisabled : bool

Defines whether disabled components should be included.

Returns:

Parameter sets

Return type:

list[ParameterSet]

GetParameterVariationGenerators(skipDisabled=True)

Returns all parameter variation generators of the stimulation package call.

Parameters:
skipDisabled : bool

Defines whether disabled generators should be excluded.

Returns:

The parameter variation generators.

Return type:

list[ParameterVariationGeneratorComponent]

GetParent()

Returns the parent project component.

Returns:

Parent component

Return type:

ProjectComponent

GetProjectRelativePath()

Returns the file project relative path of the referenced package.

The returned path is a relative path, its base is the folder where the calling project is located, just like the path is shown in the package test step’s dialog.

Returns:

File name with relative path of the package to be called.

Return type:

str

Raises:

ProjectNotSavedError – If this method is called before project is saved.

GetRequestedAnalysisLabels()

Returns the trace analysis label that are requested by this package.

Returns:

The list for requested analysis labels.

Return type:

list[str]

GetTestCaseId()

Returns the test case id of the package test component.

Returns:

Test case id.

Return type:

str

GetTestScriptId()

Returns the test script id of the corresponding package will be returned.

Returns:

Test script id.

Return type:

str

GetType()
Returns the type (class name) of the project component, e.g.
  • “ConfigChange”

  • “ParameterSet”

  • “PackageCall”

  • “Project”

  • “PackageGenerator”

Returns:

Type (class name) of the project component

Return type:

str

HasComponents()

Returns whether the package call has children.

Returns:

True if there are children, False otherwise.

Return type:

bool

HasCustomErrorRecoveryPackageSettings()

Returns whether the Package execution settings in case of test abort or ERROR/FAILED of the parent element are overridden

Returns:

True if this element has custom error recovery package settings that override the parent element’s settings or those from the test configuration

Return type:

boolean

HasCustomRestoreSettings()

Returns if the value restore settings of the parent element are used or overridden by custom settings

Returns:

True if custom settings used, False if parent settings used

Return type:

boolean

HasCustomRetrySettings()

Returns if the retry settings of the parent element are used

Returns:

True if parent settings used, False if custom settings defined

Return type:

boolean

InsertParameterSet(parameterSet, index=None)

Adds a parameter set to the package call

Parameters:
parameterSet

parameter set

index : int

Zero based index to insert the parameter set inside the package call

IsAutomaticValueRestoreActivated()

Returns if the automatic value restore is activated

Returns:

True if activated, else False

Return type:

boolean

IsAutomaticValueRestoreDeactivated()

Returns if the automatic value restore is deactivated

Returns:

True if deactivated, else False

Return type:

boolean

IsEnabled()

Returns the state of the test step.

Returns:

True if test step is enabled, otherwise False

Return type:

bool

IsReported()

Returns whether the test step will be reported. If it has a parent test step, this function will only return true if both this test step and the parent test step should be reported.

Returns:

True if test step will be reported, otherwise False

Return type:

bool

RemoveFromProject()

Removes this component from the project.

Raises:

ApiError – if the component is not part of any project

RemoveParameterGenerator(paramGenerator)

Removes a parameter generator from the package call.

Parameters:
paramGenerator

The parameter generator to be removed

Raises:

ApiError –

  • If the given parameter generator is not part if the package call

  • If paramGenerator ist not of type ParameterGenerator

RemoveParameterSet(paramSet)

Removes a parameter set from the stimulation package call.

Parameters:
paramSet

The parameter set to be removed

Raises:

ApiError –

  • If the given parameter set is not part if the package call

  • If paramGenerator ist not of type ParameterSet

RemoveParameterVariationGenerator(paramVariationGenerator)

Removes a parameter variation generator from the stimulation package call.

Parameters:
paramVariationGenerator

The parameter variation generator to be removed.

Raises:

ApiError –

SetCustomRetryCondition(condition)

Sets the condition of the custom retry. Must be one of the following:

  • ‘ERROR’

  • ‘FAILED’

  • ‘ERROR/FAILED’

Parameters:
condition : str

The condition of the custom retry

SetCustomRetryCount(count)

Sets the number of the retries for all Packages within the project component.

Parameters:
count : integer

Number of the custom retries

SetEnabled(state=True)

Enable or disable the test step.

Parameters:
state : bool

True (=Default) to enable, False to disable the test step.

SetErrorRecoveryPkgLevel(level)

Sets the conditions under which the error recovery package (configured via SetErrorRecoveryPkgPath()) will be executed

This overrides settings from the parent element or from the test configuration.

Parameters:
level : int

  • -1

    disabled

  • 0 on abort only

  • 1 on ERROR and on abort

  • 2 on FAILED, ERROR and abort.

SetErrorRecoveryPkgPath(packagePath)

Sets the path for a Package to be executed upon abort of test execution or ERROR/FAILED.

This overrides settings from the parent element or from the test configuration.

See also SetErrorRecoveryPkgLevel()

Parameters:
packagePath : str

Absolute path to Package file

SetName(name)

Sets the name of the project component.

Parameters:
name : str

Name of the component

SetReported(state=True)

Enable or disable the reporting of the test step. If it has a parent test step, its reporting must also be enabled in order to have this test step appear in the report.

Parameters:
state : bool

True (=Default) to enable, False to disable the reporting of the test step.

SetTestCaseId(testCaseId)

Sets the test case id of the current package test.

Parameters:
testCaseId : str

Test case id

UseParentErrorRecoveryPackageSettings()

Sets that the Package execution settings in case of test abort or ERROR/FAILED of the parent element are used. Existing custom settings are deleted.

UseParentRetrySettings()

Sets that the retry settings of the parent element are used. Existing custom settings are deleted.

UseParentValueRestoreSettings()

Sets that the settings whether to restore the value of test quantities after the execution of every Package of the parent element are used. Existing custom settings are deleted.

GetPosition()

Returns the position in the parent project.

Returns:

parent position

Return type:

int

Deprecated since version 2024.4: Please use method GetLineNo instead.