Changeset 6285


Ignore:
Timestamp:
Jun 10, 2021, 3:52:27 PM (2 years ago)
Author:
Nicklas Nordborg
Message:

References #1315: Support more item types in the outtake wizard

The final registration of an outtake and delivery data file should now work with the item types.

Location:
extensions/net.sf.basedb.reggie/branches/4.31-stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/4.31-stable/resources/outtake/delivery_export.js

    r4173 r6285  
    3838      {
    3939        var list = workLists[i];
    40         var name = list.name + ' (' + list.size + ')';
     40        var name = list.name + ' (' + list.size+(list.parentType?' '+list.parentType : '') + ')';
    4141        var option = new Option(name, list.id);
    4242        option.workList = list;
  • extensions/net.sf.basedb.reggie/branches/4.31-stable/resources/outtake/register.js

    r4179 r6285  
    4949      {
    5050        var list = workLists[i];
    51         var name = list.name + ' (' + list.size + ')';
     51        var name = list.name + ' (' + list.size+(list.parentType?' '+list.parentType : '') + ')';
    5252        var option = new Option(name, list.id);
    5353        option.workList = list;
     
    193193    {
    194194      submitInfo.sampleConsumed = Doc.element('sampleConsumedYes').checked;
    195       var except = [];
    196195      submitInfo.except = Link.getIdsInList(frm.except, workList.itemType);
    197196    }
  • extensions/net.sf.basedb.reggie/branches/4.31-stable/src/net/sf/basedb/reggie/servlet/OuttakeServlet.java

    r6284 r6285  
    342342       
    343343        ItemList workList = ItemList.getById(dc, workListId);
    344        
     344        Float targetAmount = (Float)Annotationtype.OUTTAKE_TARGET_AMOUNT.getAnnotationValue(dc, workList);
     345        Float targetVolume = (Float)Annotationtype.OUTTAKE_TARGET_VOLUME.getAnnotationValue(dc, workList);
     346     
    345347        ItemQuery<Extract> memberQuery = (ItemQuery<Extract>)workList.getMembers();
    346348        memberQuery.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT);
     
    360362       
    361363        TableWriter tw = new TableWriter(out);
    362         tw.tablePrintData("Name", "Box", "Position", "Quantity (µg)", "Concentration (ng/µl)");
    363         Object[] data = new Object[5];
     364        Object[] data = null;
     365        if (targetAmount != null && targetVolume != null)
     366        {
     367          tw.tablePrintData("Name", "Box", "Position", "Quantity (µg)", "Concentration (ng/µl)");
     368          data = new Object[5];
     369        }
     370        else
     371        {
     372          tw.tablePrintData("Name", "Box", "Position", "Quantity (µl)");
     373          data = new Object[4];
     374        }
    364375       
    365376        Iterator<Extract> it = memberQuery.iterate(dc);
     
    377388          data[2] = well.getCoordinate();
    378389          data[3] = Values.formatNumber(aliquot.getRemainingQuantity(), 1);
    379           data[4] = Values.formatNumber((Float)Annotationtype.DILUTION_CONC.getAnnotationValue(dc, aliquot), 1);
     390          if (data.length > 4)
     391          {
     392            data[4] = Values.formatNumber((Float)Annotationtype.DILUTION_CONC.getAnnotationValue(dc, aliquot), 1);
     393          }
    380394          tw.tablePrintData(data);
    381395        }
     
    604618          Float ndConc = (Float)Annotationtype.ND_CONC.getAnnotationValue(dc, parent);
    605619         
    606           if (remain != null && ndConc != null)
    607           {
    608             boolean isException = except.contains(aliquot.getId());
    609             if (isException) numExceptions++;
    610            
    611             if (sampleConsumed != isException)
     620          if (targetAmount != null && targetVolume != null)
     621          {
     622            if (remain != null && ndConc != null)
    612623            {
    613               Dilution d = new Dilution(targetAmount, targetVolume, ndConc, remain);
    614               creationEvent.getEventSource(parent).setUsedQuantity(d.amount);
    615               aliquot.setOriginalQuantity(d.amount);
    616               Annotationtype.DILUTION_CONC.setAnnotationValue(dc, aliquot, d.getDilutedConc());
    617               //jsonMessages.add(aliquot.getId() + ":" + aliquot.getName() + ": " + ndConc + "--" + d.getDilutedConc() + ":"+isException);
     624              boolean isException = except.contains(aliquot.getId());
     625              if (isException) numExceptions++;
     626             
     627              if (sampleConsumed != isException)
     628              {
     629                Dilution d = new Dilution(targetAmount, targetVolume, ndConc, remain);
     630                creationEvent.getEventSource(parent).setUsedQuantity(d.amount);
     631                aliquot.setOriginalQuantity(d.amount);
     632                Annotationtype.DILUTION_CONC.setAnnotationValue(dc, aliquot, d.getDilutedConc());
     633                //jsonMessages.add(aliquot.getId() + ":" + aliquot.getName() + ": " + ndConc + "--" + d.getDilutedConc() + ":"+isException);
     634              }
     635              else
     636              {
     637                // jsonMessages.add(aliquot.getId() + ":" + aliquot.getName() + " not consumed: " + isException);
     638              }
    618639            }
    619             else
     640          }
     641          else if (targetVolume != null)
     642          {
     643            if (remain != null)
    620644            {
    621               // jsonMessages.add(aliquot.getId() + ":" + aliquot.getName() + " not consumed: " + isException);
     645              boolean isException = except.contains(aliquot.getId());
     646              if (isException) numExceptions++;
     647              if (sampleConsumed != isException)
     648              {
     649                Dilution d = new Dilution(targetVolume, remain);
     650                creationEvent.getEventSource(parent).setUsedQuantity(d.volume);
     651                aliquot.setOriginalQuantity(d.volume);
     652                //jsonMessages.add(aliquot.getId() + ":" + aliquot.getName() + ": " + d.volume + ":"+isException);
     653              }
     654              else
     655              {
     656                //jsonMessages.add(aliquot.getId() + ":" + aliquot.getName() + " not consumed: " + isException);
     657              }
    622658            }
    623659          }
Note: See TracChangeset for help on using the changeset viewer.