mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
refactor: add docs, cleanup
This commit is contained in:
@ -1812,6 +1812,15 @@ class BECWaveform(RPCBase):
|
|||||||
BECCurve: The curve object.
|
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
|
@rpc_call
|
||||||
def set_x(self, x_name: "str", x_entry: "str | None" = None):
|
def set_x(self, x_name: "str", x_entry: "str | None" = None):
|
||||||
"""
|
"""
|
||||||
@ -2112,6 +2121,15 @@ class BECWaveformWidget(RPCBase):
|
|||||||
BECCurve: The curve object.
|
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
|
@rpc_call
|
||||||
def remove_curve(self, *identifiers):
|
def remove_curve(self, *identifiers):
|
||||||
"""
|
"""
|
||||||
|
@ -49,6 +49,7 @@ class BECWaveform(BECPlotBase):
|
|||||||
"_config_dict",
|
"_config_dict",
|
||||||
"plot",
|
"plot",
|
||||||
"add_dap",
|
"add_dap",
|
||||||
|
"get_dap_params",
|
||||||
"set_x",
|
"set_x",
|
||||||
"remove_curve",
|
"remove_curve",
|
||||||
"scan_history",
|
"scan_history",
|
||||||
|
@ -27,7 +27,7 @@ class LMFitDialogPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|||||||
return DOM_XML
|
return DOM_XML
|
||||||
|
|
||||||
def group(self):
|
def group(self):
|
||||||
return ""
|
return "BEC Utils"
|
||||||
|
|
||||||
def icon(self):
|
def icon(self):
|
||||||
return designer_material_icon(LMFitDialog.ICON_NAME)
|
return designer_material_icon(LMFitDialog.ICON_NAME)
|
||||||
|
@ -12,8 +12,9 @@ logger = bec_logger.logger
|
|||||||
|
|
||||||
|
|
||||||
class LMFitDialog(BECWidget, QWidget):
|
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)
|
selected_fit = Signal(str)
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@ -25,6 +26,17 @@ class LMFitDialog(BECWidget, QWidget):
|
|||||||
gui_id: str | None = None,
|
gui_id: str | None = None,
|
||||||
ui_file="lmfit_dialog_vertical.ui",
|
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)
|
super().__init__(client=client, config=config, gui_id=gui_id)
|
||||||
QWidget.__init__(self, parent=parent)
|
QWidget.__init__(self, parent=parent)
|
||||||
self._ui_file = ui_file
|
self._ui_file = ui_file
|
||||||
@ -38,6 +50,7 @@ class LMFitDialog(BECWidget, QWidget):
|
|||||||
self._fit_curve_id = None
|
self._fit_curve_id = None
|
||||||
self._deci_precision = 3
|
self._deci_precision = 3
|
||||||
self.ui.curve_list.currentItemChanged.connect(self.display_fit_details)
|
self.ui.curve_list.currentItemChanged.connect(self.display_fit_details)
|
||||||
|
self.layout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
@Property(bool)
|
@Property(bool)
|
||||||
@ -101,10 +114,6 @@ class LMFitDialog(BECWidget, QWidget):
|
|||||||
self.refresh_curve_list()
|
self.refresh_curve_list()
|
||||||
if self.fit_curve_id is None:
|
if self.fit_curve_id is None:
|
||||||
self.fit_curve_id = curve_id
|
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:
|
if curve_id != self.fit_curve_id:
|
||||||
return
|
return
|
||||||
if data is None:
|
if data is None:
|
||||||
|
@ -33,6 +33,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|||||||
"curves",
|
"curves",
|
||||||
"plot",
|
"plot",
|
||||||
"add_dap",
|
"add_dap",
|
||||||
|
"get_dap_params",
|
||||||
"remove_curve",
|
"remove_curve",
|
||||||
"scan_history",
|
"scan_history",
|
||||||
"get_all_data",
|
"get_all_data",
|
||||||
|
Reference in New Issue
Block a user