populse_mia.user_interface.data_viewer.data_viewer_tab

Populse_mia data viewer GUI interface (in the “Data Viewer” tab).

Contains:
Class:
  • DataViewerTab

Classes

DataViewerTab(main_window)

A flexible and extensible widget for managing data viewers in a GUI application.

class populse_mia.user_interface.data_viewer.data_viewer_tab.DataViewerTab(main_window)[source]

Bases: QWidget

A flexible and extensible widget for managing data viewers in a GUI application.

This widget provides a dynamic interface for loading and switching between different data viewers. Key features include: - Automatic discovery of viewers in the data_viewer directory - Graceful handling of viewer import failures - Ability to dynamically add new viewers - Centralized document and project management across viewers

__init__(main_window)[source]

Initialize the DataViewerTab with a reference to the main window.

Parameters:

(Qt.QMainWindow) (main_window) – The main application window providing context and potential shared resources.

activate_viewer(viewer_name)[source]

Activate a specific viewer by name.

Parameters:

(str) (viewer_name) – Name of the viewer to activate.

change_viewer()[source]

Handle viewer change event triggered by the combobox.

Retrieves the selected viewer, activates it, and ensures that the current project and documents are set.

clear()[source]

Clean up and close all loaded viewers.

Called before closing the application to ensure proper resource management.

closeEvent(event)[source]

Override close event to ensure proper cleanup.

Parameters:

(QCloseEvent) (event) – Close event triggered by the window system.

current_viewer()[source]

Retrieve the name of the currently active viewer.

Return (str):

Name of the current viewer, either from the current viewer tracking or the combobox selection.

load_viewer(viewer_name=None)[source]

Dynamically load viewers from the data_viewer directory.

Attempts to import and initialize viewers, handling import failures gracefully.

Parameters:

(str) (viewer_name) – Specific viewer to load. If None, discovers all viewers.

set_documents(project, documents)[source]

Distribute project and document information to the current viewer.

Parameters:
  • project – The entire project context.

  • (list) (documents) – List of document/image objects in the project.