colorbar changed to greys
This commit is contained in:
@@ -158,11 +158,13 @@ class XRayEye(BECWidget, QWidget):
|
||||
self.core_layout = QHBoxLayout(self.alignment_tab)
|
||||
|
||||
self.image = Image(parent=self.alignment_tab)
|
||||
self.image.color_map = "CET-L2"
|
||||
self.image.enable_toolbar = False # Disable default toolbar to not allow to user set anything
|
||||
self.image.inner_axes = False # Disable inner axes to maximize image area
|
||||
self.image.enable_full_colorbar = True
|
||||
self.image.invert_y = True # Invert y axis to match image coordinates
|
||||
|
||||
|
||||
# Control panel on the right: vertical layout inside a fixed-width widget
|
||||
self.control_panel = QWidget(parent=self.alignment_tab)
|
||||
self.control_panel_layout = QVBoxLayout(self.control_panel)
|
||||
@@ -262,7 +264,9 @@ class XRayEye(BECWidget, QWidget):
|
||||
self.fit_layout = QVBoxLayout(self.fit_tab)
|
||||
self.waveform_x = Waveform(parent=self.fit_tab)
|
||||
self.waveform_y = Waveform(parent=self.fit_tab)
|
||||
self.waveform_x.plot(x=[0],y=[1], label="fit-x",dap="SineModel")#,dap_oversample=5)
|
||||
|
||||
|
||||
self.waveform_x.plot(x=[0],y=[1], label="fit-x",dap="SineModel",dap_parameters={"frequency":{"value":0.0174533,"vary":False,"min":0.01,"max":0.02}},dap_oversample=5)
|
||||
self.waveform_y.plot(x=[0],y=[2], label="fit-y",dap="SineModel")#,dap_oversample=5)
|
||||
self.fit_x = self.waveform_x.curves[0]
|
||||
self.fit_y = self.waveform_y.curves[0]
|
||||
@@ -275,7 +279,7 @@ class XRayEye(BECWidget, QWidget):
|
||||
wave.x_label = "Angle (deg)"
|
||||
wave.x_grid = True
|
||||
wave.y_grid = True
|
||||
wave.enable_toolbar = False
|
||||
wave.enable_toolbar = True
|
||||
|
||||
self.fit_layout.addWidget(self.waveform_x)
|
||||
self.fit_layout.addWidget(self.waveform_y)
|
||||
@@ -469,39 +473,6 @@ class XRayEye(BECWidget, QWidget):
|
||||
print(f"data: {data}")
|
||||
print(f"meta: {meta}")
|
||||
|
||||
@SafeSlot(dict, dict)
|
||||
def device_updates(self, data: dict, meta: dict):
|
||||
"""
|
||||
Slot to handle device updates from omny_xray_gui device.
|
||||
|
||||
Args:
|
||||
data(dict): data from device
|
||||
meta(dict): metadata from device
|
||||
"""
|
||||
print(f"data from device_updates: {data}")
|
||||
|
||||
# signals = data.get('signals')
|
||||
# enable_live_preview = signals.get("omny_xray_gui_update_frame_acq").get('value')
|
||||
# enable_x_motor = signals.get("omny_xray_gui_enable_mv_x").get('value')
|
||||
# enable_y_motor = signals.get("omny_xray_gui_enable_mv_y").get('value')
|
||||
# self.on_live_view_enabled(bool(enable_live_preview))
|
||||
# self.on_motors_enable(bool(enable_x_motor), bool(enable_y_motor))
|
||||
|
||||
|
||||
# # Signals from epics gui device
|
||||
# # send message
|
||||
# user_message = signals.get("omny_xray_gui_send_message").get('value')
|
||||
# self.user_message = user_message
|
||||
# # sample name
|
||||
# sample_message = signals.get("omny_xray_gui_sample_name").get('value')
|
||||
# self.sample_name = sample_message
|
||||
# # enable frame acquisition
|
||||
# update_frame_acq = signals.get("omny_xray_gui_update_frame_acq").get('value')
|
||||
# self.on_live_view_enabled(bool(update_frame_acq))
|
||||
# # enable submit button
|
||||
# enable_submit_button = signals.get("omny_xray_gui_submit").get('value')
|
||||
# self.enable_submit_button(enable_submit_button)
|
||||
|
||||
@SafeSlot()
|
||||
def submit_fit_array(self,fit_array):
|
||||
|
||||
@@ -514,6 +485,7 @@ class XRayEye(BECWidget, QWidget):
|
||||
def submit(self):
|
||||
"""Execute submit action by submit button."""
|
||||
print('submit pushed')
|
||||
self.submit_button.blockSignals(True)
|
||||
if self.roi_manager.single_active_roi is None:
|
||||
logger.warning("No active ROI")
|
||||
return
|
||||
@@ -531,9 +503,7 @@ class XRayEye(BECWidget, QWidget):
|
||||
logger.warning("Unsupported ROI type for submit action.")
|
||||
return
|
||||
|
||||
print(
|
||||
f"current roi: x:{roi_center_x}, y:{roi_center_y}, w:{roi_width},h:{roi_height}"
|
||||
) # TODO remove when will be not needed for debugging
|
||||
print(f"current roi: x:{roi_center_x}, y:{roi_center_y}, w:{roi_width},h:{roi_height}") #TODO remove when will be not needed for debugging
|
||||
# submit roi coordinates
|
||||
step = int(self.dev.omny_xray_gui.step.read().get("omny_xray_gui_step").get("value"))
|
||||
|
||||
@@ -543,14 +513,13 @@ class XRayEye(BECWidget, QWidget):
|
||||
width_y = getattr(self.dev.omny_xray_gui, f"width_y_{step}").set(roi_height)
|
||||
self.dev.omny_xray_gui.submit.set(1)
|
||||
print('submit done')
|
||||
self.submit_button.blockSignals(False)
|
||||
|
||||
|
||||
def cleanup(self):
|
||||
"""Cleanup connections on widget close -> disconnect slots and stop live mode of camera."""
|
||||
self.bec_dispatcher.disconnect_slot(
|
||||
self.device_updates, MessageEndpoints.device_readback("omny_xray_gui")
|
||||
)
|
||||
getattr(self.dev, CAMERA[0]).live_mode = False
|
||||
self.bec_dispatcher.disconnect_slot(self.device_updates, MessageEndpoints.device_readback("omny_xray_gui"))
|
||||
getattr(self.dev,CAMERA[0]).live_mode = False
|
||||
super().cleanup()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user