cpee 2.1.46 → 2.1.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/cockpit/index.html +1 -1
  4. data/cockpit/js/instance.js +24 -15
  5. data/cockpit/js/wfadaptor.js +18 -13
  6. data/cockpit/templates/Subprocess.xml +35 -371
  7. data/cockpit/templates/Wait.xml +7 -400
  8. data/cockpit/themes/compact/rngs/call.rng +8 -0
  9. data/cockpit/themes/compact/rngs/callmanipulate.rng +8 -0
  10. data/cockpit/themes/compact/rngs/closed_loop_control.rng +2 -2
  11. data/cockpit/themes/compact/rngs/closed_loop_measuring.rng +3 -3
  12. data/cockpit/themes/compact/theme.js +15 -0
  13. data/cockpit/themes/control/rngs/call.rng +8 -0
  14. data/cockpit/themes/control/rngs/callmanipulate.rng +8 -0
  15. data/cockpit/themes/control/rngs/closed_loop_control.rng +2 -2
  16. data/cockpit/themes/control/rngs/closed_loop_measuring.rng +3 -3
  17. data/cockpit/themes/control/theme.js +17 -2
  18. data/cockpit/themes/default/rngs/call.rng +8 -0
  19. data/cockpit/themes/default/rngs/callmanipulate.rng +8 -0
  20. data/cockpit/themes/default/rngs/closed_loop_control.rng +2 -2
  21. data/cockpit/themes/default/rngs/closed_loop_measuring.rng +3 -3
  22. data/cockpit/themes/default/theme.js +15 -0
  23. data/cockpit/themes/extended/rngs/call.rng +8 -0
  24. data/cockpit/themes/extended/rngs/callmanipulate.rng +8 -0
  25. data/cockpit/themes/extended/rngs/closed_loop_control.rng +2 -2
  26. data/cockpit/themes/extended/rngs/closed_loop_measuring.rng +3 -3
  27. data/cockpit/themes/extended/theme.js +15 -0
  28. data/cockpit/themes/model/theme.js +15 -0
  29. data/cockpit/themes/packed/rngs/call.rng +8 -0
  30. data/cockpit/themes/packed/rngs/callmanipulate.rng +8 -0
  31. data/cockpit/themes/packed/rngs/closed_loop_control.rng +2 -2
  32. data/cockpit/themes/packed/rngs/closed_loop_measuring.rng +3 -3
  33. data/cockpit/themes/packed/theme.js +15 -0
  34. data/cockpit/themes/preset/rngs/call.rng +8 -0
  35. data/cockpit/themes/preset/rngs/callmanipulate.rng +8 -0
  36. data/cockpit/themes/preset/rngs/closed_loop_control.rng +2 -2
  37. data/cockpit/themes/preset/rngs/closed_loop_measuring.rng +3 -3
  38. data/cockpit/themes/preset/theme.js +15 -0
  39. data/cpee.gemspec +1 -1
  40. data/lib/cpee/implementation.rb +5 -5
  41. data/lib/cpee/persistence.rb +19 -16
  42. data/server/executionhandlers/ruby/backend/run +4 -4
  43. data/server/executionhandlers/ruby/connection.rb +21 -11
  44. data/server/executionhandlers/ruby/desc.xml +107 -0
  45. data/server/executionhandlers/ruby/dsl_to_dslx.xsl +61 -8
  46. data/server/resources/test.pdf +0 -0
  47. data/server/routing/end.pid +1 -0
  48. data/server/routing/forward-events-00.pid +1 -0
  49. data/server/routing/forward-votes.pid +1 -0
  50. data/server/routing/persist.pid +1 -0
  51. data/tools/cpee +42 -11
  52. metadata +9 -5
  53. data/cockpit/templates/Wait.xml.attrs +0 -16
  54. data/server/routing/forward-events.lock +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eead695fb08a7abafe739b3f8744a414dc6db340f432ab35eca7984124cc1c7
4
- data.tar.gz: 0afa114ac90eeb460bf2cda3a2f9788b67641b3b0c8112650ffd0b7cd43002a2
3
+ metadata.gz: 1b8c1c8a4054ec0936d19a7684030ed6bb751a2ddfd59efd2fd1428403ec9124
4
+ data.tar.gz: b54813a2d1f3f00157837ba221a0b8171b80349450dfd78a5f8757da7e92f3bb
5
5
  SHA512:
