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:
|
Returns:
|
||||||
float: Motor initial position.
|
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
|
return init_position
|
||||||
|
|
||||||
def _validate_signal_entries(
|
def _validate_signal_entries(
|
||||||
@ -403,7 +403,7 @@ class BECMotorMap(BECPlotBase):
|
|||||||
# Update plot title
|
# Update plot title
|
||||||
precision = self.config.precision
|
precision = self.config.precision
|
||||||
self.set_title(
|
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)
|
@pyqtSlot(dict)
|
||||||
|
@ -577,7 +577,6 @@ class BECWaveform(BECPlotBase):
|
|||||||
Returns:
|
Returns:
|
||||||
dict | pd.DataFrame: Data of all curves in the specified format.
|
dict | pd.DataFrame: Data of all curves in the specified format.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
try:
|
try:
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
@ -115,7 +115,8 @@ class Ring(BECConnector):
|
|||||||
|
|
||||||
def set_value(self, value: int | float):
|
def set_value(self, value: int | float):
|
||||||
self.config.value = round(
|
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):
|
def set_color(self, color: str | tuple):
|
||||||
|
Reference in New Issue
Block a user