add gonio default positions
This commit is contained in:
43
swissmx.py
43
swissmx.py
@@ -1531,7 +1531,8 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
|
||||
lambda: self.move_post_tube("out"),
|
||||
lambda: app._backlight.move("out"),
|
||||
lambda: self.move_collimator("out"),
|
||||
]
|
||||
lambda:self.move_gonio("mount"),
|
||||
]
|
||||
self.esc_run_steps(steps, "Transitioning to Sample Exchange","ManualSampleExchange")
|
||||
|
||||
def cb_esc_sample_alignment(self):
|
||||
@@ -1543,6 +1544,7 @@ class WndSwissMx(QMainWindow, Ui_MainWindow):
|
||||
lambda:self.move_post_tube("out"),
|
||||
lambda:app._backlight.move("in"),
|
||||
lambda:self.move_collimator("out"),
|
||||
lambda:self.move_gonio("align"),
|
||||
]
|
||||
#if option(CRYOJET_MOTION_ENABLED):
|
||||
# steps.extend([lambda: self.move_cryojet_nozzle("in")])
|
||||
@@ -2195,6 +2197,45 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
break
|
||||
self._esc_state = esc_state
|
||||
|
||||
def move_gonio(self, pos):
|
||||
# gonio="{'pos_mount': (0.0,0.0,0.0,0.0), 'pos_align': (0.0,0.0,0.0,0.0)}"
|
||||
# positions are: fast_x,fast_y,base_x,base_z,(omega=0,det_z, no change)
|
||||
|
||||
app=QApplication.instance()
|
||||
cfg=app._cfg
|
||||
pos_gonio = cfg.value(AppCfg.DFT_POS_GONIO)
|
||||
if pos_gonio is None:
|
||||
msg="gonio default positions are not configured."
|
||||
_log.warning(msg)
|
||||
QMessageBox.warning(self, "gonio not configured", msg)
|
||||
return
|
||||
|
||||
tw_fx = self.tweakers["fast_x"]
|
||||
tw_fy = self.tweakers["fast_y"]
|
||||
tw_cx = self.tweakers["base_x"]
|
||||
tw_cz = self.tweakers["base_z"]
|
||||
tw_ry = self.tweakers["omega"]
|
||||
try:
|
||||
p_fx, p_fy, p_cx, p_cz,=pos_gonio['pos_'+pos]
|
||||
p_ry=0.
|
||||
except KeyError:
|
||||
raise ValueError("Goniometer position *{}* is not known!!")
|
||||
_log.info(f"moving goniometer {pos} to fx:{p_fx:.5g},fy:{p_fy:.5g},cx:{p_cx:.5g},cz_{p_cz:.5g},ry:{p_ry:.5g}")
|
||||
|
||||
tw_fx.move_abs(p_fx)
|
||||
tw_fy.move_abs(p_fy)
|
||||
tw_cx.move_abs(p_cx)
|
||||
tw_cz.move_abs(p_cz)
|
||||
tw_ry.move_abs(p_ry)
|
||||
|
||||
app_utils.assert_tweaker_positions([
|
||||
(tw_fx, p_fx, 0.1),
|
||||
(tw_fy, p_fy, 0.1),
|
||||
(tw_cx, p_cx, 0.1),
|
||||
(tw_cz, p_cz, 0.1),
|
||||
(tw_ry, p_ry, 0.1), ], timeout=20.0,
|
||||
)
|
||||
|
||||
def move_post_tube(self, pos):
|
||||
# post_sample_tube="{'x_up': -0.2, 'y_up': 0.0, 'x_down': 0.0, 'y_down': 0.0, 'x_out_delta': 0.0, 'y_out_delta': 0.0, 'z_in': 0.0, 'z_out': 0.0}"
|
||||
app=QApplication.instance()
|
||||
|
||||
Reference in New Issue
Block a user