spinetoolbox.project_items.exporter.widgets.parameter_merging_settings_window

Parameter merging settings window.

author:
  1. Soininen (VTT)
date:

19.2.2020

Module Contents

class spinetoolbox.project_items.exporter.widgets.parameter_merging_settings_window.ParameterMergingSettingsWindow(merging_settings, database_path, parent)[source]

Bases: PySide2.QtWidgets.QWidget

A window which shows a list of ParameterMergingSettings widgets, one for each merged parameter.

Parameters:
  • merging_settings (dict) – a map from merged parameter name to merging settings
  • database_path (str) – database URL
  • parent (QWidget) – a parent widget
settings_approved[source]

Emitted when the settings have been approved.

settings_rejected[source]

Emitted when the settings have been rejected.

merging_settings[source]

a dict that maps merged parameter names to their merging settings

update(self)[source]

Updates the settings according to changes in the database.

_add_setting(self, parameter_name=None, merging_setting=None)[source]

Inserts a new settings widget to the widget list.

_ok_to_accept(self)[source]

Returns True if it is OK to accept the settings, otherwise shows a warning dialog and returns False.

_add_empty_setting(self, _)[source]

Adds an empty settings widget to the widget list.

_remove_setting(self, settings_widget)[source]

Removes a setting widget from the widget list.

_collect_and_hide(self)[source]

Collects settings from individual ParameterMergingSettings widgets and hides the window.

_reject_and_close(self)[source]

Emits settings_rejected and closes the window.

class spinetoolbox.project_items.exporter.widgets.parameter_merging_settings_window.EntityClassInfo(name, class_id, domain_names, parameter_names, is_object_class)[source]

Contains information of an entity class (object or relationship class) for use in the parameter merging widget.

name

entity’s name

Type:str
class_id

entity’s database id

Type:int
domain_names

object classes that index the entities in this class; for object classes this list contains the entity’s name only, for relationship classes the list contains the relationship’s object classes

Type:list
parameter_names

entity’s defined parameters

Type:list
is_object_class

True if the entity is a object class, False if it is a relationship class

Type:bool
Parameters:
  • name (str) – entity’s name
  • class_id (int) – entity’s database id
  • domain_names (list) – object classes that index the entities in this class; for object classes this list contains the entity’s name only, for relationship classes the list contains the relationship’s object classes
  • parameter_names (list) – entity’s defined parameters
  • is_object_class (bool) – True if the entity is a object class, False if it is a relationship class
spinetoolbox.project_items.exporter.widgets.parameter_merging_settings_window._gather_entity_class_infos(db_map)[source]

Collects entity class infos from database.

Parameters:db_map (spinedb_api.DatabaseMapping) – a database map
Returns:a list of EntityClassInfo objects
Return type:list