The widgets.misc sub-package#
Package with miscellaneous individual QWidgets.
- class pydidas.widgets.misc.ConfigureBinaryDecodingWidget(**kwargs: Any)#
Bases:
WidgetWithParameters,AssociatedFileMixinA widget to configure the decoding of raw binary files.
The widget allows to set the datatype, shape, and header offset of the binary file which is required to decode the file correctly.
- Parameters:
**kwargs (Any) –
Any additional keyword arguments. In addition to all QAttributes supported by QWidget, see below for supported arguments:
- paramsParameterCollection, optional
A ParameterCollection with Parameters to share with this widget. If not given, new Parameters will be created.
- show_checkboxbool
Flag whether to show the checkbox to toggle the visibility of the detailed decoding settings. Default is True.
- property datatype: type[dtype]#
Get the current datatype selected for decoding.
- property decoding_is_valid: bool#
Get the flag whether the current decoding settings are valid.
- set_new_filename(filename: str | Path) None#
Process a new filename.
If the new filename has a suffix associated with raw binary files, show the widget.
- Parameters:
filename (Path or str) – The full file system path to the new file.
- class pydidas.widgets.misc.Hdf5DatasetSelector(**kwargs: Any)#
Bases:
WidgetWithParametersA compound widget to select datasets in Hdf5 files.
The Hdf5DatasetSelector is a compound widget which allows to select a hdf5 dataset key and the frame number. By convention, the first dimension of an n-dimensional (n >= 3) dataset is the frame number. Any 2-dimensional datasets will be interpreted as single frames.
- Parameters:
**kwargs (Any) –
Any additional keyword arguments. See below for supported arguments.
- dataset_filter_keysdict, optional
A dictionary with dataset keys to be filtered from the list of displayed datasets. Entries must be in the format {<Key to filter>: <Descriptive text for checkbox>}. The default is the built-in dict with detector-specific filter keys.
- dataset_filter_exceptionsdict, optional
A dictionary with lists of dataset keys which are exceptions to the filter keys. Entries must be in the format {<Filter key>: [<Exception key 1>, <Exception key 2>, …]}. The default is the built-in dict with detector-specific exceptions.
- property active_filters: list[str]#
Get the list of currently active dataset filters.
- clear() None#
Clear all entries for the widget.
- property dataset: str#
Get the currently selected dataset.
- display_dataset() None#
Select a dataset from the drop-down list.
This internal method is called by the Qt event system if the QComBoBox text has changed to notify the main program that the user has selected a different dataset to be visualized. This method also updates the accepted frame range for the sliders.
- property dset_filter_exceptions: list[str]#
Get the list of dataset keys which are exceptions to the active filters.
- new_filename(filename: str | Path) None#
Process the new filename.
If the new filename has a suffix associated with hdf5 files, show the widget.
- Parameters:
filename (str or Path) – The full file system path to the new file.
- class pydidas.widgets.misc.IntegrationRoiParamContainer(**kwargs: Any)#
Bases:
WidgetWithParametersWidget to display Parameters for the integration region.
The Parameter widgets are created for an associated plugin which is not owned by this widget.
- clear_plugin_widgets() None#
Clear the plugin_container widget to create new widgets.
- create_widgets_for_axis(plugin: BasePlugin, axis: Literal['rad', 'azi']) None#
Create the widgets for the given axis.
- Parameters:
plugin (pydidas.plugins.BasePlugin) – The plugin for which widgets shall be created.
axis (Literal["rad", "azi"]) – The axis name.
- toggle_enable(enabled: bool) None#
Toggle the selection mode and enable/disable the Parameter widgets.
- Parameters:
enabled (bool) – Editing enabled flag.
- class pydidas.widgets.misc.PointsForBeamcenterWidget(plot: Any, parent: Any = None, **kwargs: Any)#
Bases:
QWidget,WidgetFactoryMixIn,ParameterWidgetMixInA widget to display a list of points in an associated plot.
- add_point_to_table(xpos: float, ypos: float) None#
Add a newly selected point to the table.
- Parameters:
xpos (float) – The x position.
ypos (float) – The y position.
- process_new_font_metrics(char_width: float, char_height: float) None#
Adjust the widget’s width based on the font metrics.
- Parameters:
char_width (float) – The font width in pixels.
char_height (float) – The font height in pixels.
- class pydidas.widgets.misc.SelectDataFrameWidget(**kwargs: Any)#
Bases:
WidgetWithParameters,AssociatedFileMixinA widget which allows to select a data frame from a file.
- Parameters:
**kwargs (Any) –
Supported keyword arguments are;
- parentQWidget or None, optional
The parent widget. The default is None.
- import_referencestr or None, optional
The reference for the file dialogue to store persistent settings. If None, no persistent settings are stored. The default is None.
- ndimint, optional
The number of dimensions of the data to be imported. The default is 2.
- filenameParameter or None, optional
A Parameter to use for the filename selection. If None, a default Parameter will be created. The default is None.
- font_metric_width_factorint or None, optional
An optional factor to modify the width of text elements in the widget based on the font metrics. If None, the default width for the used Parameter widgets is applied. The default is None.
- show_binary_checkboxbool, optional
Flag whether to show the checkbox for binary decoding. The default is True.
- connect_signals() None#
Connect the widget signals to the relevant slots.
- process_new_filename() None#
Process the input of a new filename in the Parameter widget.