3449 |
28 Jul 15 |
olle |
var Protocol = function() |
3449 |
28 Jul 15 |
olle |
2 |
{ |
3449 |
28 Jul 15 |
olle |
var protocol = {}; |
3449 |
28 Jul 15 |
olle |
var debug = 0; |
3449 |
28 Jul 15 |
olle |
5 |
|
3449 |
28 Jul 15 |
olle |
var QUANTITY_REGULAR = 1.1; |
3449 |
28 Jul 15 |
olle |
var LOW_QUANTITY_WARNING_FACTOR = 2; |
3449 |
28 Jul 15 |
olle |
8 |
|
3449 |
28 Jul 15 |
olle |
// Page initialization |
3449 |
28 Jul 15 |
olle |
protocol.initPage = function() |
3449 |
28 Jul 15 |
olle |
11 |
{ |
3449 |
28 Jul 15 |
olle |
var pageId = Doc.getPageId(); |
3449 |
28 Jul 15 |
olle |
if (pageId == 'protocol') |
3449 |
28 Jul 15 |
olle |
14 |
{ |
3449 |
28 Jul 15 |
olle |
Buttons.addClickHandler('print-button', Wizard.goPrint); |
3449 |
28 Jul 15 |
olle |
16 |
|
3449 |
28 Jul 15 |
olle |
var libPlateId = Data.int('page-data', 'libplate'); |
3449 |
28 Jul 15 |
olle |
18 |
|
3449 |
28 Jul 15 |
olle |
var url = '../LibPrep.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetLibraryInfoForPlate&bioplate='+libPlateId; |
3449 |
28 Jul 15 |
olle |
Wizard.showLoadingAnimation('Loading Library bioplate information...'); |
3449 |
28 Jul 15 |
olle |
Wizard.asyncJsonRequest(url, protocol.initializeProtocol); |
3449 |
28 Jul 15 |
olle |
23 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
25 |
{ |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('bioplate', 'change', protocol.bioplateOnChange); |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('listview', 'click', protocol.viewProtocol); |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler('plateview', 'click', protocol.viewProtocol); |
3449 |
28 Jul 15 |
olle |
29 |
|
3449 |
28 Jul 15 |
olle |
30 |
/* |
3449 |
28 Jul 15 |
olle |
var request = Ajax.getXmlHttpRequest(); |
3449 |
28 Jul 15 |
olle |
var url = '../LibPrep.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetConfigurationsForCaliperRunParametersExporter'; |
3449 |
28 Jul 15 |
olle |
Wizard.asyncJsonRequest(url, protocol.initExportLinks); |
3449 |
28 Jul 15 |
olle |
35 |
*/ |
3449 |
28 Jul 15 |
olle |
36 |
|
3449 |
28 Jul 15 |
olle |
var url = '../LibPrep.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
url += '&cmd=GetLibraryPlatesForLibPrep'; |
3449 |
28 Jul 15 |
olle |
Wizard.showLoadingAnimation('Loading Library plates...'); |
3449 |
28 Jul 15 |
olle |
Wizard.asyncJsonRequest(url, protocol.initializeStep1); |
3449 |
28 Jul 15 |
olle |
41 |
} |
3449 |
28 Jul 15 |
olle |
42 |
} |
3449 |
28 Jul 15 |
olle |
43 |
|
3449 |
28 Jul 15 |
olle |
44 |
|
3449 |
28 Jul 15 |
olle |
protocol.initializeStep1 = function(response) |
3449 |
28 Jul 15 |
olle |
46 |
{ |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
48 |
|
3449 |
28 Jul 15 |
olle |
var bioplates = response.bioplates; |
3449 |
28 Jul 15 |
olle |
var plates = frm.bioplate; |
3449 |
28 Jul 15 |
olle |
if (bioplates.length > 0) |
3449 |
28 Jul 15 |
olle |
52 |
{ |
3449 |
28 Jul 15 |
olle |
for (var i=0; i < bioplates.length; i++) |
3449 |
28 Jul 15 |
olle |
54 |
{ |
3449 |
28 Jul 15 |
olle |
var bioplate = bioplates[i]; |
3449 |
28 Jul 15 |
olle |
var option = new Option(bioplate.name, bioplate.id); |
3449 |
28 Jul 15 |
olle |
option.bioplate = bioplate; |
3449 |
28 Jul 15 |
olle |
plates.options[plates.length] = option; |
3449 |
28 Jul 15 |
olle |
59 |
} |
3449 |
28 Jul 15 |
olle |
bioplateIsValid = true; |
3449 |
28 Jul 15 |
olle |
protocol.bioplateOnChange(); |
3449 |
28 Jul 15 |
olle |
62 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
64 |
{ |
3449 |
28 Jul 15 |
olle |
Wizard.setFatalError('No Library bioplates available for processing.'); |
3449 |
28 Jul 15 |
olle |
return; |
3449 |
28 Jul 15 |
olle |
67 |
} |
3449 |
28 Jul 15 |
olle |
68 |
|
3449 |
28 Jul 15 |
olle |
Doc.show('step-1'); |
3449 |
28 Jul 15 |
olle |
70 |
} |
3449 |
28 Jul 15 |
olle |
71 |
|
3449 |
28 Jul 15 |
olle |
protocol.initExportLinks = function(response) |
3449 |
28 Jul 15 |
olle |
73 |
{ |
3449 |
28 Jul 15 |
olle |
var configurations = response.configurations; |
3449 |
28 Jul 15 |
olle |
var caliper96 = protocol.makeExportLink('Sample names for Caliper (96)', 'CALIPER', 'SAMPLE_NAMES'); |
3449 |
28 Jul 15 |
olle |
var caliper384 = protocol.makeExportLink('Sample names for Caliper (384)', 'CALIPER', 'SAMPLE_NAMES_384'); |
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < configurations.length; i++) |
3449 |
28 Jul 15 |
olle |
78 |
{ |
3449 |
28 Jul 15 |
olle |
var config = configurations[i]; |
3449 |
28 Jul 15 |
olle |
var btnHtml = protocol.makeExportLink('Run parameters: '+Strings.encodeTags(config.name), 'CALIPER', config.id); |
3449 |
28 Jul 15 |
olle |
if (config.name.indexOf('384') > 0) |
3449 |
28 Jul 15 |
olle |
82 |
{ |
3449 |
28 Jul 15 |
olle |
caliper384 += btnHtml; |
3449 |
28 Jul 15 |
olle |
84 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
86 |
{ |
3449 |
28 Jul 15 |
olle |
caliper96 += btnHtml; |
3449 |
28 Jul 15 |
olle |
88 |
} |
3449 |
28 Jul 15 |
olle |
89 |
} |
3449 |
28 Jul 15 |
olle |
Doc.element('exportCaliper96').innerHTML = caliper96; |
3449 |
28 Jul 15 |
olle |
Doc.element('exportCaliper384').innerHTML = caliper384; |
3449 |
28 Jul 15 |
olle |
92 |
|
3449 |
28 Jul 15 |
olle |
var qubit = protocol.makeExportLink('Sample names for Qubit', 'QUBIT', 'SAMPLE_NAMES'); |
3449 |
28 Jul 15 |
olle |
Doc.element('exportQubit').innerHTML = qubit; |
3449 |
28 Jul 15 |
olle |
95 |
|
3449 |
28 Jul 15 |
olle |
var links = Doc.element('export').getElementsByClassName('link'); |
3449 |
28 Jul 15 |
olle |
for (var linkNo = 0; linkNo < links.length; linkNo++) |
3449 |
28 Jul 15 |
olle |
98 |
{ |
3449 |
28 Jul 15 |
olle |
Events.addEventHandler(links[linkNo], 'click', protocol.exportFile); |
3449 |
28 Jul 15 |
olle |
100 |
} |
3449 |
28 Jul 15 |
olle |
101 |
} |
3449 |
28 Jul 15 |
olle |
102 |
|
3449 |
28 Jul 15 |
olle |
protocol.makeExportLink = function(title, hardware, exporter) |
3449 |
28 Jul 15 |
olle |
104 |
{ |
3449 |
28 Jul 15 |
olle |
var btn = ''; |
3449 |
28 Jul 15 |
olle |
btn += '<span class="link" data-hardware="'+hardware+'" data-exporter="'+exporter+'">'; |
3449 |
28 Jul 15 |
olle |
btn += '<img src="../images/export.png"> '; |
3449 |
28 Jul 15 |
olle |
btn += title+'</span><br>\n'; |
3449 |
28 Jul 15 |
olle |
return btn; |
3449 |
28 Jul 15 |
olle |
110 |
} |
3449 |
28 Jul 15 |
olle |
111 |
|
3449 |
28 Jul 15 |
olle |
// Add pools to the pools list based on the bioplate selection |
3449 |
28 Jul 15 |
olle |
protocol.bioplateOnChange = function() |
3449 |
28 Jul 15 |
olle |
114 |
{ |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate; |
3449 |
28 Jul 15 |
olle |
Doc.element('comments').innerHTML = Strings.encodeTags(bioplate.comments); |
3449 |
28 Jul 15 |
olle |
frm.poolSchema.value = bioplate.poolSchema; |
3449 |
28 Jul 15 |
olle |
frm.barcodeVariant.value = bioplate.barcodeVariant; |
3449 |
28 Jul 15 |
olle |
120 |
} |
3449 |
28 Jul 15 |
olle |
121 |
|
3449 |
28 Jul 15 |
olle |
122 |
|
3449 |
28 Jul 15 |
olle |
protocol.viewProtocol = function(event) |
3449 |
28 Jul 15 |
olle |
124 |
{ |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
if (frm.bioplate && !frm.bioplate.disabled) |
3449 |
28 Jul 15 |
olle |
127 |
{ |
3449 |
28 Jul 15 |
olle |
frm.view.value = Data.get(event.currentTarget, 'protocol-type'); |
3449 |
28 Jul 15 |
olle |
frm.submit(); |
3449 |
28 Jul 15 |
olle |
130 |
} |
3449 |
28 Jul 15 |
olle |
131 |
} |
3449 |
28 Jul 15 |
olle |
132 |
|
3449 |
28 Jul 15 |
olle |
protocol.exportFile = function(event) |
3449 |
28 Jul 15 |
olle |
134 |
{ |
3449 |
28 Jul 15 |
olle |
var frm = document.forms['meludi']; |
3449 |
28 Jul 15 |
olle |
if (frm.bioplate && !frm.bioplate.disabled) |
3449 |
28 Jul 15 |
olle |
137 |
{ |
3449 |
28 Jul 15 |
olle |
var bioPlateId = frm.bioplate[frm.bioplate.selectedIndex].value; |
3449 |
28 Jul 15 |
olle |
139 |
|
3449 |
28 Jul 15 |
olle |
var hardware = Data.get(event.currentTarget, 'hardware'); |
3449 |
28 Jul 15 |
olle |
var exporter = Data.get(event.currentTarget, 'exporter'); |
3449 |
28 Jul 15 |
olle |
142 |
|
3449 |
28 Jul 15 |
olle |
var url = '../LibPrep.servlet?ID='+App.getSessionId(); |
3449 |
28 Jul 15 |
olle |
if (hardware == 'CALIPER') |
3449 |
28 Jul 15 |
olle |
145 |
{ |
3449 |
28 Jul 15 |
olle |
if (exporter == 'SAMPLE_NAMES') |
3449 |
28 Jul 15 |
olle |
147 |
{ |
3449 |
28 Jul 15 |
olle |
url += '&cmd=ExportSampleNamesForCaliper&bioPlateId='+bioPlateId; |
3449 |
28 Jul 15 |
olle |
149 |
} |
3449 |
28 Jul 15 |
olle |
else if (exporter == 'SAMPLE_NAMES_384') |
3449 |
28 Jul 15 |
olle |
151 |
{ |
3449 |
28 Jul 15 |
olle |
url += '&cmd=ExportSampleNamesForCaliper&remapTo384=1&bioPlateId='+bioPlateId; |
3449 |
28 Jul 15 |
olle |
153 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
155 |
{ |
3449 |
28 Jul 15 |
olle |
url += '&cmd=ExportCaliperRunParameters&bioPlateId='+bioPlateId+'&configurationId='+exporter; |
3449 |
28 Jul 15 |
olle |
157 |
} |
3449 |
28 Jul 15 |
olle |
158 |
} |
3449 |
28 Jul 15 |
olle |
else if (hardware == 'QUBIT') |
3449 |
28 Jul 15 |
olle |
160 |
{ |
3449 |
28 Jul 15 |
olle |
if (exporter == 'SAMPLE_NAMES') |
3449 |
28 Jul 15 |
olle |
162 |
{ |
3449 |
28 Jul 15 |
olle |
url += '&cmd=ExportSampleNamesForQubit&bioPlateId='+bioPlateId; |
3449 |
28 Jul 15 |
olle |
164 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
166 |
{ |
3449 |
28 Jul 15 |
olle |
alert('not implemented'); |
3449 |
28 Jul 15 |
olle |
return; |
3449 |
28 Jul 15 |
olle |
169 |
} |
3449 |
28 Jul 15 |
olle |
170 |
} |
3449 |
28 Jul 15 |
olle |
window.location = url; |
3449 |
28 Jul 15 |
olle |
172 |
} |
3449 |
28 Jul 15 |
olle |
173 |
} |
3449 |
28 Jul 15 |
olle |
174 |
|
3449 |
28 Jul 15 |
olle |
protocol.initializeProtocol = function(response) |
3449 |
28 Jul 15 |
olle |
176 |
{ |
3449 |
28 Jul 15 |
olle |
var list = response.libraries; |
3449 |
28 Jul 15 |
olle |
178 |
|
3449 |
28 Jul 15 |
olle |
179 |
|
3449 |
28 Jul 15 |
olle |
var schema = PoolSchema.getById(Data.get('page-data', 'schema')); |
3449 |
28 Jul 15 |
olle |
var barcodeVariant = PoolSchema.getBarcodeVariantByName(schema, Data.get('page-data', 'barcode-variant')); |
3449 |
28 Jul 15 |
olle |
182 |
|
3449 |
28 Jul 15 |
olle |
// Pre-process the Library items |
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < list.length; i++) |
3449 |
28 Jul 15 |
olle |
185 |
{ |
3449 |
28 Jul 15 |
olle |
protocol.checkAndPreProcessLibrary(list[i], schema, barcodeVariant); |
3449 |
28 Jul 15 |
olle |
187 |
} |
3449 |
28 Jul 15 |
olle |
188 |
|
3449 |
28 Jul 15 |
olle |
var view = Data.get('page-data', 'view'); |
3449 |
28 Jul 15 |
olle |
if (view == 'list') |
3449 |
28 Jul 15 |
olle |
191 |
{ |
3449 |
28 Jul 15 |
olle |
protocol.viewAsList(list, schema, barcodeVariant); |
3449 |
28 Jul 15 |
olle |
193 |
} |
3449 |
28 Jul 15 |
olle |
else |
3449 |
28 Jul 15 |
olle |
195 |
{ |
3449 |
28 Jul 15 |
olle |
protocol.viewAsPlate(list, schema, barcodeVariant) |
3449 |
28 Jul 15 |
olle |
197 |
} |
3449 |
28 Jul 15 |
olle |
198 |
|
3449 |
28 Jul 15 |
olle |
199 |
} |
3449 |
28 Jul 15 |
olle |
200 |
|
3449 |
28 Jul 15 |
olle |
201 |
/** |
3449 |
28 Jul 15 |
olle |
Find the lowest used quantity. This is the QUANTITY_REGULAR |
3449 |
28 Jul 15 |
olle |
value. RNA with larger used quantities are assumed to be selected |
3449 |
28 Jul 15 |
olle |
for QC. |
3449 |
28 Jul 15 |
olle |
205 |
*/ |
3449 |
28 Jul 15 |
olle |
protocol.findLowestUsedQuantity = function(mrnaList) |
3449 |
28 Jul 15 |
olle |
207 |
{ |
3449 |
28 Jul 15 |
olle |
var lowestQuantity = mrnaList[0].rna.usedQuantity; |
3449 |
28 Jul 15 |
olle |
for (var i = 1; i < mrnaList.length; i++) |
3449 |
28 Jul 15 |
olle |
210 |
{ |
3449 |
28 Jul 15 |
olle |
var rna = mrnaList[i].rna; |
3449 |
28 Jul 15 |
olle |
if (rna.usedQuantity < lowestQuantity) |
3449 |
28 Jul 15 |
olle |
213 |
{ |
3449 |
28 Jul 15 |
olle |
lowestQuantity = rna.usedQuantity; |
3449 |
28 Jul 15 |
olle |
215 |
} |
3449 |
28 Jul 15 |
olle |
216 |
} |
3449 |
28 Jul 15 |
olle |
return lowestQuantity; |
3449 |
28 Jul 15 |
olle |
218 |
} |
3449 |
28 Jul 15 |
olle |
219 |
|
3449 |
28 Jul 15 |
olle |
220 |
|
3449 |
28 Jul 15 |
olle |
protocol.checkAndPreProcessLibrary = function(lib, schema, barcodeVariant) |
3449 |
28 Jul 15 |
olle |
222 |
{ |
3449 |
28 Jul 15 |
olle |
var well = lib.bioWell; |
3449 |
28 Jul 15 |
olle |
var remarks = []; |
3449 |
28 Jul 15 |
olle |
225 |
|
3449 |
28 Jul 15 |
olle |
// Check if default barcode has been modified |
3449 |
28 Jul 15 |
olle |
var indexSet = barcodeVariant.indexSets[well.column]; |
3449 |
28 Jul 15 |
olle |
if (indexSet) |
3449 |
28 Jul 15 |
olle |
229 |
{ |
3449 |
28 Jul 15 |
olle |
var defaultBarcode = indexSet.barcodes[well.row]; |
3449 |
28 Jul 15 |
olle |
if (defaultBarcode && lib.barcode.name != defaultBarcode) |
3449 |
28 Jul 15 |
olle |
232 |
{ |
3449 |
28 Jul 15 |
olle |
remarks[remarks.length] = 'Modified barcode'; |
3449 |
28 Jul 15 |
olle |
lib.barcode.modified = true; |
3449 |
28 Jul 15 |
olle |
235 |
} |
3449 |
28 Jul 15 |
olle |
236 |
} |
3449 |
28 Jul 15 |
olle |
lib.remarks = remarks; |
3449 |
28 Jul 15 |
olle |
238 |
} |
3449 |
28 Jul 15 |
olle |
239 |
|
3449 |
28 Jul 15 |
olle |
protocol.viewAsPlate = function(list, schema, barcodeVariant) |
3449 |
28 Jul 15 |
olle |
241 |
{ |
3449 |
28 Jul 15 |
olle |
var rows = Data.get('page-data', 'rows'); |
3449 |
28 Jul 15 |
olle |
var columns = Data.get('page-data', 'columns'); |
3449 |
28 Jul 15 |
olle |
Plate.init(rows, columns, schema, WellPainter); |
3449 |
28 Jul 15 |
olle |
245 |
|
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < list.length; i++) |
3449 |
28 Jul 15 |
olle |
247 |
{ |
3449 |
28 Jul 15 |
olle |
var lib = list[i]; |
3449 |
28 Jul 15 |
olle |
var well = lib.bioWell; |
3449 |
28 Jul 15 |
olle |
Plate.getWell(well.row, well.column).setExtract(lib); |
3449 |
28 Jul 15 |
olle |
251 |
} |
3449 |
28 Jul 15 |
olle |
252 |
|
3449 |
28 Jul 15 |
olle |
WellPainter.barcodeVariant = barcodeVariant; |
3449 |
28 Jul 15 |
olle |
Plate.paint(Plate.getWells()); |
3449 |
28 Jul 15 |
olle |
PoolSchema.buildPoolTableRow(schema, columns); |
3449 |
28 Jul 15 |
olle |
256 |
|
3449 |
28 Jul 15 |
olle |
Doc.show('all-protocol'); |
3449 |
28 Jul 15 |
olle |
258 |
} |
3449 |
28 Jul 15 |
olle |
259 |
|
3449 |
28 Jul 15 |
olle |
protocol.viewAsList = function(list, schema, barcodeVariant) |
3449 |
28 Jul 15 |
olle |
261 |
{ |
3449 |
28 Jul 15 |
olle |
var lastPoolNum = -1; |
3449 |
28 Jul 15 |
olle |
for (var i = 0; i < list.length; i++) |
3449 |
28 Jul 15 |
olle |
264 |
{ |
3449 |
28 Jul 15 |
olle |
var lib = list[i]; |
3449 |
28 Jul 15 |
olle |
var well = lib.bioWell; |
3449 |
28 Jul 15 |
olle |
267 |
|
3449 |
28 Jul 15 |
olle |
var idSuffix = well.column + '.' + well.row; |
3449 |
28 Jul 15 |
olle |
Doc.removeClass('row.'+idSuffix, 'empty'); |
3449 |
28 Jul 15 |
olle |
Doc.element('lib.'+idSuffix).innerHTML = Strings.encodeTags(lib.name); |
3449 |
28 Jul 15 |
olle |
Doc.element('barcode.'+idSuffix).innerHTML = Strings.encodeTags(lib.barcode.name); |
3449 |
28 Jul 15 |
olle |
272 |
|
3449 |
28 Jul 15 |
olle |
var indexSet = barcodeVariant.indexSets[well.column]; |
3449 |
28 Jul 15 |
olle |
if (indexSet) |
3449 |
28 Jul 15 |
olle |
275 |
{ |
3449 |
28 Jul 15 |
olle |
var color = lib.barcode.modified ? 'bg-modified' : indexSet.color; |
3449 |
28 Jul 15 |
olle |
Doc.addClass('barcode.'+idSuffix, color); |
3449 |
28 Jul 15 |
olle |
278 |
} |
3449 |
28 Jul 15 |
olle |
279 |
|
3449 |
28 Jul 15 |
olle |
Doc.element('remarks.'+idSuffix).innerHTML = lib.remarks.join('; '); |
3449 |
28 Jul 15 |
olle |
281 |
} |
3449 |
28 Jul 15 |
olle |
282 |
|
3449 |
28 Jul 15 |
olle |
Doc.show('all-protocol'); |
3449 |
28 Jul 15 |
olle |
284 |
} |
3449 |
28 Jul 15 |
olle |
285 |
|
3449 |
28 Jul 15 |
olle |
286 |
|
3449 |
28 Jul 15 |
olle |
return protocol; |
3449 |
28 Jul 15 |
olle |
288 |
}(); |
3449 |
28 Jul 15 |
olle |
289 |
|
3449 |
28 Jul 15 |
olle |
Doc.onLoad(Protocol.initPage); |
3449 |
28 Jul 15 |
olle |
291 |
|
3449 |
28 Jul 15 |
olle |
292 |
|
3449 |
28 Jul 15 |
olle |
var WellPainter = function() |
3449 |
28 Jul 15 |
olle |
294 |
{ |
3449 |
28 Jul 15 |
olle |
var painter = {}; |
3449 |
28 Jul 15 |
olle |
296 |
|
3449 |
28 Jul 15 |
olle |
painter.getClassNameForWell = function(well, schema) |
3449 |
28 Jul 15 |
olle |
298 |
{ |
3449 |
28 Jul 15 |
olle |
var cls = ''; |
3449 |
28 Jul 15 |
olle |
var indexSet = painter.barcodeVariant.indexSets[well.column]; |
3449 |
28 Jul 15 |
olle |
if (indexSet) |
3449 |
28 Jul 15 |
olle |
302 |
{ |
3449 |
28 Jul 15 |
olle |
var lib = well.extract; |
3449 |
28 Jul 15 |
olle |
cls += lib && lib.barcode.modified ? 'bg-modified' : indexSet.color; |
3449 |
28 Jul 15 |
olle |
305 |
} |
3449 |
28 Jul 15 |
olle |
return cls; |
3449 |
28 Jul 15 |
olle |
307 |
} |
3449 |
28 Jul 15 |
olle |
308 |
|
3449 |
28 Jul 15 |
olle |
painter.getWellText = function(well, schema) |
3449 |
28 Jul 15 |
olle |
310 |
{ |
3449 |
28 Jul 15 |
olle |
var text = ''; |
3449 |
28 Jul 15 |
olle |
var lib = well.extract; |
3449 |
28 Jul 15 |
olle |
if (lib) |
3449 |
28 Jul 15 |
olle |
314 |
{ |
3449 |
28 Jul 15 |
olle |
var name = lib.name; |
3449 |
28 Jul 15 |
olle |
var i = name.indexOf('.m'); |
3449 |
28 Jul 15 |
olle |
text += '<div class="lib">'+Strings.encodeTags(name.substring(0, i))+'.<br> '+Strings.encodeTags(name.substring(i))+'</div>'; |
3449 |
28 Jul 15 |
olle |
text += '<div class="barcode">'+Strings.encodeTags(lib.barcode.name)+'</div>'; |
3449 |
28 Jul 15 |
olle |
text += '<div class="remarks">'+ lib.remarks.join('; ') + '</div>'; |
3449 |
28 Jul 15 |
olle |
320 |
} |
3449 |
28 Jul 15 |
olle |
return text; |
3449 |
28 Jul 15 |
olle |
322 |
} |
3449 |
28 Jul 15 |
olle |
323 |
|
3449 |
28 Jul 15 |
olle |
return painter; |
3449 |
28 Jul 15 |
olle |
325 |
}(); |