mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
refactor: add docs, cleanup
This commit is contained in:
@ -1812,6 +1812,15 @@ class BECWaveform(RPCBase):
|
||||
BECCurve: The curve object.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def get_dap_params(self) -> "dict":
|
||||
"""
|
||||
Get the DAP parameters of all DAP curves.
|
||||
|
||||
Returns:
|
||||
dict: DAP parameters of all DAP curves.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_x(self, x_name: "str", x_entry: "str | None" = None):
|
||||
"""
|
||||
@ -2112,6 +2121,15 @@ class BECWaveformWidget(RPCBase):
|
||||
BECCurve: The curve object.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def get_dap_params(self) -> "dict":
|
||||
"""
|
||||
Get the DAP parameters of all DAP curves.
|
||||
|
||||
Returns:
|
||||
dict: DAP parameters of all DAP curves.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def remove_curve(self, *identifiers):
|
||||
"""
|
||||
|
@ -49,6 +49,7 @@ class BECWaveform(BECPlotBase):
|
||||
"_config_dict",
|
||||
"plot",
|
||||
"add_dap",
|
||||
"get_dap_params",
|
||||
"set_x",
|
||||
"remove_curve",
|
||||
"scan_history",
|
||||
|
@ -27,7 +27,7 @@ class LMFitDialogPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return DOM_XML
|
||||
|
||||
def group(self):
|
||||
return ""
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon(LMFitDialog.ICON_NAME)
|
||||
|
@ -12,8 +12,9 @@ logger = bec_logger.logger
|
||||
|
||||
|
||||
class LMFitDialog(BECWidget, QWidget):
|
||||
"""Dialog for displaying the fit summary and params for LMFit DAP processes"""
|
||||
|
||||
ICON_NAME = "bike_lane"
|
||||
ICON_NAME = "monitoring"
|
||||
selected_fit = Signal(str)
|
||||
|
||||
def __init__(
|
||||
@ -25,6 +26,17 @@ class LMFitDialog(BECWidget, QWidget):
|
||||
gui_id: str | None = None,
|
||||
ui_file="lmfit_dialog_vertical.ui",
|
||||
):
|
||||
"""
|
||||
Initialises the LMFitDialog widget.
|
||||
|
||||
Args:
|
||||
parent (QWidget): The parent widget.
|
||||
client: BEC client object.
|
||||
config: Configuration of the widget.
|
||||
target_widget: The widget that the settings will be taken from and applied to.
|
||||
gui_id (str): GUI ID.
|
||||
ui_file (str): The UI file to be loaded.
|
||||
"""
|
||||
super().__init__(client=client, config=config, gui_id=gui_id)
|
||||
QWidget.__init__(self, parent=parent)
|
||||
self._ui_file = ui_file
|
||||
@ -38,6 +50,7 @@ class LMFitDialog(BECWidget, QWidget):
|
||||
self._fit_curve_id = None
|
||||
self._deci_precision = 3
|
||||
self.ui.curve_list.currentItemChanged.connect(self.display_fit_details)
|
||||
self.layout.setContentsMargins(0, 0, 0, 0)
|
||||
self.setLayout(self.layout)
|
||||
|
||||
@Property(bool)
|
||||
@ -101,10 +114,6 @@ class LMFitDialog(BECWidget, QWidget):
|
||||
self.refresh_curve_list()
|
||||
if self.fit_curve_id is None:
|
||||
self.fit_curve_id = curve_id
|
||||
for index in range(self.ui.curve_list.count()):
|
||||
item = self.ui.curve_list.item(index)
|
||||
if item.text() == curve_id:
|
||||
self.ui.curve_list.setCurrentItem(item)
|
||||
if curve_id != self.fit_curve_id:
|
||||
return
|
||||
if data is None:
|
||||
|
@ -33,6 +33,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
||||
"curves",
|
||||
"plot",
|
||||
"add_dap",
|
||||
"get_dap_params",
|
||||
"remove_curve",
|
||||
"scan_history",
|
||||
"get_all_data",
|
||||
|
Reference in New Issue
Block a user