spinetoolbox.project_items.exporter.widgets.parameter_merging_settings

Parameter merging settings widget.

author:
  1. Soininen (VTT)
date:

19.2.2020

Module Contents

spinetoolbox.project_items.exporter.widgets.parameter_merging_settings._ERROR_MESSAGE = <span style='color:#ff3333;white-space: pre-wrap;'>{}</span>[source]
class spinetoolbox.project_items.exporter.widgets.parameter_merging_settings.ParameterMergingSettings(entity_class_infos, parent, parameter_name=None, merging_setting=None)[source]

Bases: PySide2.QtWidgets.QWidget

A widget for configure parameter merging.

Parameters:
  • entity_class_infos (list) – list of EntityClassInfo objects
  • parent (QWidget) – a parent widget
  • parameter_name (str) – merged parameter name of None for widget
  • merging_setting (MergingSetting) – merging settings or None for empty widget
removal_requested[source]

Emitted when the settings widget wants to get removed from the parent window.

error_flags[source]
parameter_name[source]

Name of the merged parameter.

merging_setting(self)[source]

Constructs the MergingSetting object from the widget’s contents.

update(self, entity_class_infos)[source]

Updates the settings after database commit.

_check_state(self)[source]

Updates the message label according to widget’s error state.

_clear_flag(self, state)[source]

Clears a state flag.

_set_flag(self, state)[source]

Sets a state flag.

_reset_indexing_domains_label(self, domain_name=None, domain_names=None)[source]

Rewrites the contents of indexing_domains_label.

_update_parameter_name(self, name)[source]

Updates the merged parameter name.

_remove_self(self, _)[source]

Requests removal from the parent window.

_handle_domain_selection_change(self, selected, _)[source]

Resets the settings after another item has been selected in domains_list_view.

_update_indexing_domain_name(self, name)[source]

Resets indexing_domains_label.

_move_domain_left(self, _)[source]

Moves the new indexing domain left in indexing_domains_label.

_move_domain_right(self, _)[source]

Moves the new indexing domain left in indexing_domains_label.

class spinetoolbox.project_items.exporter.widgets.parameter_merging_settings._DomainNameListModel(entity_classes)[source]

Bases: PySide2.QtCore.QAbstractListModel

Model for domains_list_view.

Stores EntityClassInfo objects displaying the entity name in domains_list_view.

Parameters:entity_classes (list) – a list of EntityClassObjects
data(self, index, role=Qt.DisplayRole)[source]

Returns model’s data for given index.

headerData(self, section, orientation)[source]

Returns None.

index_for(self, set_name)[source]

Returns the QModelIndex for given set name.

item_at(self, row)[source]

Returns the EntityClassInfo object at given row.

rowCount(self, parent=QModelIndex())[source]

Returns the size of the model.

update(self, entity_classes)[source]

Updates the model.

class spinetoolbox.project_items.exporter.widgets.parameter_merging_settings._ParameterNameListModel(names)[source]

Bases: PySide2.QtCore.QAbstractListModel

Model for parameter_name_list_view.

Parameters:names (list) – list of parameter names to show in the view
data(self, index, role=Qt.DisplayRole)[source]

Returns the model’s data.

flags(self, index)[source]

Returns flags for given index.

headerData(self, section, orientation)[source]

Returns None.

reset(self, names)[source]

Resets the model’s contents when a new index is selected in domains_list_view.

rowCount(self, parent=QModelIndex())[source]

Returns the number of parameter names.

select(self, names)[source]

Selects parameters for inclusion in the merged parameter.

selected(self)[source]

Returns a list of the selected parameters.

setData(self, index, value, role=Qt.EditRole)[source]

Selects or deselects the parameter at given index for inclusion in the merged parameter.

update(self, names)[source]

Updates the parameter names keeping the previous selection where it makes sense.