diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py b/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py index 44e664e..ea8c6a4 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py @@ -1,6 +1,6 @@ import builtins -from bec_widgets.cli.client import BECDockArea +from bec_widgets.cli.client import AdvancedDockArea # from csaxs_bec.bec_ipython_client.plugins.cSAXS import epics_get, epics_put, fshopen, fshclose @@ -28,10 +28,11 @@ class flomniGuiTools: self.gui = self.client.gui def flomnigui_show_gui(self): - if "flomni" in self.gui.windows: - self.gui.flomni.show() - else: - self.gui.new("flomni") + self.gui.new("flomni") + # if "flomni" in self.gui.windows: + # self.gui.flomni.show() + # else: + # self.gui.new("flomni") def flomnigui_stop_gui(self): self.gui.flomni.hide() @@ -43,7 +44,7 @@ class flomniGuiTools: self.flomnigui_show_gui() if self._flomnigui_check_attribute_not_exists("xeyegui"): self.flomnigui_remove_all_docks() - self.xeyegui = self.gui.flomni.new("xeyegui").new("XRayEye") + self.xeyegui = self.gui.flomni.new("XRayEye",object_name='xrayeye') # start live if not dev.cam_xeye.live_mode_enabled.get(): # dev.cam_xeye.live_mode = True @@ -54,7 +55,7 @@ class flomniGuiTools: self.flomnigui_show_gui() if self._flomnigui_check_attribute_not_exists("xeyegui"): self.flomnigui_remove_all_docks() - self.xeyegui = self.gui.flomni.new("xeyegui").new("XRayEye") + self.xeyegui = self.gui.flomni.new("XRayEye") self.xeyegui.switch_tab('fit') def _flomnigui_check_attribute_not_exists(self, attribute_name): @@ -68,7 +69,7 @@ class flomniGuiTools: self.flomnigui_show_gui() if self._flomnigui_check_attribute_not_exists("camera_gripper") or self._flomnigui_check_attribute_not_exists("camera_overview"): self.flomnigui_remove_all_docks() - camera_gripper_image = self.gui.flomni.new("camera_gripper").new("Image") + camera_gripper_image = self.gui.flomni.new("Image") if self._flomnicam_check_device_exists(dev.cam_flomni_gripper): camera_gripper_image.image(("cam_flomni_gripper", "preview")) camera_gripper_image.lock_aspect_ratio = True @@ -79,7 +80,7 @@ class flomniGuiTools: dev.cam_flomni_gripper.start_live_mode() else: print("Cannot open camera_gripper. Device does not exist.") - camera_overview_image = self.gui.flomni.new("camera_overview").new("Image") + camera_overview_image = self.gui.flomni.new("Image") if self._flomnicam_check_device_exists(dev.cam_flomni_overview): camera_overview_image.image(("cam_flomni_overview", "preview")) camera_overview_image.lock_aspect_ratio = True @@ -103,7 +104,7 @@ class flomniGuiTools: self.flomnigui_show_gui() if self._flomnigui_check_attribute_not_exists("idle_text_box"): self.flomnigui_remove_all_docks() - idle_text_box = self.gui.flomni.new("idle_textbox").new("TextBox") + idle_text_box = self.gui.flomni.new("TextBox") text = ( "
"
             + " ,---.,--. ,-----. ,--.   ,--.,--.  ,--.,--. \n"
@@ -163,7 +164,7 @@ class flomniGuiTools:
             self.pdf_viewer = self.gui.flomni.new(widget="PdfViewerWidget")
 
         # --- Load PDF ---------------------------------------------------------
-        self.pdf_viewer.PdfViewerWidget.load_pdf(str(pdf_file.resolve()))
+        self.PdfViewerWidget.load_pdf(str(pdf_file.resolve()))
         print(f"\nLoaded: {pdf_file.name}\n")
 
 
@@ -180,7 +181,7 @@ class flomniGuiTools:
         if self._flomnigui_check_attribute_not_exists("progressbar"):
             self.flomnigui_remove_all_docks()
             # Add a new dock with a RingProgressBar widget
-            self.progressbar = self.gui.flomni.new("progressbar").new("RingProgressBar")
+            self.progressbar = self.gui.flomni.new("RingProgressBar")
             # Customize the size of the progress ring
             self.progressbar.set_line_widths(20)
             # Disable automatic updates and manually set the self.progressbar value
@@ -195,7 +196,7 @@ class flomniGuiTools:
             # Set the values of the rings to 50, 75, and 25 from outer to inner ring
             # self.progressbar.set_value([50, 75])
             # Add a new dock with a TextBox widget
-            self.text_box = self.gui.flomni.new(name="progress_text").new("TextBox")
+            self.text_box = self.gui.flomni.new("TextBox")
 
         self._flomnigui_update_progress()
 
diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py b/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py
index 9de8ce7..9119621 100644
--- a/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py
+++ b/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py
@@ -48,7 +48,7 @@ class XrayEyeAlign:
 
     def update_frame(self, keep_shutter_open=False):
 
-        self.flomni.flomnigui_show_xeyealign()
+        # self.flomni.flomnigui_show_xeyealign()
         if not dev.cam_xeye.live_mode_enabled.get():
             dev.cam_xeye.live_mode_enabled.put(True)
 
