private SQNode getNodeInfoFromSQ(String nodeId) { SQNode nodeInfo = null; ProtocolBuilder mgr = m_studyQueue.getMgr(); VElement velem = mgr.getElement(nodeId); if (velem != null) { nodeInfo = new SQNode(); for (String attr : SQNode.getStandardAttributes()) { String value = mgr.getAttribute(velem, attr); nodeInfo.setAttr(attr, value); } } // String when = ""; // String[] whenEnums = {"_day", "_night"}; // for (String w : whenEnums) { // if (psLabel.contains(w)) { // when = w; // psLabel = psLabel.replace(w, ""); // } // if (title.contains(w)) { // when = w; // title = title.replace(w, ""); // } // } return nodeInfo; }
private String removeSampleInfoNode(List<String> ids) { String id = null; if (ids.size() > 0) { ProtocolBuilder mgr = m_studyQueue.getMgr(); VElement vnode = mgr.getElement(ids.get(0)); String title = mgr.getAttribute(vnode, ATTR_TITLE); if (title.contains("SampleInfo")) { id = ids.remove(0); } } return id; }
private boolean updateNodeInSQ(String id, SQNode srcNode, List<String> changed) { boolean ok = false; ProtocolBuilder mgr = m_studyQueue.getMgr(); VElement elem = mgr.getElement(id); if (elem != null) { for (String attr : changed) { String value = srcNode.getAttr(attr); mgr.setAttribute(elem, attr, value); } ok = true; } return ok; }
public void updateStatsBgstudyUI() { Messages.postDebug("SQUpdater", "updateStatsBgstudyUI"); List<String> nodes = getNodeIdsFromSQ(ProtocolBuilder.ACTIONS); Map<String, String> expStats = getExpStats(new File(m_dataWatchPath)); File f = new File(m_dataDir + "/dirinfo/parlib/parliblist"); Map<String, String> fidNames = getFidNames(f); // boolean done = nodes.size() > 0; ProtocolBuilder mgr = m_studyQueue.getMgr(); for (String node : nodes) { VElement vnode = mgr.getElement(node); String title = mgr.getAttribute(vnode, ATTR_TITLE); String stat = getValueFromTitle(title, expStats); if (stat != null) { mgr.setAttribute(vnode, ATTR_STATUS, stat); if (stat.equals(SQ_COMPLETED)) { String fidname = getValueFromTitle(title, fidNames); if (fidname != null) { mgr.setAttribute(vnode, ATTR_TITLE, fidname); } } } // // See if this node still may change // stat = m_studyQueue.getAttribute(node, ATTR_STATUS); // if (stat != null) { // if (stat.equalsIgnoreCase(READY) // || stat.equalsIgnoreCase(QUEUED) // || stat.equalsIgnoreCase(EXECUTING) // ) // { // done = false; // } // } } // // Clean up if we're done // // Keep getting false positives on this // // ... check how many updates we've done? // if (done) { // Util.sendToVnmr("SQWatch('off')"); // Util.sendToVnmr("xmhaha('refreshSQ')"); // } }
private NamedNodeMap getNodeAttributesFromSQ(String nodeId) { ProtocolBuilder mgr = m_studyQueue.getMgr(); VElement velem = mgr.getElement(nodeId); NamedNodeMap attrs = velem.getAttributes(); return attrs; }