def cryoTiltSample(rx, rz=0): """ Provide the ability to switch between imaging and tilted position, withing bumping into anything. Imaging position is considered when rx and rz are equal 0, otherwise it's considered tilting :param rx: (float) rotation movement in x axis :param rz: (float) rotation movement in z axis :return (CancellableFuture -> None): cancellable future of the move to observe the progress, and control raising the ValueError exception """ # Get the stage and align components from the backend components stage = model.getComponent(role='stage') align = model.getComponent(role='align') f = model.CancellableFuture() f.task_canceller = _cancelCryoMoveSample f._task_state = RUNNING f._task_lock = threading.Lock() f._running_subf = model.InstantaneousFuture() # Run in separate thread executeAsyncTask(f, _doCryoTiltSample, args=( f, stage, align, rx, rz, )) return f
def cryoSwitchSamplePosition(target): """ Provide the ability to switch between loading, imaging and coating position, without bumping into anything. :param target: (int) target position either one of the constants LOADING, IMAGING, COATING AND ALIGNMENT :return (CancellableFuture -> None): cancellable future of the move to observe the progress, and control raising the ValueError exception """ f = model.CancellableFuture() f.task_canceller = _cancelCryoMoveSample f._task_state = RUNNING f._task_lock = threading.Lock() f._running_subf = model.InstantaneousFuture() # Run in separate thread executeAsyncTask(f, _doCryoSwitchSamplePosition, args=(f, target)) return f
def cryoSwitchAlignPosition(target): """ Provide the ability to switch between loading, imaging and alignment position, without bumping into anything. :param target: (int) target position either one of the constants LOADING, IMAGING or ALIGNMENT :return (CancellableFuture -> None): cancellable future of the move to observe the progress, and control the raise ValueError exception """ # Get the aligner from backend components align = model.getComponent(role='align') f = model.CancellableFuture() f.task_canceller = _cancelCryoMoveSample f._task_state = RUNNING f._task_lock = threading.Lock() f._running_subf = model.InstantaneousFuture() # Run in separate thread executeAsyncTask(f, _doCryoSwitchAlignPosition, args=(f, align, target)) return f
def cryoLoadSample(target): """ Provide the ability to switch between loading position and imaging position, without bumping into anything. :param target: (int) target position either one of the constants LOADING or IMAGING :return (CancellableFuture -> None): cancellable future of the move to observe the progress, and control the raise ValueError exception """ # Get the stage and focus components from the backend components stage = model.getComponent(role='stage') focus = model.getComponent(role='focus') f = model.CancellableFuture() f.task_canceller = _cancelCryoMoveSample f._task_state = RUNNING f._task_lock = threading.Lock() f._running_subf = model.InstantaneousFuture() # Run in separate thread executeAsyncTask(f, _doCryoLoadSample, args=(f, stage, focus, target)) return f