6
- metadata.gz: ebfdc65763faf75217fc7babb78e1e2cc6578ddecf095ad47f1e337e0a53f368a8aa7cf01be04020c3920a0ffc1c66c91a20e5487a6eb3f33c556600484943b8
7
- data.tar.gz: 6d46ee33cfc3ee322c923fbcc5616c703055d5add20e7bc92d86ef7475a9bb67bb412025d5e67bf54dad8c7aeff8fc7b8f3e96507604fb827159d5870271ff46
6
+ metadata.gz: 9350a27caf326ef86d6241b26f1237cd80be325179d414b0bd44ca483a9c20c5e19d6c84879742e5353bbeea5c071adb4f029fdad849fbffcace2bd10c731115
7
+ data.tar.gz: d1a8de2949484f76bc4b59da67e7c7d71e43a5d11559a4193bfd049707f50c682c5e3f04e8550d4089ff6d1ca51ac5957884e93d05236e272eeffaca1f7e0c24
data/Rakefile CHANGED
@@ -28,6 +28,6 @@ end
28
28
  desc "Clean instances"
29
29
  task :clean do
30
30
  Dir.glob("server/instances/*").collect{ |i| i if i =~ /\/\d+$/ }.compact.each do |i|
31
- rm_rf i if File.exists?(i)
31
+ rm_rf i if File.exist?(i)
32
32
  end
33
33
  end
data/cockpit/index.html CHANGED
@@ -243,7 +243,7 @@
243
243
  <ui-behind ><a style='display:none' target='_blank' id='current-track'>T</a><a style='display:none' target='_blank' id='current-graph'>G</a></ui-behind>
244
244
  </ui-tabbar>
245
245
  <ui-content>
246
- <ui-area data-belongs-to-tab="details" id='graphcolumn'>
246
+ <ui-area data-belongs-to-tab="details" id='graphcolumn' oncontextmenu='return false'>
247
247
  <div id='graphgrid'>
248
248
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' width='1' height='1'></svg>
249
249
  </div>
@@ -17,6 +17,7 @@ function global_init() {
17
17
  loading = false;
18
18
  subscription = undefined;
19
19
  subscription_state = 'less';
20
+ save['states']= {};
20
21
  save['state']= undefined;
21
22
  save['dsl'] = undefined;
22
23
  save['activity_red_states'] = {}
@@ -292,6 +293,7 @@ function sse() { //{{{
292
293
  }
293
294
  break;
294
295
  case 'state':
296
+ save['states'][data['content']['state']] = Date.parse(data.timestamp);
295
297
  monitor_instance_state_change(data['content']['state']);
296
298
  break;
297
299
  case 'position':
@@ -408,7 +410,11 @@ function monitor_instance_values(type,vals) {// {{{
408
410
  }
409
411
  } else {
410
412
  let ele = $X('<' + key + ' xmlns="http://cpee.org/ns/properties/2.0"/>')
411
- $(ele).text(value)
413
+ if (typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number') {
414
+ $(ele).text(value)
415
+ } else {
416
+ $(ele).text(JSON.stringify(value))
417
+ }
412
418
  $(de).find(' > dataelements').append(ele)
413
419
  }
414
420
  });
@@ -544,24 +550,24 @@ function adaptor_init(url,theme,dslx) { //{{{
544
550
  });
545
551
  $('#graphgrid').css({
546
552
  'grid-template-rows': (shift/2) + 'px repeat(' + max.row + ', 1fr) ' + (shift/2) + 'px',
547
- 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
553
+ 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
548
554
  });
