Data source#
A data source is a particular node used to produce flows from the content of a simulation data (*.sd). The simulation data file is given by a key in the project Resources. The data source exposes the signals in the data source as outputs.
To include a data source in a test harness, use the DiagramCreator.add_data_source() method.
DataSource class#
- class ansys.scadeone.core.swan.DataSource(id: Identifier)#
Bases:
OperatorExpressionClass representing a source in the harness.
- get_full_path() str#
Full path of the Swan construct.
This method is implemented by derived classes that correspond to a declaration at the module level (such as sensor, type, group, const, operator), or a module itself.
- Returns:
strPath within the owner and name of the Swan construct.
- Raises:
ScadeOneExceptionIf the method is not implemented for the current SwanItem type.
- static set_owner(owner: SwanItem | IModel | None, children: SwanItem | Iterable[SwanItem] | None) None#
Helper to set owner as the owner of each item in the Iterable items.
- property id: Identifier#
DataSource key as identifier.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property model: IModel#
Return model containing the Swan item.
- property module: ModuleBase | None#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBodyandModuleInterfaceor None if the object is itself a module.