def collect_oscillation_failed(owner=None, status=FAILED, state=None, lims_id="", osc_id=None, params=None): node = last_queue_node() mxcube.NODE_ID_TO_LIMS_ID[node["queue_id"]] = lims_id if not qutils.is_interleaved(node["node"]): try: blcontrol.beamline.lims_rest.get_dc(lims_id) except BaseException: pass msg = { "Signal": "collectOscillationFailed", "Message": task_signals["collectOscillationFailed"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": FAILED, "progress": 0, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: safe_emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_oscillation_finished(owner, status, state, lims_id, osc_id, params): node = last_queue_node() mxcube.NODE_ID_TO_LIMS_ID[node["queue_id"]] = lims_id if not qutils.is_interleaved(node["node"]): qutils.enable_entry(node["queue_id"], False) msg = { "Signal": "collectOscillationFinished", "Message": task_signals["collectOscillationFinished"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": COLLECTED, "progress": 1, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: safe_emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_oscillation_failed( owner=None, status=FAILED, state=None, lims_id="", osc_id=None, params=None ): node = last_queue_node() mxcube.NODE_ID_TO_LIMS_ID[node["queue_id"]] = lims_id if not qutils.is_interleaved(node["node"]): try: blcontrol.rest_lims.get_dc(lims_id) except BaseException: pass msg = { "Signal": "collectOscillationFailed", "Message": task_signals["collectOscillationFailed"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": FAILED, "progress": 0, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: safe_emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def queue_execution_entry_finished(entry, message): handle_auto_mount_next(entry) if not qutils.is_interleaved(entry.get_data_model()): socketio.emit("task", get_task_state(entry), namespace="/hwr") queue_toggle_sample(entry)
def queue_execution_entry_finished(entry): handle_auto_mount_next(entry) if not qutils.is_interleaved(entry.get_data_model()): safe_emit("task", get_task_state(entry), namespace="/hwr") if isinstance(entry, qe.SampleQueueEntry): msg = {"Signal": "DisableSample", "sampleID": entry.get_data_model().loc_str} safe_emit("queue", msg, namespace="/hwr")
def queue_execution_entry_finished(entry): handle_auto_mount_next(entry) if not qutils.is_interleaved(entry.get_data_model()): safe_emit("task", get_task_state(entry), namespace="/hwr") if isinstance(entry, qe.SampleQueueEntry): msg = { "Signal": "DisableSample", "sampleID": entry.get_data_model().loc_str } safe_emit("queue", msg, namespace="/hwr")
def collect_image_taken(frame): node = last_queue_node() if not qutils.is_interleaved(node["node"]): progress = qutils.get_task_progress(last_queue_node()["node"], frame) msg = { "Signal": "collectImageTaken", "Message": task_signals["collectImageTaken"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": RUNNING if progress < 1 else COLLECTED, "progress": progress, } try: _emit_progress(msg) except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_image_taken(frame): node = last_queue_node() if not qutils.is_interleaved(node["node"]): progress = qutils.get_task_progress(last_queue_node()["node"], frame) msg = { "Signal": "collectImageTaken", "Message": task_signals["collectImageTaken"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": RUNNING if progress < 1 else COLLECTED, "progress": progress, } try: _emit_progress(msg) except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_oscillation_started(*args): node = last_queue_node() if not qutils.is_interleaved(node["node"]): msg = { "Signal": "collectOscillationStarted", "Message": task_signals["collectOscillationStarted"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": RUNNING, "progress": 0, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: socketio.emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_oscillation_started(*args): node = last_queue_node() if not qutils.is_interleaved(node["node"]): msg = { "Signal": "collectOscillationStarted", "Message": task_signals["collectOscillationStarted"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": RUNNING, "progress": 0, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: safe_emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_ended(owner, success, message): node = last_queue_node() if not qutils.is_interleaved(node["node"]): state = COLLECTED if success else WARNING msg = { "Signal": "collectOscillationFinished", "Message": message, "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": state, "progress": 1, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: socketio.emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_ended(owner, success, message): node = last_queue_node() if not qutils.is_interleaved(node["node"]): state = COLLECTED if success else WARNING msg = { "Signal": "collectOscillationFinished", "Message": message, "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": state, "progress": 1, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: safe_emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))
def collect_oscillation_finished(owner, status, state, lims_id, osc_id, params): node = last_queue_node() mxcube.NODE_ID_TO_LIMS_ID[node["queue_id"]] = lims_id if not qutils.is_interleaved(node["node"]): qutils.enable_entry(node["queue_id"], False) msg = { "Signal": "collectOscillationFinished", "Message": task_signals["collectOscillationFinished"], "taskIndex": node["idx"], "queueID": node["queue_id"], "sample": node["sample"], "state": COLLECTED, "progress": 1, } logging.getLogger("HWR").debug("[TASK CALLBACK] " + str(msg)) try: safe_emit("task", msg, namespace="/hwr") except Exception: logging.getLogger("HWR").error("error sending message: " + str(msg))