def centring_add_current_point(): global CENTRING_POINT_ID shape = mxcube.shapes.get_shape(CENTRING_POINT_ID) if shape: shape.state = "SAVED" signals.send_shapes(update_positions=False) CENTRING_POINT_ID = None
def centring_remove_current_point(): global CENTRING_POINT_ID if CENTRING_POINT_ID: mxcube.shapes.delete_shape(CENTRING_POINT_ID) signals.send_shapes(update_positions=False) CENTRING_POINT_ID = None
def centring_add_current_point(): global CENTRING_POINT_ID shape = mxcube.shapes.get_shape(CENTRING_POINT_ID) if shape: shape.state = "SAVED" signals.send_shapes(update_positions = False) CENTRING_POINT_ID = None
def centring_remove_current_point(): global CENTRING_POINT_ID if CENTRING_POINT_ID: mxcube.shapes.delete_shape(CENTRING_POINT_ID) signals.send_shapes(update_positions = False) CENTRING_POINT_ID = None
def centring_remove_current_point(): from mxcube3.routes import signals global CENTRING_POINT_ID if CENTRING_POINT_ID: blcontrol.beamline.sample_view.delete_shape(CENTRING_POINT_ID) signals.send_shapes(update_positions=False) CENTRING_POINT_ID = None
def centring_update_current_point(motor_positions, x, y): global CENTRING_POINT_ID if CENTRING_POINT_ID: point = mxcube.shapes.get_shape(CENTRING_POINT_ID) point.move_to_mpos([motor_positions], [x, y]) else: point = mxcube.shapes.\ add_shape_from_mpos([motor_positions], (x, y), "P") point.state = "TMP" point.selected = True CENTRING_POINT_ID = point.id signals.send_shapes(update_positions=False)
def centring_update_current_point(motor_positions, x, y): global CENTRING_POINT_ID if CENTRING_POINT_ID: point = mxcube.shapes.get_shape(CENTRING_POINT_ID) point.move_to_mpos([motor_positions], [x, y]) else: point = mxcube.shapes.\ add_shape_from_mpos([motor_positions], (x, y), "P") point.state = "TMP" point.selected = True CENTRING_POINT_ID = point.id signals.send_shapes(update_positions = False)
def centring_update_current_point(motor_positions, x, y): from mxcube3.routes import signals global CENTRING_POINT_ID point = blcontrol.beamline.sample_view.get_shape(CENTRING_POINT_ID) if point: point.move_to_mpos([motor_positions], [x, y]) else: point = blcontrol.beamline.sample_view.add_shape_from_mpos( [motor_positions], (x, y), "P") point.state = "TMP" point.selected = True CENTRING_POINT_ID = point.id signals.send_shapes(update_positions=False)
def centring_add_current_point(*args): from mxcube3.routes import signals global CENTRING_POINT_ID shape = blcontrol.beamline.sample_view.get_shape(CENTRING_POINT_ID) # There is no current centered point shape when the centring is done # by software like Workflows, so we add one. if not shape: try: motors = args[1]["motors"] x, y = blcontrol.beamline.diffractometer.motor_positions_to_screen( motors) centring_update_current_point(motors, x, y) shape = blcontrol.beamline.sample_view.get_shape(CENTRING_POINT_ID) except Exception: logging.getLogger("MX3.HWR").exception("Centring failed !") if shape: shape.state = "SAVED" signals.send_shapes(update_positions=False) CENTRING_POINT_ID = None