549
555
  for (var i = 0; i < max.row; i++) {
550
- for (var j =0; j < tcolumns.length; j++) {
556
+ for (var j = 0; j < tcolumns.length; j++) {
551
557
  if (tlabels[i+1] != undefined && tlabels[i+1][j] != undefined && tlabels[i+1][j].label != undefined && tlabels[i+1][j].label != '') {
552
558
  var col = tlabels[i+1][j];
553
- var ele = $('<div class="graphlabel ' + (i % 2 == 0 ? 'odd' : 'even') + '" element-type="' + col.type + '" element-id="' + col.id + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '"><span>' + col.label + '</span></div>');
554
- graphrealization.illustrator.draw.bind_event(ele,col.type,false);
559
+ var ele = $('<div element-row="' + i + '" class="graphlabel ' + (i % 2 == 0 ? 'odd' : 'even') + '" element-type="' + col.type + '" element-id="' + col.id + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '"><span>' + col.label + '</span></div>');
560
+ graphrealization.illustrator.draw.bind_event(ele, col.type, false);
555
561
  $('#graphgrid').append(ele);
556
562
  } else {
557
563
  if (tcolumncount[tcolumns[j]] != 0) {
558
- var ele = $('<div class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>');
564
+ var ele = $('<div element-row="' + i + '" class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>');
559
565
  $('#graphgrid').append(ele);
560
566
  }
561
567
  }
562
568
  }
563
569
  var j = tcolumns.length;
564
- var ele = $('<div class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>');
570
+ var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>');
565
571
  $('#graphgrid').append(ele);
566
572
  }
567
573
  };
