Rev 319 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 319 | Rev 330 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | var dropdown_sameparticles = block.getFieldValue('sameparticles'); |
8 | var dropdown_sameparticles = block.getFieldValue('sameparticles'); |
9 | var number_mass0 = block.getFieldValue('mass0'); |
9 | var number_mass0 = block.getFieldValue('mass0'); |
10 | var number_mass1 = block.getFieldValue('mass1'); |
10 | var number_mass1 = block.getFieldValue('mass1'); |
11 | var histograms = Blockly.JavaScript.statementToCode(block, 'histogram'); |
11 | var histograms = Blockly.JavaScript.statementToCode(block, 'histogram'); |
12 | var code = '{"combiner":{"list1":' + value_list1 + ',"list2":' + value_list2 ; |
12 | var code = '{"combiner":{"list1":' + value_list1 + ',"list2":' + value_list2 ; |
- | 13 | code += ',"sameparticles":"'+ dropdown_sameparticles +'","pid":"' + dropdown_simplepid ; |
|
- | 14 | code += '","m0":"' + number_mass0 + '","m1":"' + number_mass1 + '","histogram":[' + histograms + ']}}\n'; |
|
- | 15 | return [code, Blockly.JavaScript.ORDER_NONE]; |
|
- | 16 | }; |
|
- | 17 | ||
- | 18 | Blockly.JavaScript['particle_combiner3'] = function(block) { |
|
- | 19 | var value_list1 = Blockly.JavaScript.valueToCode(block, 'list1', Blockly.JavaScript.ORDER_ATOMIC); |
|
- | 20 | if (value_list1.length==0) value_list1='""'; |
|
- | 21 | var value_list2 = Blockly.JavaScript.valueToCode(block, 'list2', Blockly.JavaScript.ORDER_ATOMIC); |
|
- | 22 | if (value_list2.length==0) value_list2='""'; |
|
- | 23 | var value_list3 = Blockly.JavaScript.valueToCode(block, 'list3', Blockly.JavaScript.ORDER_ATOMIC); |
|
- | 24 | if (value_list3.length==0) value_list3='""'; |
|
- | 25 | var dropdown_simplepid = block.getFieldValue('simplepid'); |
|
- | 26 | var dropdown_sameparticles = block.getFieldValue('sameparticles'); |
|
- | 27 | var number_mass0 = block.getFieldValue('mass0'); |
|
- | 28 | var number_mass1 = block.getFieldValue('mass1'); |
|
- | 29 | var histograms = Blockly.JavaScript.statementToCode(block, 'histogram'); |
|
- | 30 | var code = '{"combiner3":{"list1":' + value_list1 + ',"list2":' + value_list2 + ',"list3":' + value_list3 ; |
|
13 | code += ',"sameparticles":"'+ dropdown_sameparticles +'","pid":"' + dropdown_simplepid ; |
31 | code += ',"sameparticles":"'+ dropdown_sameparticles +'","pid":"' + dropdown_simplepid ; |
14 | code += '","m0":"' + number_mass0 + '","m1":"' + number_mass1 + '","histogram":[' + histograms + ']}}\n'; |
32 | code += '","m0":"' + number_mass0 + '","m1":"' + number_mass1 + '","histogram":[' + histograms + ']}}\n'; |
15 | return [code, Blockly.JavaScript.ORDER_NONE]; |
33 | return [code, Blockly.JavaScript.ORDER_NONE]; |
16 | }; |
34 | }; |
17 | 35 |