colorbar changed to greys

This commit is contained in:
x01dc
2025-12-16 16:20:26 +01:00
committed by wyzula-jan
parent f5180d5cab
commit 2dc9985a85

View File

@@ -156,11 +156,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)
@@ -260,7 +262,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]
@@ -273,7 +277,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)
@@ -466,39 +470,6 @@ class XRayEye(BECWidget, QWidget):
#TODO implement if needed
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):
@@ -512,6 +483,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
@@ -539,6 +511,7 @@ 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."""