spinetoolbox.project_items.exporter.widgets.parameter_index_settings

Parameter indexing settings window for .gdx export.

author:
  1. Soininen (VTT)
date:

26.11.2019

Module Contents

Classes

IndexSettingsState An enumeration indicating the state of the settings window.
ParameterIndexSettings A widget showing setting for a parameter with indexed values.

Functions

_freely_update_domains_combo(widget) A context manager which temporarily disables the monitoring of current text changes in domains combo box.
class spinetoolbox.project_items.exporter.widgets.parameter_index_settings.IndexSettingsState[source]

Bases: enum.Enum

An enumeration indicating the state of the settings window.

Create and return a new object. See help(type) for accurate signature.

OK[source]
DOMAIN_MISSING_INDEXES[source]
class spinetoolbox.project_items.exporter.widgets.parameter_index_settings.ParameterIndexSettings(parameter_name, indexing_setting, available_domains, parent)[source]

Bases: PySide2.QtWidgets.QWidget

A widget showing setting for a parameter with indexed values.

Parameters:
  • parameter_name (str) – parameter’s name
  • indexing_setting (IndexingSetting) – indexing settings for the parameter
  • available_domains (dict) – a dict from existing domain name to Records
  • parent (QWidget, optional) – a parent widget
state[source]

widget’s state

indexing_domain_name(self)[source]

Returns the selected indexing domain’s name

Returns:domain name
Return type:str
picking(self)[source]

Returns picking.

Returns:picking
Return type:Picking
set_domains(self, domains)[source]

Sets new domains and record keys.

Parameters:domains (dict) – mapping from domain name to records
set_domains_combo_monitoring_enabled(self, enabled)[source]

Enables or disables monitoring of current text in domains combo box.

Parameters:enabled (bool) – True enables monitoring, False disables
update_domain_name(self, old_name, new_name)[source]

Renames a domain.

Parameters:
  • old_name (str) – previous name
  • new_name (str) – new name
update_records(self, domain_name)[source]

Updates existing domain’s records.

Parameters:domain_name (str) – domain’s name
notification_message(self, message)[source]

Shows a notification message on the widget.

warning_message(self, message)[source]

Shows a warning message on the widget.

error_message(self, message)[source]

Shows an error message on the widget.

_check_state(self)[source]

Updated the widget’s state.

_check_errors(self, mapped_values_balance)[source]

Checks if the parameter is correctly indexed.

_check_warnings(self, mapped_values_balance)[source]

Checks if there are non-fatal issues with parameter indexing.

_update_indexing_domains_name(self)[source]

Updates the model’s header and the label showing the indexing domains.

_clear_pick_expression_silently(self)[source]

Clears the pick expression line edit.

_change_domain(self, domain_name)[source]

Change the domain used on the table.

_update_index_list_selection(self, expression)[source]

Updates selection according to changed selection expression.

_move_indexing_domain_left(self, _)[source]

Moves the indexing domain name left on the indexing label.

_move_indexing_domain_right(self, _)[source]

Moves the indexing domain name right on the indexing label.

spinetoolbox.project_items.exporter.widgets.parameter_index_settings._freely_update_domains_combo(widget)[source]

A context manager which temporarily disables the monitoring of current text changes in domains combo box.

Parameters:widget (ParameterIndexSettings) – settings widget