Exemplo n.º 1
0
def get_task_state(entry):
    node_id = entry.get_data_model()._node_id
    _, state = qutils.get_node_state(node_id)
    node_index = qutils.node_index(entry.get_data_model())
    lims_id = mxcube.NODE_ID_TO_LIMS_ID.get(node_id, 'null')

    try:
        limsres = mxcube.rest_lims.get_dc(lims_id)
    except:
        limsres = {}

    try:
        limsres["limsTaskLink"] = limsutils.get_dc_link(lims_id)
    except Exception:
        limsres["limsTaskLink"] = "#"
        msg = "Could not get lims link for collection with id: %s" % lims_id
        logging.getLogger("HWR").error(msg)

    msg = {'Signal': '',
           'Message': '',
           'taskIndex': node_index['idx'],
           'queueID': last_queue_node()['queue_id'],
           'sample': node_index['sample'],
           'limsResultData': limsres,
           'state': state,
           'progress': 1}

    return msg
Exemplo n.º 2
0
def get_task_state(entry):
    node_id = entry.get_data_model()._node_id
    _, state = qutils.get_node_state(node_id)
    node_index = qutils.node_index(entry.get_data_model())
    lims_id = mxcube.NODE_ID_TO_LIMS_ID.get(node_id, 'null')

    try:
        limsres = mxcube.rest_lims.get_dc(lims_id)
    except:
        limsres = {}

    try:
        limsres["limsTaskLink"] = limsutils.get_dc_link(lims_id)
    except Exception:
        limsres["limsTaskLink"] = "#"
        msg = "Could not get lims link for collection with id: %s" % lims_id
        logging.getLogger("HWR").error(msg)

    msg = {'Signal': '',
           'Message': '',
           'taskIndex': node_index['idx'],
           'queueID': node_id,
           'sample': node_index['sample'],
           'limsResultData': limsres,
           'state': state,
           'progress': 1}

    return msg
Exemplo n.º 3
0
def last_queue_node():
    node = mxcube.queue.queue_hwobj._current_queue_entries[-1].get_data_model()

    # Reference collections are orphans, the node we want is the
    # characterisation not the reference collection itself
    if 'refdc' in node.get_name():
        parent = node.get_parent()
        node = parent._children[0]

    return qutils.node_index(node)
Exemplo n.º 4
0
def last_queue_node():
    node = mxcube.queue.queue_hwobj._current_queue_entries[-1].get_data_model()

    # Reference collections are orphans, the node we want is the
    # characterisation not the reference collection itself
    if 'refdc' in node.get_name():
        parent = node.get_parent()
        node = parent._children[0]

    res = qutils.node_index(node)
    res["node"] = node

    return res
Exemplo n.º 5
0
def update_task_result(entry):
    node_index = qutils.node_index(entry.get_data_model())
    node_id = entry.get_data_model()._node_id
    lims_id = mxcube.NODE_ID_TO_LIMS_ID.get(node_id, 'null')

    try:
        limsres = mxcube.rest_lims.get_dc(lims_id)
    except:
        limsres = {}

    try:
        limsres["limsTaskLink"] = limsutils.get_dc_link(lims_id)
    except Exception:
        limsres["limsTaskLink"] = "#"
        msg = "Could not get lims link for collection with id: %s" % lims_id
        logging.getLogger("HWR").error(msg)

    msg = { 'sample': node_index['sample'],
            'taskIndex': node_index['idx'],
            'limsResultData': limsres }

    socketio.emit('update_task_lims_data', msg, namespace='/hwr')
Exemplo n.º 6
0
def last_queue_node():
    node = mxcube.queue.queue_hwobj._current_queue_entries[-1].get_data_model()
    if 'refdc' in node.get_name():  # link to the corresponding char
        parent = node.get_parent()  # same parent as char
        node = parent._children[0]  # but the rfdc children not here @#@#!!!
    return qutils.node_index(node)
Exemplo n.º 7
0
def last_queue_node():
    node = mxcube.queue.queue_hwobj._current_queue_entries[-1].get_data_model()
    if 'refdc' in node.get_name():  # link to the corresponding char
        parent = node.get_parent()  # same parent as char
        node = parent._children[0]  # but the rfdc children not here @#@#!!!
    return qutils.node_index(node)