Example #1
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 #2
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;
 }