Example #1
0
 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;
 }
Example #2
0
 private List<String> getNodeIdsFromSQ(int nodeType) {
   ProtocolBuilder mgr = m_studyQueue.getMgr();
   ArrayList<VElement> elementList;
   elementList = mgr.getElements(null, nodeType);
   ArrayList<String> ids = new ArrayList<String>();
   for (VElement elem : elementList) {
     ids.add(elem.getAttribute(ProtocolBuilder.ATTR_ID));
   }
   return ids;
 }
Example #3
0
 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;
 }
Example #4
0
 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;
 }
Example #5
0
  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')");
    //       }
  }
Example #6
0
 private NamedNodeMap getNodeAttributesFromSQ(String nodeId) {
   ProtocolBuilder mgr = m_studyQueue.getMgr();
   VElement velem = mgr.getElement(nodeId);
   NamedNodeMap attrs = velem.getAttributes();
   return attrs;
 }