diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index ee06df7d..cd7a1454 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -1202,6 +1202,34 @@ class BECMotorMap(RPCBase): Remove the plot widget from the figure. """ + @rpc_call + def reset_history(self): + """ + Reset the history of the motor map. + """ + + +class BECMotorMapWidget(RPCBase): + @rpc_call + def change_motors( + self, + motor_x: str, + motor_y: str, + motor_x_entry: str = None, + motor_y_entry: str = None, + validate_bec: bool = True, + ) -> None: + """ + Change the active motors for the plot. + + Args: + motor_x(str): Motor name for the X axis. + motor_y(str): Motor name for the Y axis. + motor_x_entry(str): Motor entry for the X axis. + motor_y_entry(str): Motor entry for the Y axis. + validate_bec(bool, optional): If True, validate the signal with BEC. Defaults to True. + """ + class BECPlotBase(RPCBase): @property diff --git a/bec_widgets/widgets/figure/plots/motor_map/motor_map.py b/bec_widgets/widgets/figure/plots/motor_map/motor_map.py index c858890e..799b4b53 100644 --- a/bec_widgets/widgets/figure/plots/motor_map/motor_map.py +++ b/bec_widgets/widgets/figure/plots/motor_map/motor_map.py @@ -59,6 +59,7 @@ class BECMotorMap(BECPlotBase): "set_scatter_size", "get_data", "remove", + "reset_history", ] # QT Signals @@ -174,7 +175,8 @@ class BECMotorMap(BECPlotBase): """ Reset the history of the motor map. """ - self.database_buffer = {"x": [], "y": []} + self.database_buffer["x"] = [self.database_buffer["x"][-1]] + self.database_buffer["y"] = [self.database_buffer["y"][-1]] self.update_signal.emit() def set_color(self, color: [str | tuple]):