refactor: commented code removed
This commit was merged in pull request #118.
This commit is contained in:
@@ -45,7 +45,6 @@ class flomniGuiTools:
|
||||
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
|
||||
dev.cam_xeye.live_mode_enabled.put(True)
|
||||
self.xeyegui.switch_tab("alignment")
|
||||
|
||||
|
||||
@@ -17,9 +17,11 @@ bec = builtins.__dict__.get("bec")
|
||||
dev = builtins.__dict__.get("dev")
|
||||
scans = builtins.__dict__.get("scans")
|
||||
|
||||
|
||||
def umv(*args):
|
||||
return scans.umv(*args, relative=False)
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from bec_ipython_client.plugins.flomni import Flomni
|
||||
|
||||
@@ -48,7 +50,6 @@ class XrayEyeAlign:
|
||||
|
||||
def update_frame(self, keep_shutter_open=False):
|
||||
|
||||
# self.flomni.flomnigui_show_xeyealign()
|
||||
if not dev.cam_xeye.live_mode_enabled.get():
|
||||
dev.cam_xeye.live_mode_enabled.put(True)
|
||||
|
||||
@@ -112,9 +113,6 @@ class XrayEyeAlign:
|
||||
|
||||
self.flomni.lights_off()
|
||||
|
||||
# self.flomni.flomnigui_show_xeyealign()
|
||||
# self.flomni.flomnigui_raise()
|
||||
|
||||
if not self.test_wo_movements:
|
||||
self.tomo_rotate(0)
|
||||
|
||||
@@ -282,5 +280,3 @@ class XrayEyeAlign:
|
||||
self.gui.submit_fit_array(data)
|
||||
print(f"fit submited with {data}")
|
||||
# self.flomni.flomnigui_show_xeyealign_fittab()
|
||||
|
||||
|
||||
|
||||
@@ -37,14 +37,12 @@ class XRayEye2DControl(BECWidget, QWidget):
|
||||
self.get_bec_shortcuts()
|
||||
self._step_size = step_size
|
||||
self.root_layout = QGridLayout(self)
|
||||
self.setStyleSheet(
|
||||
"""
|
||||
self.setStyleSheet("""
|
||||
QToolButton {
|
||||
border: 1px solid;
|
||||
border-radius: 4px;
|
||||
}
|
||||
"""
|
||||
)
|
||||
""")
|
||||
# Up
|
||||
self.move_up_button = QToolButton(parent=self)
|
||||
self.move_up_button.setIcon(material_icon("keyboard_double_arrow_up"))
|
||||
@@ -288,18 +286,22 @@ class XRayEye(BECWidget, QWidget):
|
||||
x=[0],
|
||||
y=[1],
|
||||
label="fit-x",
|
||||
dap=["SineModel","LinearModel"],
|
||||
dap=["SineModel", "LinearModel"],
|
||||
dap_parameters=[
|
||||
{"frequency": {"value": 0.0174533, "vary": False, "min": 0.01, "max": 0.02}},{"slope": {"value": 0, "vary": False, "min": 0.0, "max": 0.02}}],
|
||||
{"frequency": {"value": 0.0174533, "vary": False, "min": 0.01, "max": 0.02}},
|
||||
{"slope": {"value": 0, "vary": False, "min": 0.0, "max": 0.02}},
|
||||
],
|
||||
dap_oversample=5,
|
||||
)
|
||||
self.waveform_y.plot(
|
||||
x=[0],
|
||||
y=[2],
|
||||
label="fit-y",
|
||||
dap=["SineModel","LinearModel"],
|
||||
x=[0],
|
||||
y=[2],
|
||||
label="fit-y",
|
||||
dap=["SineModel", "LinearModel"],
|
||||
dap_parameters=[
|
||||
{"frequency": {"value": 0.0174533, "vary": False, "min": 0.01, "max": 0.02}},{"slope": {"value": 0, "vary": False, "min": 0.0, "max": 0.02}}],
|
||||
{"frequency": {"value": 0.0174533, "vary": False, "min": 0.01, "max": 0.02}},
|
||||
{"slope": {"value": 0, "vary": False, "min": 0.0, "max": 0.02}},
|
||||
],
|
||||
dap_oversample=5,
|
||||
)
|
||||
self.fit_x = self.waveform_x.curves[0]
|
||||
@@ -511,7 +513,7 @@ class XRayEye(BECWidget, QWidget):
|
||||
# self.fix_x.title = " got fit array"
|
||||
print(f"got fit array {fit_array}")
|
||||
self.waveform_x.curves[0].set_data(x=fit_array[0], y=fit_array[1])
|
||||
self.waveform_y.curves[0].set_data(x=fit_array[0], y=fit_array[2])
|
||||
self.waveform_y.curves[0].set_data(x=fit_array[0], y=fit_array[2])
|
||||
# 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])
|
||||
|
||||
@@ -551,13 +553,12 @@ class XRayEye(BECWidget, QWidget):
|
||||
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
|
||||
getattr(self.dev, CAMERA[0]).stop_live_mode()
|
||||
super().cleanup()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user