Subversion Repositories f9daq

Rev

Rev 193 | Go to most recent revision | Details | Compare with Previous | 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');
267 f9daq 55
  var number_first = block.getFieldValue('first');
193 f9daq 56
  var dropdown_datasource = block.getFieldValue('datasource');
57
  var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC);
58
  // TODO: Assemble JavaScript into code variable.
267 f9daq 59
  var code = 'simple_analysis(' + ' neve ' + number_neve ' + ' first ' + number_first  +  ' datasource ' + dropdown_datasource + ' list ' + value_list + ')\n';
193 f9daq 60
  //var code = '...';
61
  return code;
62
};
63
 
64
Blockly.JavaScript['particle_mass_fix'] = function(block) {
65
  var value_list = Blockly.JavaScript.valueToCode(block, 'list', Blockly.JavaScript.ORDER_ATOMIC);
66
  // TODO: Assemble JavaScript into code variable.
67
  var code = '...';
68
  // TODO: Change ORDER_NONE to the correct strength.
69
  return [code, Blockly.JavaScript.ORDER_NONE];
70
};
71
 
72
Blockly.JavaScript['primary_list'] = function(block) {
73
  var value_histogram = Blockly.JavaScript.valueToCode(block, 'histogram', Blockly.JavaScript.ORDER_ATOMIC);
74
  // TODO: Assemble JavaScript into code variable.
75
  var code = 'primary_list(' + value_histogram + ')\n';
76
  //var code = '...';
77
  // TODO: Change ORDER_NONE to the correct strength.
78
  return [code, Blockly.JavaScript.ORDER_NONE];
267 f9daq 79
};