Subversion Repositories f9daq

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
193 f9daq 1
Blockly.JavaScript['particle_combiner'] = function(block) {
2
  var value_list1 = Blockly.JavaScript.valueToCode(block, 'list1', Blockly.JavaScript.ORDER_ATOMIC);
3
  var value_list2 = Blockly.JavaScript.valueToCode(block, 'list2', Blockly.JavaScript.ORDER_ATOMIC);
4
  var value_pid = Blockly.JavaScript.valueToCode(block, 'pid', Blockly.JavaScript.ORDER_ATOMIC);
5
  var number_mass0 = block.getFieldValue('mass0');
6
  var number_mass1 = block.getFieldValue('mass1');
7
  var value_histogram = Blockly.JavaScript.valueToCode(block, 'histogram', Blockly.JavaScript.ORDER_ATOMIC);
8
  // TODO: Assemble JavaScript into code variable.
9
  var code = '...';
10
  // TODO: Change ORDER_NONE to the correct strength.
11
  return [code, Blockly.JavaScript.ORDER_NONE];
12
};
13
 
14
Blockly.JavaScript['particle_selector'] = function(block) {
15
  var value_list1 = Blockly.JavaScript.valueToCode(block, 'list1', Blockly.JavaScript.ORDER_ATOMIC);
16
  var value_charge = Blockly.JavaScript.valueToCode(block, 'charge', Blockly.JavaScript.ORDER_ATOMIC);
17
  var value_type = Blockly.JavaScript.valueToCode(block, 'type', Blockly.JavaScript.ORDER_ATOMIC);
18
  var value_histogram = Blockly.JavaScript.valueToCode(block, 'histogram', Blockly.JavaScript.ORDER_ATOMIC);
19
  // TODO: Assemble JavaScript into code variable.
20
  var code = '...';
21
  // TODO: Change ORDER_NONE to the correct strength.
22
  return [code, Blockly.JavaScript.ORDER_NONE];
23
};
24
 
25
Blockly.JavaScript['particle'] = function(block) {
26
  var dropdown_pidlist = block.getFieldValue('pidlist');
27
  // TODO: Assemble JavaScript into code variable.
28
  var code = '...';
29
  // TODO: Change ORDER_NONE to the correct strength.
30
  return [code, Blockly.JavaScript.ORDER_NONE];
31
};
32
 
33
Blockly.JavaScript['histogram_creator'] = function(block) {
34
  var text_name = block.getFieldValue('name');
35
  var number_nbins = block.getFieldValue('nbins');
36
  var number_min = block.getFieldValue('min');
37
  var number_max = block.getFieldValue('max');
38
  // TODO: Assemble JavaScript into code variable.
39
  var code = 'histogram(' + text_name + ', nbins ' + number_nbins + ', min ' + number_min +  ', max ' + number_max + ')\n';
40
  //var code = '...';
41
  // TODO: Change ORDER_NONE to the correct strength.
42
  return [code, Blockly.JavaScript.ORDER_NONE];
43
};
44
 
45
Blockly.JavaScript['charge'] = function(block) {
46
  var dropdown_chargelist = block.getFieldValue('chargelist');
47
  // TODO: Assemble JavaScript into code variable.
48
  var code = 'charge()\n';
49
  // TODO: Change ORDER_NONE to the correct strength.
50
  return [code, Blockly.JavaScript.ORDER_NONE];
51
};
52
 
53
Blockly.JavaScript['simple_analysis'] = function(block) {
54
  var number_neve = block.getFieldValue('neve');
55
  var dropdown_datasource = block.getFieldValue('datasource');
56
  var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC);
57
  // TODO: Assemble JavaScript into code variable.
58
  var code = 'simple_analysis(' + ' neve ' + number_neve +  ' datasource ' + dropdown_datasource + ' list ' + value_list + ')\n';
59
  //var code = '...';
60
  return code;
61
};
62
 
63
Blockly.JavaScript['particle_mass_fix'] = function(block) {
64
  var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC);
65
  // TODO: Assemble JavaScript into code variable.
66
  var code = '...';
67
  // TODO: Change ORDER_NONE to the correct strength.
68
  return [code, Blockly.JavaScript.ORDER_NONE];
69
};
70
 
71
Blockly.JavaScript['primary_list'] = function(block) {
72
  var value_histogram = Blockly.JavaScript.valueToCode(block, 'histogram', Blockly.JavaScript.ORDER_ATOMIC);
73
  // TODO: Assemble JavaScript into code variable.
74
  var code = 'primary_list(' + value_histogram + ')\n';
75
  //var code = '...';
76
  // TODO: Change ORDER_NONE to the correct strength.
77
  return [code, Blockly.JavaScript.ORDER_NONE];
78
};