Changeset 6283
- Timestamp:
- Jun 10, 2021, 9:24:05 AM (2 years ago)
- 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/picklist.js
r5310 r6283 98 98 99 99 var list = response.list; 100 Doc.element('targetAmount').innerHTML = Reggie.formatNumber(list.TargetAmount, ' µg', 1); 101 Doc.element('targetVolume').innerHTML = Reggie.formatNumber(list.TargetVolume, ' µl', 1); 102 Doc.element('targetConcentration').innerHTML = Reggie.formatNumber(1000 * list.TargetAmount / list.TargetVolume, ' ng/µl', 2); 100 var needTargetAmount = list.TargetAmount > 0; 101 var needTargetVolume = list.TargetVolume > 0; 102 103 if (needTargetAmount) 104 { 105 Doc.element('targetAmount').innerHTML = Reggie.formatNumber(list.TargetAmount, ' µg', 1); 106 } 107 else 108 { 109 Doc.hide('targetAmountSection'); 110 } 111 if (needTargetVolume) 112 { 113 Doc.element('targetVolume').innerHTML = Reggie.formatNumber(list.TargetVolume, ' µl', 1); 114 } 115 else 116 { 117 Doc.hide('targetVolumeSection'); 118 } 119 if (needTargetAmount && needTargetVolume) 120 { 121 Doc.element('targetConcentration').innerHTML = Reggie.formatNumber(1000 * list.TargetAmount / list.TargetVolume, ' ng/µl', 2); 122 } 123 else 124 { 125 Doc.hide('targetConcentrationSection'); 126 } 103 127 104 128 var aliquots = response.aliquots; … … 168 192 { 169 193 dilution = a.dilution; 170 if (dilution.amount < list.TargetAmount) 171 { 172 // Not enough remaining quantity -- take as much as possible 173 remarks[remarks.length] = 'Remain: ' + Reggie.formatNumber(dilution.amount, ' µg', 1); 174 } 175 else if (dilution.amount > list.TargetAmount) 176 { 177 // Typically happens to avoid taking less than 1µl 178 remarks[remarks.length] = 'Large mix: ' + Reggie.formatNumber(dilution.amount, ' µg', 1); 194 if (needTargetAmount) 195 { 196 if (dilution.amount < list.TargetAmount) 197 { 198 // Not enough remaining quantity -- take as much as possible 199 remarks[remarks.length] = 'Remain: ' + Reggie.formatNumber(dilution.amount, ' µg', 1); 200 } 201 else if (dilution.amount > list.TargetAmount) 202 { 203 // Typically happens to avoid taking less than 1µl 204 remarks[remarks.length] = 'Large mix: ' + Reggie.formatNumber(dilution.amount, ' µg', 1); 205 } 206 } 207 else if (needTargetVolume) 208 { 209 if (dilution.volume < list.TargetVolume) 210 { 211 // Not enough remaining quantity -- take as much as possible 212 remarks[remarks.length] = 'Remain: ' + Reggie.formatNumber(dilution.volume, ' µl', 1); 213 } 179 214 } 180 215 if (dilution.water < 0) … … 183 218 remarks[remarks.length] = 'Conc: ' + Reggie.formatNumber(p.NdConc, ' ng/µl', 2); 184 219 dilution.water = null; 220 } 221 } 222 else 223 { 224 if (!p.remainingQuantity) 225 { 226 remarks[remarks.length] = 'Remain: unknown'; 227 } 228 else if (!p.NdConc) 229 { 230 remarks[remarks.length] = 'Conc: unknown'; 185 231 } 186 232 } -
extensions/net.sf.basedb.reggie/branches/4.31-stable/resources/outtake/picklist2.jsp
r4172 r6283 152 152 <td><%=HTML.encodeTags(workList.getName())%></td> 153 153 </tr> 154 <tr >154 <tr id="targetAmountSection"> 155 155 <th>Target amount</th> 156 156 <td><span id="targetAmount"></span></td> 157 157 </tr> 158 <tr >158 <tr id="targetVolumeSection"> 159 159 <th>Target volume</th> 160 160 <td><span id="targetVolume"></span></td> 161 161 </tr> 162 <tr >162 <tr id="targetConcentrationSection"> 163 163 <th>Target concentration</th> 164 164 <td><span id="targetConcentration"></span></td> -
extensions/net.sf.basedb.reggie/branches/4.31-stable/src/net/sf/basedb/reggie/servlet/OuttakeServlet.java
r6282 r6283 296 296 Float ndConc = (Float)Annotationtype.ND_CONC.getAnnotationValue(dc, parent); 297 297 298 if (remain != null && ndConc != null) 299 { 300 Dilution d = new Dilution(targetAmount, targetVolume, ndConc, remain); 301 jsonA.put("dilution", d.asJSONObject()); 298 if (targetAmount != null && targetVolume != null) 299 { 300 // Aliquots should be normalized 301 if (remain != null && ndConc != null) 302 { 303 Dilution d = new Dilution(targetAmount, targetVolume, ndConc, remain); 304 jsonA.put("dilution", d.asJSONObject()); 305 } 306 } 307 else if (targetVolume != null) 308 { 309 if (remain != null) 310 { 311 // A specific volume is needed (remaining quantity is expcted to be µl) 312 Dilution d = new Dilution(targetVolume, remain); 313 jsonA.put("dilution", d.asJSONObject()); 314 } 302 315 } 303 316 … … 766 779 767 780 /** 781 Use a fixed target volume. If remaining quantity is lower 782 we can't take more of course. 783 @since 4.31.3 784 */ 785 Dilution(float targetVolume, float remainingQuantity) 786 { 787 this.remainingQuantity = remainingQuantity; 788 this.conc = Float.NaN; 789 790 this.volume = Math.min(targetVolume, remainingQuantity); 791 this.water = Float.NaN; 792 this.amount = Float.NaN; 793 } 794 795 /** 768 796 Create a new dilution calculation. 769 797 @param targetAmount The target amount (µg)
Note: See TracChangeset
for help on using the changeset viewer.