@@ -112,8 +112,8 @@ class XrayEyeAlign:
 
         self.flomni.lights_off()
 
-        self.flomni.flomnigui_show_xeyealign()
-        self.flomni.flomnigui_raise()
+        # self.flomni.flomnigui_show_xeyealign()
+        # self.flomni.flomnigui_raise()
 
         if not self.test_wo_movements:
             self.tomo_rotate(0)
@@ -282,4 +282,4 @@ class XrayEyeAlign:
         self.gui.submit_fit_array(data)
         print(f"fit submited with {data}")
         print("todo mirko: submitted data is 1000 fold in amplitude")
-        self.flomni.flomnigui_show_xeyealign_fittab()
+        # self.flomni.flomnigui_show_xeyealign_fittab()
diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/gui_tools.py b/csaxs_bec/bec_ipython_client/plugins/omny/gui_tools.py
index 32aac2a..bf36e53 100644
--- a/csaxs_bec/bec_ipython_client/plugins/omny/gui_tools.py
+++ b/csaxs_bec/bec_ipython_client/plugins/omny/gui_tools.py
@@ -1,6 +1,6 @@
 import builtins
 
-from bec_widgets.cli.client import BECDockArea
+from bec_widgets.cli.client import AdvancedDockArea
 
 # from csaxs_bec.bec_ipython_client.plugins.cSAXS import epics_get, epics_put, fshopen, fshclose
 
diff --git a/csaxs_bec/bec_widgets/widgets/xray_eye/x_ray_eye.py b/csaxs_bec/bec_widgets/widgets/xray_eye/x_ray_eye.py
index 7a4df2e..f6e0717 100644
--- a/csaxs_bec/bec_widgets/widgets/xray_eye/x_ray_eye.py
+++ b/csaxs_bec/bec_widgets/widgets/xray_eye/x_ray_eye.py
@@ -378,11 +378,11 @@ class XRayEye(BECWidget, QWidget):
         self.live_preview_toggle.blockSignals(True)
         if enabled:
             self.live_preview_toggle.checked = enabled
-            self.image.image(CAMERA)
+            self.image.image(device_name=CAMERA[0],device_entry=CAMERA[1])
             self.live_preview_toggle.blockSignals(False)
             return
 
-        self.image.disconnect_monitor(CAMERA)
+        self.image.disconnect_monitor(CAMERA[0],CAMERA[1])
         self.live_preview_toggle.checked = enabled
         self.live_preview_toggle.blockSignals(False)
 
@@ -475,10 +475,12 @@ class XRayEye(BECWidget, QWidget):
 
     @SafeSlot()
     def submit_fit_array(self,fit_array):
-
+        self.tab_widget.setCurrentIndex(1)
+        # self.fix_x.title = " got fit array"
         print(f"got fit array {fit_array}")
-        self.fit_x.set_data(x=fit_array[0],y=fit_array[1])
-        self.fit_y.set_data(x=fit_array[0],y=fit_array[2])
+        self.waveform_x.curves[0].set_data(x=fit_array[0],y=fit_array[1])
+        # self.fit_x.set_data(x=fit_array[0],y=fit_array[1])
+        # self.fit_y.set_data(x=fit_array[0],y=fit_array[2])
 
 
     @SafeSlot()
@@ -528,8 +530,10 @@ if __name__ == "__main__":
 
     from qtpy.QtWidgets import QApplication
     from bec_widgets.utils import BECDispatcher
+    from bec_widgets.utils.colors import apply_theme
 
     app = QApplication(sys.argv)
+    apply_theme("light")
     dispatcher = BECDispatcher(gui_id='xray')
     win = XRayEye()
 
diff --git a/csaxs_bec/device_configs/ptycho_flomni.yaml b/csaxs_bec/device_configs/ptycho_flomni.yaml
index d0db00b..351856c 100644
--- a/csaxs_bec/device_configs/ptycho_flomni.yaml
+++ b/csaxs_bec/device_configs/ptycho_flomni.yaml
@@ -429,20 +429,20 @@ cam_xeye:
   readOnly: false
   readoutPriority: async
 
-cam_ids_rgb:
-  description: Camera flOMNI Xray eye ID203
-  deviceClass: csaxs_bec.devices.ids_cameras.ids_camera.IDSCamera
-  deviceConfig:
-    camera_id: 203
-    bits_per_pixel: 24
-    num_rotation_90: 2
-    transpose: false
-    force_monochrome: false
-    m_n_colormode: 1
-  enabled: true
-  onFailure: buffer
-  readOnly: false
-  readoutPriority: async
+# cam_ids_rgb:
+#   description: Camera flOMNI Xray eye ID203
+#   deviceClass: csaxs_bec.devices.ids_cameras.ids_camera.IDSCamera
+#   deviceConfig:
+#     camera_id: 203
+#     bits_per_pixel: 24
+#     num_rotation_90: 2
+#     transpose: false
+#     force_monochrome: false
+#     m_n_colormode: 1
+#   enabled: true
+#   onFailure: buffer
+#   readOnly: false
+#   readoutPriority: async
 
 
 # ############################################################