spinetoolbox.project_items.exporter.widgets.gdx_export_settings
¶
Export item’s settings window for .gdx export.
author: |
|
---|---|
date: | 9.9.2019 |
Module Contents¶
-
class
spinetoolbox.project_items.exporter.widgets.gdx_export_settings.
State
[source]¶ Bases:
enum.Enum
Gdx Export Settings window state
-
class
spinetoolbox.project_items.exporter.widgets.gdx_export_settings.
GdxExportSettings
(settings, indexing_settings, new_indexing_domains, merging_settings, new_merging_domains, database_path, parent)[source]¶ Bases:
PySide2.QtWidgets.QWidget
A setting window for exporting .gdx files.
Parameters: - settings (Settings) – export settings
- indexing_settings (dict) – indexing domain information for indexed parameter values
- new_indexing_domains (list) – list of additional domains needed for indexed parameter
- merging_settings (dict) – parameter merging settings
- new_merging_domains (list) – list of additional domains needed for parameter merging
- database_path (str) – database URL
- parent (QWidget) – a parent widget
-
reset_settings
(self, settings, indexing_settings, new_indexing_domains, merging_settings, new_merging_domains)[source]¶ Resets all settings.
-
_populate_global_parameters_combo_box
(self, settings)[source]¶ (Re)populates the global parameters combo box.
-
_update_new_domains_list
(self, domains, old_list)[source]¶ Merges entries from new and old domain lists.
-
_populate_set_contents
(self, selected, _)[source]¶ Populates the record list by the selected domain’s or set’s records.
-
_approve_parameter_indexing_settings
(self)[source]¶ Gathers settings from the indexed parameters settings window.
-
_parameter_merging_approved
(self)[source]¶ Collects merging settings from the parameter merging window.
-
class
spinetoolbox.project_items.exporter.widgets.gdx_export_settings.
GAMSSetListModel
(settings)[source]¶ Bases:
PySide2.QtCore.QAbstractListModel
A model to configure the domain and set name lists in gdx export settings.
This model combines the domain and set name lists into a single list. The two ‘parts’ are differentiated by different background colors. Items from each part cannot be mixed with the other. Both the ordering of the items within each list as well as their exportability flags are handled here.
Parameters: settings (spine_io.exporters.gdx.Settings) – settings whose domain and set name lists should be modelled -
data
(self, index, role=Qt.DisplayRole)[source]¶ Returns the value for given role at given index.
Qt.DisplayRole returns the name of the domain or set while Qt.CheckStateRole returns whether the exportable flag has been set or not. Qt.BackgroundRole gives the item’s background depending whether it is a domain or a set.
Parameters: - index (QModelIndex) – an index to the model
- role (int) – the query’s role
Returns: the requested value or None
-
headerData
(self, section, orientation, role=Qt.DisplayRole)[source]¶ Returns an empty string for horizontal header and row number for vertical header.
-
is_domain
(self, index)[source]¶ Returns True if index points to a domain name, otherwise returns False.
-
moveRows
(self, sourceParent, sourceRow, count, destinationParent, destinationChild)[source]¶ Moves the domain and set names around.
The names cannot be mixed between domains and sets.
Parameters: - sourceParent (QModelIndex) – parent from which the rows are moved
- sourceRow (int) – index of the first row to be moved
- count (int) – number of rows to move
- destinationParent (QModelIndex) – parent to which the rows are moved
- destinationChild (int) – index where to insert the moved rows
Returns: True if the operation was successful, False otherwise
-
-
class
spinetoolbox.project_items.exporter.widgets.gdx_export_settings.
GAMSRecordListModel
[source]¶ Bases:
PySide2.QtCore.QAbstractListModel
A model to manage record ordering within domains and sets.
-
data
(self, index, role=Qt.DisplayRole)[source]¶ With role == Qt.DisplayRole returns the record’s keys as comma separated string.
-
headerData
(self, section, orientation, role=Qt.DisplayRole)[source]¶ Returns row and column header data.
-
moveRows
(self, sourceParent, sourceRow, count, destinationParent, destinationChild)[source]¶ Moves the records around.
Parameters: - sourceParent (QModelIndex) – parent from which the rows are moved
- sourceRow (int) – index of the first row to be moved
- count (int) – number of rows to move
- destinationParent (QModelIndex) – parent to which the rows are moved
- destinationChild (int) – index where to insert the moved rows
Returns: True if the operation was successful, False otherwise
-