spinetoolbox.widgets.parameter_value_editor

An editor dialog for editing database (relationship) parameter values.

author:
  1. Soininen (VTT)
date:

28.6.2019

Module Contents

Classes

_Editor Indexes for the specialized editors corresponding to the selector combo box and editor stack.
ParameterValueEditor Dialog for editing (relationship) parameter values.
class spinetoolbox.widgets.parameter_value_editor._Editor[source]

Bases: enum.IntEnum

Indexes for the specialized editors corresponding to the selector combo box and editor stack.

Initialize self. See help(type(self)) for accurate signature.

PLAIN_VALUE = 0[source]
MAP = 1[source]
TIME_SERIES_FIXED_RESOLUTION = 2[source]
TIME_SERIES_VARIABLE_RESOLUTION = 3[source]
TIME_PATTERN = 4[source]
ARRAY = 5[source]
DATETIME = 6[source]
DURATION = 7[source]
class spinetoolbox.widgets.parameter_value_editor.ParameterValueEditor(index, parent=None)[source]

Bases: PySide2.QtWidgets.QDialog

Dialog for editing (relationship) parameter values.

The dialog takes an index and shows a specialized editor corresponding to the value type in a stack widget. The user can change the value type by changing the specialized editor using a combo box. When the dialog is closed the value from the currently shown specialized editor is written back to the given index.

Parameters:
  • index (QModelIndex) – an index to a parameter_value in parent_model
  • parent (QWidget) – a parent widget
accept(self)[source]

Saves the parameter_value shown in the currently selected editor widget to the database manager.

_change_parameter_type(self, selector_index)[source]

Handles switching between value types.

Does a rude conversion between fixed and variable resolution time series. In other cases, a default ‘empty’ value is used.

Parameters:selector_index (int) – an index to the selector combo box
_select_editor(self, value)[source]

Shows the editor widget corresponding to the given value type on the editor stack.

_use_default_editor(self, message=None)[source]

Opens the default editor widget. Optionally, displays a warning dialog indicating the problem.

Parameters:message (str, optional) –
_use_editor(self, value, editor_index)[source]
_editor_for_index(self, editor_index)[source]