mafw.steering_gui.views.processor_parameter_editor
Processor parameter editor for steering GUI pipelines.
- Author:
Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)
- Description:
Display and edit processor parameters, replica metadata, and overrides in the GUI.
Classes
|
Dialog for editing the items in one list-valued processor parameter. |
|
Compact list cell editor that opens a dedicated |
|
Keep the serialized value visible and offer a structured edit dialog. |
|
Delegate that picks editors based on parameter type. |
|
Qt table model exposing processor parameters for editing. |
|
Select and edit one physical or logical path alternative. |
|
Widget used to edit parameters and metadata of a processor entry. |
- class mafw.steering_gui.views.processor_parameter_editor.ListEditDialog(parameter_name: str, values: Iterable[Any], element_type: Any = None, default_values: Iterable[Any] = (), volume_names: Iterable[str] = (), parent: QWidget | None = None)[source]
Bases:
QDialogDialog for editing the items in one list-valued processor parameter.
Build the item table and controls for one list parameter.
- static _display_value(value: Any) str[source]
Render typed logical references using their portable serialized form.
- _accept_if_valid() None[source]
Close only when all non-empty items can be converted to their declared type.
- _close_active_row_editor() None[source]
Close the active cell editor before the selected row is removed.
- _insert_item(value: Any) QTableWidgetItem[source]
Append one editable row and return its table item.
- _remove_rows(rows: Iterable[int]) None[source]
Delete unique rows in reverse order and refresh selection actions.
- _remove_rows_later(rows: Iterable[int]) None[source]
Delete selected rows after Qt has completed any editor focus-out commit.
- _reset_to_default() None[source]
Replace all rows with the parameter’s ActiveParameter default items.
Select a right-clicked row and show the list actions.
- class mafw.steering_gui.views.processor_parameter_editor.ListEditor(parent: QWidget | None = None, element_type: Any = None, parameter_name: str = '', on_selected: Callable[[list[Any]], None] | None = None, default_values: Iterable[Any] = (), volume_names: Iterable[str] = ())[source]
Bases:
QWidgetCompact list cell editor that opens a dedicated
ListEditDialog.Build the cell summary and its right-aligned Edit button.
- class mafw.steering_gui.views.processor_parameter_editor.LogicalReferenceEditor(parent: QWidget | None = None)[source]
Bases:
QWidgetKeep the serialized value visible and offer a structured edit dialog.
- _commit_if_changed() None[source]
Ask the delegate to store user-edited text once it leaves the field.
- _show_validation_state(value: str) None[source]
Show syntax feedback beside the active parameter editor.
- set_text(value: str) None[source]
Display existing serialized text without discarding malformed input.
- set_volumes(volumes: Iterable[str]) None[source]
Set configured volume choices used by the structured editor.
- value() LogicalFileReference | str[source]
Return a typed reference when valid, retaining malformed text otherwise.
- class mafw.steering_gui.views.processor_parameter_editor.ParameterDelegate(parent: QWidget | None = None)[source]
Bases:
QStyledItemDelegateDelegate that picks editors based on parameter type.
- class mafw.steering_gui.views.processor_parameter_editor.ParameterTableModel(parent: QWidget | None = None)[source]
Bases:
QAbstractTableModelQt table model exposing processor parameters for editing.
- static _format_type(type_hint: Any) str[source]
Render a parameter type for the Type column.
Plain types show their name (
PosixPath,int);Annotatedwrappers are unwrapped to their underlying type; parameterised generics are rendered in thelist[int]style using their origin and arguments.
- set_parameters(parameters: Iterable[ParameterConfig]) None[source]
Replace the rows with the provided parameters.
- class mafw.steering_gui.views.processor_parameter_editor.PathLogicalUnionEditor(parent: QWidget, annotation: Any, volumes: Iterable[str], on_path_selected: Callable[[str], None] | None = None, on_browse_started: Callable[[], None] | None = None, on_browse_cancelled: Callable[[], None] | None = None)[source]
Bases:
QWidgetSelect and edit one physical or logical path alternative.
- _commit_if_focus_leaves() None[source]
Ignore focus changes between child controls; commit when the editor loses focus.
- value() Path | LogicalFileReference | str[source]
Return the selected typed alternative.
- class mafw.steering_gui.views.processor_parameter_editor.ProcessorParameterEditor(parent: QWidget | None = None)[source]
Bases:
QWidgetWidget used to edit parameters and metadata of a processor entry.
- _activate_parameter_editor_on_click(index: QModelIndex) None[source]
Show the list or path editor after one click on its value cell.
- set_processor_data(config: ProcessorConfig) None[source]
Populate the editor with processor configuration data.
- class mafw.steering_gui.views.processor_parameter_editor._ListItemsTable(rows: int, columns: int, parent: QWidget | None = None)[source]
Bases:
QTableWidgetOne-column list table with add/remove keyboard commands.
Initialize a table that can move its selected rows internally.
- dropEvent(event: QDropEvent) None[source]
Move selected rows as a block without letting the table overwrite items.
- class mafw.steering_gui.views.processor_parameter_editor._ParameterRoles[source]
Bases:
objectCustom roles used to expose parameter metadata to delegates.
- class mafw.steering_gui.views.processor_parameter_editor._ParameterRow(config: ParameterConfig, order: int)[source]
Bases:
objectContainer describing a single parameter table row.
- mafw.steering_gui.views.processor_parameter_editor._commit_list_editor_value(delegate: ParameterDelegate, editor: QWidget, model: QAbstractItemModel, index: QModelIndex | QPersistentModelIndex, value: Any) None[source]
Commit a list row, dropping a newly added row dismissed while empty.
- mafw.steering_gui.views.processor_parameter_editor._contains_annotation(annotation: Any, target: Any) bool[source]
Return whether an annotation contains target, including nested wrappers.
- mafw.steering_gui.views.processor_parameter_editor._is_empty_list_editor(editor: QWidget) bool[source]
Check whether a newly added list row still has no selected value.
- mafw.steering_gui.views.processor_parameter_editor._is_list_type(annotation: Any) bool[source]
Return whether annotation denotes a
list(plain or parameterised).Any
Annotatedwrapper is stripped first, soAnnotated[list[int], marker]is recognised as a list as well.
- mafw.steering_gui.views.processor_parameter_editor._is_path_logical_union(annotation: Any) bool[source]
Return whether an annotation is one of the supported path/reference unions.
- mafw.steering_gui.views.processor_parameter_editor._remove_pending_item_later(table: QTableWidget, index: QModelIndex | QPersistentModelIndex) None[source]
Remove an empty new row after Qt has finished closing its active editor.
- mafw.steering_gui.views.processor_parameter_editor._set_list_item_value(model: QAbstractItemModel, index: QModelIndex | QPersistentModelIndex, value: Path | LogicalFileReference | str) None[source]
Keep a list row readable while retaining its selected path type.
- mafw.steering_gui.views.processor_parameter_editor._ACTIVE_COLUMN_LABEL = 'Active'
Header label for the parameter active toggle column.
- mafw.steering_gui.views.processor_parameter_editor._COLUMNS = ('Active', 'Name', 'Value', 'Type', 'Source', 'Status')
Column labels for the processor parameter table.