mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix: accept scalars or numpy arrays of 1 element
This commit is contained in:
@ -317,7 +317,7 @@ class BECMotorMap(BECPlotBase):
|
||||
Returns:
|
||||
float: Motor initial position.
|
||||
"""
|
||||
init_position = round(self.dev[name].read()[entry]["value"], precision)
|
||||
init_position = round(float(self.dev[name].read()[entry]["value"]), precision)
|
||||
return init_position
|
||||
|
||||
def _validate_signal_entries(
|
||||
@ -403,7 +403,7 @@ class BECMotorMap(BECPlotBase):
|
||||
# Update plot title
|
||||
precision = self.config.precision
|
||||
self.set_title(
|
||||
f"Motor position: ({round(current_x,precision)}, {round(current_y,precision)})"
|
||||
f"Motor position: ({round(float(current_x),precision)}, {round(float(current_y),precision)})"
|
||||
)
|
||||
|
||||
@pyqtSlot(dict)
|
||||
|
@ -577,7 +577,6 @@ class BECWaveform(BECPlotBase):
|
||||
Returns:
|
||||
dict | pd.DataFrame: Data of all curves in the specified format.
|
||||
"""
|
||||
|
||||
data = {}
|
||||
try:
|
||||
import pandas as pd
|
||||
|
@ -115,7 +115,8 @@ class Ring(BECConnector):
|
||||
|
||||
def set_value(self, value: int | float):
|
||||
self.config.value = round(
|
||||
max(self.config.min_value, min(self.config.max_value, value)), self.config.precision
|
||||
float(max(self.config.min_value, min(self.config.max_value, value))),
|
||||
self.config.precision,
|
||||
)
|
||||
|
||||
def set_color(self, color: str | tuple):
|
||||
|
Reference in New Issue
Block a user