Rev 193 | Rev 319 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 193 | Rev 267 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | var value_list1 = Blockly.JavaScript.valueToCode(block, 'list1', Blockly.JavaScript.ORDER_ATOMIC); |
2 | var value_list1 = Blockly.JavaScript.valueToCode(block, 'list1', Blockly.JavaScript.ORDER_ATOMIC); |
3 | if (value_list1.length==0) value_list1='""'; |
3 | if (value_list1.length==0) value_list1='""'; |
4 | var value_list2 = Blockly.JavaScript.valueToCode(block, 'list2', Blockly.JavaScript.ORDER_ATOMIC); |
4 | var value_list2 = Blockly.JavaScript.valueToCode(block, 'list2', Blockly.JavaScript.ORDER_ATOMIC); |
5 | if (value_list2.length==0) value_list2='""'; |
5 | if (value_list2.length==0) value_list2='""'; |
6 | var dropdown_simplepid = block.getFieldValue('simplepid'); |
6 | var dropdown_simplepid = block.getFieldValue('simplepid'); |
- | 7 | var dropdown_sameparticles = block.getFieldValue('sameparticles'); |
|
7 | var number_mass0 = block.getFieldValue('mass0'); |
8 | var number_mass0 = block.getFieldValue('mass0'); |
8 | var number_mass1 = block.getFieldValue('mass1'); |
9 | var number_mass1 = block.getFieldValue('mass1'); |
9 | var value_histogram = Blockly.JavaScript.valueToCode(block, 'histogram', Blockly.JavaScript.ORDER_ATOMIC); |
10 | var value_histogram = Blockly.JavaScript.valueToCode(block, 'histogram', Blockly.JavaScript.ORDER_ATOMIC); |
10 | if (value_histogram.length==0) value_histogram='""'; |
11 | if (value_histogram.length==0) value_histogram='""'; |
11 | // TODO: Assemble JavaScript into code variable. |
12 | // TODO: Assemble JavaScript into code variable. |
12 | var code = '{"combiner":{"list1":' + value_list1 + ',"list2":' + value_list2 + ',"pid":"' + dropdown_simplepid + '","m0":"' + number_mass0 + '","m1":"' + number_mass1 + '","histogram":' + value_histogram + '}}\n'; |
13 | var code = '{"combiner":{"list1":' + value_list1 + ',"list2":' + value_list2 + ',"sameparticles":"'+ dropdown_sameparticles +'","pid":"' + dropdown_simplepid + '","m0":"' + number_mass0 + '","m1":"' + number_mass1 + '","histogram":' + value_histogram + '}}\n'; |
13 | // TODO: Change ORDER_NONE to the correct strength. |
14 | // TODO: Change ORDER_NONE to the correct strength. |
14 | return [code, Blockly.JavaScript.ORDER_NONE]; |
15 | return [code, Blockly.JavaScript.ORDER_NONE]; |
15 | }; |
16 | }; |
16 | 17 | ||
17 | Blockly.JavaScript['particle_selector'] = function(block) { |
18 | Blockly.JavaScript['particle_selector'] = function(block) { |
Line 40... | Line 41... | ||
40 | return [code, Blockly.JavaScript.ORDER_NONE]; |
41 | return [code, Blockly.JavaScript.ORDER_NONE]; |
41 | }; |
42 | }; |
42 | 43 | ||
43 | Blockly.JavaScript['simple_analysis'] = function(block) { |
44 | Blockly.JavaScript['simple_analysis'] = function(block) { |
44 | var number_neve = block.getFieldValue('neve'); |
45 | var number_neve = block.getFieldValue('neve'); |
- | 46 | var number_first= block.getFieldValue('first'); |
|
- | 47 | var number_print= block.getFieldValue('print'); |
|
45 | var dropdown_datasource = block.getFieldValue('datasource'); |
48 | var dropdown_datasource = block.getFieldValue('datasource'); |
46 | var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC); |
49 | var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC); |
47 | if (value_list.length==0) value_list='""'; |
50 | if (value_list.length==0) value_list='""'; |
48 | // TODO: Assemble JavaScript into code variable. |
51 | // TODO: Assemble JavaScript into code variable. |
49 | var code = '{"analysis":{"neve":"' + number_neve + '","datasource":"' + dropdown_datasource + '","list":' + value_list + '}}\n'; |
52 | var code = '{"analysis":{"neve":"' + number_neve + '","first":"' + number_first + '","print":"' + number_print + '","datasource":"' + dropdown_datasource + '","list":' + value_list + '}}\n'; |
- | 53 | ||
50 | return code; |
54 | return code; |
51 | }; |
55 | }; |
52 | 56 | ||
53 | Blockly.JavaScript['particle_mass_fix'] = function(block) { |
57 | Blockly.JavaScript['particle_mass_fix'] = function(block) { |
54 | var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC); |
58 | var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC); |