@@ -734,6 +740,13 @@ function monitor_instance_pos_change(content) {// {{{
734
740
 
735
741
 
736
742
  function monitor_instance_state_change(notification) { //{{{
743
+ // sometimes, out of sheer network routingness, stopping comes after stopped, which fucks the UI hard
744
+ // thus, we are having none of it
745
+ if (notification == 'stopping' && save['states']['stopping'] - save['states']['stopped'] < 10)
746
+ notification = 'stopped';
747
+ if (notification == 'stopping' && save['state'] == 'stopped')
748
+ return;
749
+
737
750
  if ($('#trackcolumn').length > 0) {
738
751
  if (notification == "finished" || notification == "abandoned") {
739
752
  parent.closeIFrame(window.location.search);
@@ -743,19 +756,15 @@ function monitor_instance_state_change(notification) { //{{{
743
756
  $("#state button").removeAttr('disabled');
744
757
  }
745
758
 
746
- // sometimes, out of sheer network routingness, stopping comes after stopped, which fucks the UI hard
747
- // thus, we are having none of it
748
- if (notification == 'stopping' && save['state'] == 'stopped')
749
- return;
750
759
  if (notification != save['state']) {
751
760
  save['state'] = notification;
752
761
 
753
762
  if (notification == "stopped") {
754
763
  monitor_instance_pos();
755
764
  }
756
- if (notification == "running") {
757
- format_visual_clear();
758
- }
765
+ // if (notification == "running") {
766
+ // format_visual_clear();
767
+ // }
759
768
 
760
769
  var but = "";
761
770
  if (notification == "ready" || notification == "stopped") {
@@ -1454,7 +1463,7 @@ function ui_pos(e,bl) {
1454
1463
  }
1455
1464
  function del_ui_pos(e) {
1456
1465
  ui_pos(e,function(coll){
1457
- coll.splice(coll.indexOf($(e).attr('id')),1);
1466
+ coll.splice(coll.findIndex((ele)=>ele[0] == $(e).attr('id')),1);
1458
1467
  return coll;
1459
1468
  });
1460
1469
  }
@@ -217,9 +217,13 @@ function WfIllustrator(wf_adaptor) { // View {{{
217
217
  } // }}}
218
218
  // }}}
219
219
  // Helper Functions {{{
220
+ var get_y = this.draw.get_y = function (row) { // {{{
221
+ return { y: row * self.height - self.height, height_shift: self.height_shift};
222
+ } // }}}
223
+
220
224
  var draw_stripe = this.draw.draw_stripe = function (row, maxcol) { // {{{
221
225
  if (maxcol < 1) maxcol = 1;
222
- var g = $X('<rect class="stripe ' + (row % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + String(row*self.height+self.height_shift/2) + '" width="' + (self.width * maxcol + self.width - self.width_shift) + '" height="' + (self.height) + '" xmlns="http://www.w3.org/2000/svg"></rect>');
226
+ var g = $X('<rect element-row="' + row + '" class="stripe ' + (row % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + String(row*self.height+self.height_shift/2) + '" width="' + (self.width * maxcol + self.width - self.width_shift) + '" height="' + (self.height) + '" xmlns="http://www.w3.org/2000/svg"></rect>');
223
227
  self.svg.container.prepend(g);
224
228
  return g;
225
229
  } // }}}
@@ -366,16 +370,16 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
366
370
 
367
371
  // Set Labels //{{{
368
372
  this.set_labels = function(graph) {
369
- if (illustrator.compact == false) {
370
- adaptor.draw_labels(graph.max,labels,illustrator.height_shift,illustrator.striped == true ? true : false);
371
- } else {
372
- adaptor.draw_labels(graph.max,[],illustrator.height_shift,false);
373
- }
374
373
  if (illustrator.striped == true && illustrator.compact == false) {
375
374
  for (var i=0; i < graph.max.row; i++) {
376
375
  illustrator.draw.draw_stripe(i,graph.max.col);
377
376
  }
378
377
  }
378
+ if (illustrator.compact == false) {
379
+ adaptor.draw_labels(graph.max,labels,illustrator.height_shift,illustrator.striped == true ? true : false);
380
+ } else {
381
+ adaptor.draw_labels(graph.max,[],illustrator.height_shift,false);
382
+ }
379
383
  if (illustrator.compact == false) {
380
384
  if (labels.length > 0) {
381
385
  _.each(labels,function(a,key) {
@@ -402,9 +406,9 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
402
406
  labels = [];
403
407
  illustrator.clear();
404
408
  var graph = parse(description.children('description').get(0), {'row':0,'col':0,final:false,wide:false});
405
- self.set_labels(graph);
406
- // set labels
407
409
  illustrator.set_svg(graph);
410
+ // set labels
411
+ self.set_labels(graph);
408
412
  } // }}}
409
413
  var gd = this.get_description = function() { // public {{{
410
414
  var serxml = $(description.get(0).documentElement).clone(true);
@@ -454,9 +458,9 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
454
458
  labels = [];
455
459
  illustrator.clear();
456
460
  var graph = parse(description.children('description').get(0), {'row':0,'col':0});
457
- self.set_labels(graph);
458
- // set labels
459
461
  illustrator.set_svg(graph);
462
+ // set labels
463
+ self.set_labels(graph);
460
464
  doit(self);
461
465
  }
462
466
  var update = this.update = function(svgid) { // {{{
@@ -465,8 +469,8 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
465
469
  labels = [];
466
470
  illustrator.clear();
467
471
  var graph = parse(description.children('description').get(0), {'row':0,'col':0});
468
- self.set_labels(graph);
469
472
  illustrator.set_svg(graph);
473
+ self.set_labels(graph);
470
474
  }
471
475
 
472
476
  var newn = $('*[new=true]',description);
@@ -563,7 +567,8 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
563
567
  $(root).attr('svg-subtype','description');
564
568
  group.attr('element-id','group-description');
565
569
  if (illustrator.elements[sname].label) {
566
- labels.push({row: pos.row, element_id: 'start', tname: 'start', label: illustrator.elements[sname].label(root)});
570
+ // javascript object spread syntax is my new weird crush - the JS designers must be serious people
571
+ labels.push({...{row: pos.row, element_id: 'start', tname: 'start', label: illustrator.elements[sname].label(root)},...illustrator.draw.get_y(pos.row)});
567
572
  }
568
573
  illustrator.draw.draw_symbol(sname, 'description', 'START', pos.row, pos.col, group);
569
574
  } // }}}
@@ -675,7 +680,7 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
675
680
  if (lab && lab[0] && lab[0].value && lab[0].column == 'Label' && lab[0].value != '') {
676
681
  $(context).attr('svg-label', lab[0].value);
677
682
  }
678
- labels.push({row: pos.row, element_id: $(context).attr('svg-id'), tname: tname, label: lab});
683
+ labels.push({...{row: pos.row, element_id: $(context).attr('svg-id'), tname: tname, label: lab},...illustrator.draw.get_y(pos.row)});
679
684
  }
680
685
  } //}}}
681
686
  var draw_position = function(tname,pos,prev,block,group,endnodes,context,second) { // private {{{