Changeset 2111


Ignore:
Timestamp:
Oct 30, 2013, 9:59:43 AM (9 years ago)
Author:
olle
Message:

Refs #502. Design for flow cell creation updated to allow one or more empty lanes in a flow cell. However, at least one lane in flow cells created together must contain a pool, i.e. all lanes must not be empty.

JSP script create_flowcells.jsp in reggie/resources/libprep/ update:

  1. Function gotoStep2() updated when creating pop-up menu for changing pool selection for a lane to include an option "empty" last in the menu, after a separator line. The option name is shown in italics, to emphasize that it is not a pool name, and it is contained in an HTML <div> tag with id="pool-none".
  2. Function poolSelected(Event) updated to first check if option id equals "pool-none", before trying to get the index for the pool. If the lane is empty, the pool is set to null.
  3. Function checkFlowCells() updated to count the number of empty lanes for the flow cells to be created. If all lanes are empty, an error message is shown, while if some lanes are empty, but not all, only a warning is shown.
  4. Function goRegister() updated to exclude empty lanes when calculating the number of times a separate pool appears, and the volume used for it.

Java class/file FlowCellServlet.java in reggie/src/net/sf/basedb/reggie/servlet/ update:

  1. Protected method void doPost(HttpServletRequest req, HttpServletResponse resp) updated for cmd equal to "CreateFlowCells" to check if JSON object jsonPool for a lane equals null, and if so include it in the empty lane count.
Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/create_flowcells.jsp

    r2110 r2111  
    280280      var index = selectedPools.length;
    281281      selectedPools[index] = pool;
    282      
     282
    283283      selectPoolHtml += '<div class="menuitem enabled" id="pool-'+pool.id+'" data-index="'+index+'">';
    284284      selectPoolHtml += pool.name+'</div>';
    285285    }
    286286  }
     287  // Add separator
     288  selectPoolHtml += '<div class="menuseparator"></div>';
     289  // Add option for empty lane
     290  selectPoolHtml += '<div class="menuitem enabled" id="pool-none">';
     291  selectPoolHtml += '<i>empty</i>'+'</div>';
     292 
    287293  setInnerHTML('select-pool-all', selectPoolHtml);
    288294
     
    346352  flowCellsAreValid = false;
    347353 
     354  var frm = document.forms['reggie'];
     355  var numFlowCells = Forms.getCheckedRadio(frm.num_flowcells).value;
     356  var numLanes = Forms.getCheckedRadio(frm.num_lanes).value;
     357  var numEmptyLanes = 0;
     358  var missingValues = false;
    348359  for (var fcNo = 0; fcNo < flowCells.length; fcNo++)
    349360  {
     
    363374      if (!pool)
    364375      {
    365         setInputStatus('flowCells', 'Missing', 'invalid');
    366         return;
     376        missingValues = true;
     377        numEmptyLanes++;
    367378      }
    368379    }
    369380  }
    370  
    371  
    372   setInputStatus('flowCells', '', 'valid');
    373   flowCellsAreValid = true;
     381
     382  if (numEmptyLanes >= numFlowCells*numLanes)
     383  {
     384    setInputStatus('flowCells', 'All lanes empty', 'invalid');
     385  }
     386  else if (missingValues)
     387  {
     388    setInputStatus('flowCells', 'Missing', 'warning');
     389    flowCellsAreValid = true;
     390  }
     391  else
     392  {
     393    setInputStatus('flowCells', '', 'valid');
     394    flowCellsAreValid = true;
     395  }
    374396}
    375397
     
    445467      lane.defaultPool = null; // Do not need to submit this information
    446468      var pool = lane.pool;
    447       pool.count = pool.count ? pool.count+1 : 1;
     469      if (pool != null)
     470      {
     471        pool.count = pool.count ? pool.count+1 : 1;
     472      }
    448473    }
    449474  }
     
    452477  {
    453478    var pool = selectedPools[poolNo];
    454     pool.usedVolume = VOLUME_TO_USE_FROM_POOL / pool.count;
     479    if (pool != null)
     480    {
     481      pool.usedVolume = VOLUME_TO_USE_FROM_POOL / pool.count;
     482    }
    455483  }
    456484 
     
    550578function poolSelected(event)
    551579{
    552   var index = event.target.getAttribute('data-index');
    553   var pool = selectedPools[index];
     580  var optionId = event.target.id;
     581  var pool = null;
     582  if (optionId != 'pool-none')
     583  {
     584    var index = event.target.getAttribute('data-index');
     585    pool = selectedPools[index];
     586  }
    554587  flowCells[currentFcNo].lanes[currentLaneNo].pool = pool;
    555588  setInnerHTML('lane.'+currentLaneNo+'.'+currentFcNo, pool ? pool.name : '');
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java

    r2109 r2111  
    302302           
    303303            JSONObject jsonPool = (JSONObject)jsonLane.get("pool");
     304            // JSONArray jsonLane may have JSONObject elements with a "defaultPool" key, but no "pool" key
     305            if (jsonPool == null)
     306            {
     307              emptyLanes++;
     308              continue;
     309            }
    304310            Number poolId = (Number)jsonPool.get("id");
    305311            float usedVolume = ((Number)jsonPool.get("usedVolume")).floatValue();
Note: See TracChangeset for help on using the changeset viewer.