cpee 2.1.52 → 2.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/{resources.css → resources-label.css} +0 -7
  3. data/cockpit/css/resources-svg.css +20 -0
  4. data/cockpit/css/ui.css +0 -4
  5. data/cockpit/edit.html +5 -1
  6. data/cockpit/graph.html +4 -0
  7. data/cockpit/index.html +3 -2
  8. data/cockpit/js/details.js +4 -14
  9. data/cockpit/js/edit.js +3 -0
  10. data/cockpit/js/instance.js +129 -139
  11. data/cockpit/js/modifiers.js +4 -14
  12. data/cockpit/js/parameters.js +4 -10
  13. data/cockpit/js/wfadaptor.js +0 -27
  14. data/cockpit/model.html +2 -0
  15. data/cockpit/templates/Coopis 2010.xml +8 -1
  16. data/cockpit/templates/Worklist.xml +6 -7
  17. data/cockpit/themes/compact/rngs/call.rng +3 -3
  18. data/cockpit/themes/compact/rngs/callmanipulate.rng +3 -3
  19. data/cockpit/themes/compact/rngs/parallel.rng +2 -2
  20. data/cockpit/themes/compact/rngs/start.rng +3 -3
  21. data/cockpit/themes/compact/theme.js +38 -22
  22. data/cockpit/themes/control/rngs/call.rng +3 -3
  23. data/cockpit/themes/control/rngs/callmanipulate.rng +3 -3
  24. data/cockpit/themes/control/rngs/parallel.rng +2 -2
  25. data/cockpit/themes/control/rngs/start.rng +3 -3
  26. data/cockpit/themes/control/theme.js +76 -10
  27. data/cockpit/themes/dataflow/rngs/call.rng +3 -3
  28. data/cockpit/themes/dataflow/rngs/callmanipulate.rng +3 -3
  29. data/cockpit/themes/dataflow/rngs/parallel.rng +2 -2
  30. data/cockpit/themes/dataflow/rngs/start.rng +3 -3
  31. data/cockpit/themes/dataflow/theme.js +48 -32
  32. data/cockpit/themes/default/rngs/call.rng +3 -3
  33. data/cockpit/themes/default/rngs/callmanipulate.rng +3 -3
  34. data/cockpit/themes/default/rngs/parallel.rng +2 -2
  35. data/cockpit/themes/default/rngs/start.rng +3 -3
  36. data/cockpit/themes/default/theme.js +38 -22
  37. data/cockpit/themes/extended/rngs/call.rng +3 -3
  38. data/cockpit/themes/extended/rngs/callmanipulate.rng +3 -3
  39. data/cockpit/themes/extended/rngs/parallel.rng +2 -2
  40. data/cockpit/themes/extended/rngs/start.rng +3 -3
  41. data/cockpit/themes/extended/theme.js +38 -22
  42. data/cockpit/themes/felix/rngs/alternative.rng +25 -0
  43. data/cockpit/themes/felix/rngs/call.rng +229 -0
  44. data/cockpit/themes/felix/rngs/callmanipulate.rng +259 -0
  45. data/cockpit/themes/felix/rngs/choose.rng +14 -0
  46. data/cockpit/themes/felix/rngs/closed_loop.rng +62 -0
  47. data/cockpit/themes/felix/rngs/closed_loop_cancel.rng +5 -0
  48. data/cockpit/themes/felix/rngs/closed_loop_control.rng +31 -0
  49. data/cockpit/themes/felix/rngs/closed_loop_measuring.rng +12 -0
  50. data/cockpit/themes/felix/rngs/critical.rng +5 -0
  51. data/cockpit/themes/felix/rngs/escape.rng +1 -0
  52. data/cockpit/themes/felix/rngs/group.rng +3 -0
  53. data/cockpit/themes/felix/rngs/loop.rng +22 -0
  54. data/cockpit/themes/felix/rngs/manipulate.rng +20 -0
  55. data/cockpit/themes/felix/rngs/otherwise.rng +22 -0
  56. data/cockpit/themes/felix/rngs/parallel.rng +27 -0
  57. data/cockpit/themes/felix/rngs/parallel_branch.rng +2 -0
  58. data/cockpit/themes/felix/rngs/scripts.rng +23 -0
  59. data/cockpit/themes/felix/rngs/start.rng +121 -0
  60. data/cockpit/themes/felix/rngs/stop.rng +5 -0
  61. data/cockpit/themes/felix/rngs/terminate.rng +1 -0
  62. data/cockpit/themes/felix/symbols/alternative.svg +5 -0
  63. data/cockpit/themes/felix/symbols/arrow.svg +3 -0
  64. data/cockpit/themes/felix/symbols/call.svg +6 -0
  65. data/cockpit/themes/felix/symbols/call_sensor.svg +9 -0
  66. data/cockpit/themes/felix/symbols/callmanipulate.svg +8 -0
  67. data/cockpit/themes/felix/symbols/callmanipulate_sensor.svg +11 -0
  68. data/cockpit/themes/felix/symbols/choose.svg +5 -0
  69. data/cockpit/themes/felix/symbols/choose_exclusive.svg +5 -0
  70. data/cockpit/themes/felix/symbols/choose_inclusive.svg +4 -0
  71. data/cockpit/themes/felix/symbols/closed_loop.svg +5 -0
  72. data/cockpit/themes/felix/symbols/closed_loop_cancel.svg +5 -0
  73. data/cockpit/themes/felix/symbols/closed_loop_control.svg +5 -0
  74. data/cockpit/themes/felix/symbols/closed_loop_measuring.svg +6 -0
  75. data/cockpit/themes/felix/symbols/complex.svg +8 -0
  76. data/cockpit/themes/felix/symbols/critical.svg +4 -0
  77. data/cockpit/themes/felix/symbols/delete.svg +4 -0
  78. data/cockpit/themes/felix/symbols/end.svg +3 -0
  79. data/cockpit/themes/felix/symbols/escape.svg +5 -0
  80. data/cockpit/themes/felix/symbols/event_end.svg +3 -0
  81. data/cockpit/themes/felix/symbols/loop.svg +5 -0
  82. data/cockpit/themes/felix/symbols/manipulate.svg +4 -0
  83. data/cockpit/themes/felix/symbols/otherwise.svg +5 -0
  84. data/cockpit/themes/felix/symbols/parallel.svg +5 -0
  85. data/cockpit/themes/felix/symbols/parallel_branch.svg +5 -0
  86. data/cockpit/themes/felix/symbols/parallel_branch_compact.svg +4 -0
  87. data/cockpit/themes/felix/symbols/parallel_branch_event.svg +14 -0
  88. data/cockpit/themes/felix/symbols/parallel_branch_normal.svg +5 -0
  89. data/cockpit/themes/felix/symbols/parallel_eventbased_exclusive.svg +9 -0
  90. data/cockpit/themes/felix/symbols/parallel_eventbased_parallel.svg +8 -0
  91. data/cockpit/themes/felix/symbols/scripts.svg +4 -0
  92. data/cockpit/themes/felix/symbols/start.svg +3 -0
  93. data/cockpit/themes/felix/symbols/start_event.svg +5 -0
  94. data/cockpit/themes/felix/symbols/stop.svg +5 -0
  95. data/cockpit/themes/felix/symbols/terminate.svg +4 -0
  96. data/cockpit/themes/felix/theme.js +1531 -0
  97. data/cockpit/themes/model/rngs/call.rng +10 -10
  98. data/cockpit/themes/model/rngs/callmanipulate.rng +10 -10
  99. data/cockpit/themes/model/theme.js +14 -3
  100. data/cockpit/themes/packed/rngs/call.rng +3 -3
  101. data/cockpit/themes/packed/rngs/callmanipulate.rng +3 -3
  102. data/cockpit/themes/packed/rngs/parallel.rng +2 -2
  103. data/cockpit/themes/packed/rngs/start.rng +3 -3
  104. data/cockpit/themes/packed/theme.js +38 -22
  105. data/cockpit/themes/preset/rngs/call.rng +3 -3
  106. data/cockpit/themes/preset/rngs/callmanipulate.rng +3 -3
  107. data/cockpit/themes/preset/rngs/parallel.rng +2 -2
  108. data/cockpit/themes/preset/rngs/start.rng +3 -3
  109. data/cockpit/themes/preset/theme.js +38 -22
  110. data/cockpit/track.html +4 -0
  111. data/cpee.gemspec +1 -1
  112. data/lib/cpee/implementation.rb +1 -1
  113. data/lib/cpee/implementation_properties.rb +23 -13
  114. data/lib/properties/state.rng +0 -2
  115. data/lib/properties.xml +0 -1
  116. data/server/executionhandlers/ruby/connection.rb +25 -16
  117. data/server/executionhandlers/ruby/controller.rb +1 -1
  118. data/server/executionhandlers/ruby/dsl_to_dslx.xsl +71 -61
  119. data/server/resources/states.dot +0 -4
  120. data/server/resources/states.xml +0 -6
  121. data/server/routing/end.pid +1 -0
  122. data/server/routing/forward-events-00.pid +1 -0
  123. data/server/routing/forward-votes.pid +1 -0
  124. data/server/routing/persist.pid +1 -0
  125. metadata +63 -17
  126. data/cockpit/css/replay.css +0 -55
  127. data/cockpit/js/replay.js +0 -40
  128. data/cockpit/replay.html +0 -53
  129. data/cockpit/themes/compact/symbols/test.svg +0 -74
  130. data/cockpit/themes/control/symbols/test.svg +0 -74
  131. data/cockpit/themes/dataflow/symbols/test.svg +0 -74
  132. data/cockpit/themes/default/symbols/test.svg +0 -74
  133. data/cockpit/themes/extended/symbols/test.svg +0 -74
  134. data/cockpit/themes/model/symbols/test.svg +0 -74
  135. data/cockpit/themes/packed/symbols/test.svg +0 -74
  136. data/cockpit/themes/preset/symbols/test.svg +0 -74
  137. data/server/executionhandlers/ruby/desc.xml +0 -107
  138. data/server/resources/test.pdf +0 -0
  139. data/server/server.conf +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abf105360b93a73b4be3fbceb75cc95f805fe947917d1a8da91a727a1bfce520
4
- data.tar.gz: 7f7dbec843a239c9dfc97166aaddd3e6cd43ddc5d3fd10335a87d72ea6aeda1b
3
+ metadata.gz: 6b18fb6a90f4eecc274718f826b2eb26594170285bccbe81799b01d62893f7a7
4
+ data.tar.gz: '0990fbfc1a1e7f3dc0874fa53f0d8eae1a9a86e05fc8c3a0b4a8decc4f3cb6c9'
5
5
  SHA512:
6
- metadata.gz: 60ff6635449e118df6f272a1c7d8e5f23637d30ea60e4d0c3b928d6dd63a896ddcadde07093029a64cb7050642da53311f6d80e360f1ed267c01153e3dfa4ad4
7
- data.tar.gz: b8e5e91f5afdbab0e986c3bb0dc68bd468c86ee4d6633d1c8254cee9be8a4620f288968f558f0bb92e1fa0854ec9a760ec7744c14476148bf77fd939df42de1a
6
+ metadata.gz: 5a163fa0d363e66371e948d7c307d0bde0eab957ce9479b19aa7c80c90d5b0e731187b4e5f831faa4a36451f3741182dba5c14fd2b9dc9ac6ff3d1dba0e57691
7
+ data.tar.gz: 897ea95574747419d64820adafb97cac14bfd24493e725f8e6e9a106d46317f280df0a478650a718bcdefd2bb435d4f68cb75f0aa3941d36827afe4929d4c195
@@ -1,10 +1,3 @@
1
- resources {
2
- border-left: 1pt solid var(--wfadaptor-border);
3
- }
4
- #resources line.resource-line:hover {
5
- stroke: red;
6
- }
7
-
8
1
  .resource-label {
9
2
  position: absolute;
10
3
  padding-left: 0.5em;
@@ -0,0 +1,20 @@
1
+ svg rect.border {
2
+ fill: var(--wfadaptor-border);
3
+ }
4
+ svg .resource-point.read {
5
+ fill: green;
6
+ }
7
+ svg .resource-point.write {
8
+ fill: orange;
9
+ }
10
+ svg .resource-point.both {
11
+ fill: blue;
12
+ }
13
+ svg line.resource-line {
14
+ stroke: red;
15
+ stroke-opacity: 0.1;
16
+ }
17
+ svg line.resource-line:hover {
18
+ stroke: red;
19
+ stroke-opacity: 0.2;
20
+ }
data/cockpit/css/ui.css CHANGED
@@ -41,10 +41,6 @@ body {
41
41
  #graphgrid.striped .graphlabel, #graphgrid.striped .graphempty {
42
42
  border-left: 1pt solid var(--wfadaptor-border);
43
43
  }
44
- #graphgrid.striped #resources rect.border {
45
- width: 1pt;
46
- fill: var(--wfadaptor-border);
47
- }
48
44
  #graphgrid.striped .graphlabel.even, #graphgrid.striped .graphempty.even, #graphgrid.striped .graphlast.even {
49
45
  background-color: #e9e9e9;
50
46
  }
data/cockpit/edit.html CHANGED
@@ -55,7 +55,10 @@
55
55
  <script type="text/javascript" src="js/parameters.js"></script>
56
56
  <script type="text/javascript" src="js/edit.js"></script>
57
57
  <script type="text/javascript" src="js/modifiers.js"></script>
58
+ <script type="text/javascript" src="js/resources.js"></script>
58
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
61
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
59
62
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
60
63
  <style>
61
64
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
@@ -242,8 +245,9 @@
242
245
  <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>
243
246
  </ui-tabbar>
244
247
  <ui-content>
245
- <ui-area data-belongs-to-tab="details" id='graphcolumn'>
248
+ <ui-area data-belongs-to-tab="details" id='graphcolumn' oncontextmenu='return false'>
246
249
  <div id='graphgrid'>
250
+ <div class="resource-label" style="display: none"></div>
247
251
  <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>
248
252
  </div>
249
253
  </ui-area>
data/cockpit/graph.html CHANGED
@@ -55,7 +55,10 @@
55
55
  <script type="text/javascript" src="js/details.js"></script>
56
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
57
  <script type="text/javascript" src="js/modifiers.js"></script>
58
+ <script type="text/javascript" src="js/resources.js"></script>
58
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
61
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
59
62
  <link rel="stylesheet" href="css/graph.css" type="text/css"/>
60
63
  </head>
61
64
  <body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
@@ -63,6 +66,7 @@
63
66
  <div id="trackfull">
64
67
  <div id='graphcolumn'>
65
68
  <div id='graphgrid'>
69
+ <div class="resource-label" style="display: none"></div>
66
70
  <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>
67
71
  </div>
68
72
  </div>
data/cockpit/index.html CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  <!-- modelling ui -->
48
48
  <script type="text/javascript" src="js/wfadaptor.js"></script>
49
- <link rel="stylesheet" href="css/wfadaptor.css" type="text/css"/>
49
+ <link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
50
50
 
51
51
  <!-- custom stuff, play arround -->
52
52
  <script type="text/javascript" src="js/ui.js"></script>
@@ -56,7 +56,8 @@
56
56
  <script type="text/javascript" src="js/modifiers.js"></script>
57
57
  <script type="text/javascript" src="js/resources.js"></script>
58
58
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
59
- <link rel="stylesheet" href="css/resources.css" type="text/css"/>
59
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
60
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
60
61
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
61
62
  <style>
62
63
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
@@ -7,20 +7,6 @@ $(document).ready(function() {
7
7
  clearTimeout(timer);
8
8
  timer = setTimeout(do_main_save, 5000);
9
9
  });
10
- $(document).on('change','#dat_details select',function(e){
11
- clearTimeout(timer);
12
- do_main_save();
13
- });
14
- $(document).on('blur','#dat_details input, #dat_details textarea, #dat_details [contenteditable]',function(e){
15
- clearTimeout(timer);
16
- do_main_save();
17
- });
18
- $(document).on('keypress','#dat_details input',function(e){
19
- if (e.keyCode == 13) {
20
- clearTimeout(timer);
21
- do_main_save();
22
- }
23
- });
24
10
  $(document).on('keypress','#dat_details [contenteditable]',function(e){
25
11
  if (e.keyCode == 13) {
26
12
  document.execCommand('insertLineBreak')
@@ -35,6 +21,10 @@ $(document).ready(function() {
35
21
  clearTimeout(timer);
36
22
  do_main_save();
37
23
  });
24
+ $(document).on('relaxngui_change', '#dat_details', function(e){
25
+ clearTimeout(timer);
26
+ do_main_save();
27
+ });
38
28
  });
39
29
 
40
30
  function do_main_save() { //{{{
data/cockpit/js/edit.js CHANGED
@@ -7,6 +7,9 @@ document.addEventListener('parameters:changed', function (e) {
7
7
  document.addEventListener('modifiers:changed', function (e) {
8
8
  $("button[name=save]").prop("disabled",false);
9
9
  }, false);
10
+ document.addEventListener('model:loaded', function (e) {
11
+ $("button[name=save]").prop("disabled",false);
12
+ }, false);
10
13
 
11
14
  function leading_zeros(dt) {
12
15
  return (dt < 10 ? '0' : '') + dt;
@@ -6,6 +6,7 @@ var loading = false;
6
6
  var subscription;
7
7
  var subscription_state = 'less';
8
8
  var graph_changed = new Event("graph:changed", {"bubbles":true, "cancelable":false});
9
+ var model_loaded = new Event("model:loaded", {"bubbles":true, "cancelable":false});
9
10
  var save = {};
10
11
  save['endpoints'] = undefined;
11
12
  save['dataelements'] = undefined;
@@ -504,10 +505,12 @@ function monitor_instance_values(type,vals) {// {{{
504
505
  } else {
505
506
  save['modeltype'] = undefined;
506
507
  }
507
- if ($('#modifiers > div').length == 0) {
508
- modifiers_display().then(function(){ modifiers_select(); });
509
- } else {
510
- modifiers_select();
508
+ if ($('#modifiers').length > 0) {
509
+ if ($('#modifiers > div').length == 0) {
510
+ modifiers_display().then(function(){ modifiers_select(); });
511
+ } else {
512
+ modifiers_select();
513
+ }
511
514
  }
512
515
  var text = $(" > attributes > info",res).text() + " (" + url.replace(/\/$/,'').split(/[\\/]/).pop() + ")";
513
516
  $('#title').text(text);
@@ -565,109 +568,88 @@ function adaptor_init(url,theme,dslx) { //{{{
565
568
  }
566
569
 
567
570
  $('#graphgrid .graphlabel, #graphgrid .graphempty, #resources, #graphgrid .graphlast').remove();
568
- var tlabels = {};
569
- var tcolumns = [];
570
- var tcolumncount = {}
571
- var thidden = [];
571
+ let tcolumns = [];
572
+ let tcolumntype = {};
573
+ let tcolumncount = {}
572
574
 
573
- var tsvgs = {};
574
575
  const mapPoints = new Map();
575
- let iconsize = 14;
576
- let iconshift = 7;
576
+ const tcolumnsvgs = {};
577
+ const iconsize = 10;
578
+ const space = 5;
577
579
 
578
580
  _.each(labels,function(val){
579
581
  if (val.label != "") {
580
- tlabels[val.row] = [];
581
582
  _.each(val.label,function(col) {
582
583
  if (!tcolumns.includes(col.column)) {
583
584
  tcolumns.push(col.column);
584
585
  tcolumncount[col.column] = 0;
586
+ tcolumnsvgs[col.column] = {};
585
587
  }
586
- if (!thidden.includes(col.column) && col.type == 'resource') {
587
- thidden.push(col.column);
588
+ if (tcolumntype[col.column] == undefined && col.type != undefined) {
589
+ tcolumntype[col.column] = col.type;
588
590
  }
589
591
  if (col.value != undefined) {
592
+ let pos = dimensions.height_shift/2 + dimensions.height * (val.row - 1) + (dimensions.height / 2);
593
+ let firstpos = dimensions.height_shift/2 + (dimensions.height / 2);
590
594
 
591
- // Start Peilei
592
595
  if (col.type == "resource") {
593
- let str = '';
594
596
  for (const [k, v] of Object.entries(col.value)) {
595
- var p = {};
596
- p.AR = v;
597
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
597
+ var p = { AR: v };
598
598
  if (!mapPoints.has(k)) {
599
- p.y0 = p.y0 == undefined ? (dimensions.height_shift/2 + dimensions.height * val.row - 20) : p.y0;
600
- p.ymax = (p.ymax == undefined) ? p.y0 : p.ymax; //(dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax ? dimensions.height_shift/2 + dimensions.height * val.row - 20 : p.ymax);
599
+ p.y0 = p.y0 == undefined ? pos : p.y0;
600
+ p.ymax = (p.ymax == undefined) ? p.y0 : p.ymax;
601
601
  } else {
602
602
  p.y0 = mapPoints.get(k).y0;
603
- p.ymax = mapPoints.get(k).ymax; //(dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax ? dimensions.height_shift/2 + dimensions.height * val.row - 20 : p.ymax);
603
+ p.ymax = mapPoints.get(k).ymax;
604
604
  }
605
605
  mapPoints.set(k, p);
606
606
  }
607
- var cx = iconshift*2;
608
- str += '<g xmlns="http://www.w3.org/2000/svg">';
609
607
 
608
+ let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
609
+
610
+ var cx = space;
610
611
  for (const [k, p] of mapPoints) {
611
- let firstAssignFlag = 0;
612
- p.x0 = p.xc = cx;
612
+ let firstAssignFlag = false;
613
+ p.x = cx;
613
614
 
614
615
  // Including Triangle
615
616
  if (k in col.value) { // Define points for a triangle pointing to the right
617
+ let inner;
618
+
616
619
  if (p.AR == "Read") {
617
- str += '<polygon xmlns="http://www.w3.org/2000/svg" points="' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 20) + ' ' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 15) + ' ' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 25) + '" fill="green" class="resource-point">';
618
- if (p.yc == p.y0) {
619
- firstAssignFlag = 1;
620
- }
620
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x) + ',' + pos + ' ' + (p.x + iconsize) + ',' + (pos + iconsize/2) + ' ' + (p.x + iconsize) + ',' + (pos - iconsize/2) + '" class="resource-point read"></polygon>');
621
+ if (pos == p.y0) { firstAssignFlag = true; }
621
622
  } else if (p.AR == "Assign") { // Define points for a triangle pointing to the left
622
- str += '<polygon xmlns="http://www.w3.org/2000/svg" points="' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 20) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 15) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 25) + '" fill="orange" class="resource-point">';
623
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x + iconsize) + ',' + pos + ' ' + (p.x) + ',' + (pos + iconsize/2) + ' ' + (p.x) + ',' + (pos - iconsize/2) + '" class="resource-point write"></polygon>');
623
624
  } else if (p.AR == "AssignRead") {
624
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
625
- str += '<circle xmlns="http://www.w3.org/2000/svg" cx="' + cx + '" cy="' + p.yc + '" r="5" fill="blue" class="resource-point">';
625
+ inner = $X('<circle xmlns="http://www.w3.org/2000/svg" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
626
626
  }
627
627
 
628
- if (dimensions.height_shift/2 + dimensions.height * val.row != p.y0) {
629
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
630
- if (dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax) {
631
- p.ymax = dimensions.height_shift/2 + dimensions.height * val.row - 20;
632
- }
628
+ // extend the bars
629
+ if (pos > p.ymax) {
630
+ p.ymax = pos;
633
631
  }
634
632
 
635
- // Converted from <title>
636
- str += '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text>';
637
-
638
- if (p.AR == "Read" || p.AR == "Assign") {
639
- str += '</polygon>';
640
- } else if (p.AR == "AssignRead") {
641
- str += '</circle>';
642
- }
633
+ inner.append($X('<text xmlns="http://www.w3.org/2000/svg">' + k + '</text>'));
634
+ tsvg.append(inner);
643
635
  }
644
636
 
645
- if (firstAssignFlag == 1) {
637
+ if (firstAssignFlag) {
646
638
  // Additional logic and construction of another polygon for orange triangle pointing left
647
- p.y0 -= dimensions.height;
648
- str += '<polygon xmlns="http://www.w3.org/2000/svg" points="' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * (val.row - 1) - 20) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * (val.row - 1) - 15) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * (val.row - 1) - 25) + '" fill="orange" class="resource-point">' + '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text></polygon>';
639
+ p.y0 -= (val.row-1) * dimensions.height;
640
+ tsvg.append($X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x + iconsize) + ',' + firstpos + ' ' + (p.x) + ',' + (firstpos + iconsize/2) + ' ' + (p.x) + ',' + (firstpos - iconsize/2) + '" class="resource-point write">' + '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text></polygon>'));
649
641
  }
650
- cx += iconsize;
642
+ cx += iconsize + space;
651
643
  }
652
644
 
653
- for (const [k, p] of mapPoints) {
654
- if(k in col.value) {
655
- if (dimensions.height_shift/2+dimensions.height*val.row != p.y0) {
656
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
657
- if(dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax) {
658
- p.ymax = dimensions.height_shift/2 + dimensions.height * val.row - 20;
659
- }
660
- }
661
- }
662
- }
663
- str += '</g>';
664
-
665
- tsvgs[val.row] = $X(str);
645
+ tcolumnsvgs[col.column][val.row] = tsvg;
646
+ } else {
647
+ tsvg = $X('<text x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg">' + col.value + '</text>');
648
+ tcolumnsvgs[col.column][val.row] = tsvg;
666
649
  }
667
650
 
668
651
  tcolumncount[col.column] += 1;
669
652
  }
670
- tlabels[val.row][tcolumns.indexOf(col.column)] = { label: col.value, type: val.tname, id: val.element_id };
671
653
  });
672
654
  }
673
655
  });
@@ -677,48 +659,47 @@ function adaptor_init(url,theme,dslx) { //{{{
677
659
  'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
678
660
  });
679
661
 
680
- for (var i = 0; i < max.row; i++) {
681
- for (var j = 0; j < tcolumns.length - 1; j++) {
682
- if (thidden != tcolumns[j]) {
683
- if (tlabels[i+1] != undefined && tlabels[i+1][j] != undefined && tlabels[i+1][j].label != undefined && tlabels[i+1][j].label != '') {
684
- var col = tlabels[i+1][j];
685
- 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>');
686
- graphrealization.illustrator.draw.bind_event(ele, col.type, false);
687
- $('#graphgrid').append(ele);
688
- } else {
689
- if (tcolumncount[tcolumns[j]] != 0) {
690
- var ele = $('<div element-row="' + i + '" class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px">&#032;</div>');
691
- $('#graphgrid').append(ele);
692
- }
662
+ tcolumns.forEach(h => {
663
+ if (Object.keys(tcolumnsvgs[h]).length > 0) {
664
+ const svgcolumn = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id="resources"></svg>');
665
+ const svgback = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
666
+ const svgfront = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
667
+ let xwidth = 0;
668
+ svgcolumn.append(svgback);
669
+ svgcolumn.append(svgfront);
670
+ svgcolumn.css('grid-row', '1/span ' + (max.row + 2))
671
+ svgcolumn.css('grid-column', tcolumns.indexOf(tcolumns.first) + 2);
672
+ svgcolumn.attr('height', $('#graphcanvas').attr('height'));
673
+ $('#graphgrid').append(svgcolumn);
674
+
675
+ for (var i = 0; i < max.row; i++) {
676
+ let node = svgfront.append($(tcolumnsvgs[h][i+1]));
677
+ if (xwidth < node[0].getBBox().width) { xwidth = node[0].getBBox().width; }
678
+ }
679
+ xwidth = xwidth + 2 * space;
680
+ if (striped == true) {
681
+ for (var i = 0; i < max.row; i++) {
682
+ svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" width="' + (xwidth + 1) + '" height="' + dimensions.height + '"></rect>'));
683
+ svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="border" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" height="' + dimensions.height + '" width="1"></rect>'));
684
+ }
685
+ }
686
+ if (tcolumntype[h] == "resource") {
687
+ for (const [k, p] of mapPoints) {
688
+ svgback.append($X('<line xmlns="http://www.w3.org/2000/svg" x1="' + (p.x + iconsize/2) + '" y1="' + p.y0 + '" x2="' + (p.x + iconsize/2) + '" y2="' + p.ymax + '" class="resource-line" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
693
689
  }
694
690
  }
695
- }
696
-
697
- var j = tcolumns.length;
698
- var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px">&#032;</div>');
699
- $('#graphgrid').append(ele);
700
- }
701
691
 
702
- if (Object.keys(tsvgs).length > 0) {
703
- let dataflow = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id="resources"></svg>');
704
- dataflow.css('grid-row', '1/span ' + (max.row + 2));
705
- dataflow.css('grid-column', tcolumns.indexOf(thidden.first) + 2);
706
- dataflow.attr('height', $('#graphcanvas').attr('height'));
707
- dataflow.attr('width', mapPoints.size * iconsize + iconshift * 2);
692
+ $('.resource-label').hide(); // Speech Bubble hide by default
708
693
 
709
- for (var i = 0; i < max.row; i++) { // Needs parenthesises below
710
- dataflow.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + 5.2) + '" width="' + (mapPoints.size * iconsize + iconshift * 2) + '" height="' + dimensions.height + '"></rect>'));
711
- dataflow.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="border" x="0" y="' + (dimensions.height * i + 5.2) + '" height="' + dimensions.height + '"></rect>'));
712
- }
713
- for (const [k, p] of mapPoints) {
714
- dataflow.append($X('<line xmlns="http://www.w3.org/2000/svg" x1="' + p.x0 + '" y1="' + p.y0 + '" x2="' + p.xc + '" y2="' + p.ymax + '" class="resource-line" stroke-opacity="0.1" stroke="orange" stroke-width="10" marker-end="url(#arrowhead)"><text>' + k + '</text></line>'));
715
- }
716
- for (var i = 0; i < max.row; i++) {
717
- dataflow.append($(tsvgs[i+1]));
694
+ svgcolumn.attr('width', xwidth);
718
695
  }
719
- $('#graphgrid').append(dataflow);
696
+ });
720
697
 
721
- $('.resource-label').hide(); // Speech Bubble hide by default
698
+ // Add the last stripe
699
+ var j = tcolumns.length;
700
+ for (var i = 0; i < max.row; i++) {
701
+ var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px">&#032;</div>');
702
+ $('#graphgrid').append(ele);
722
703
  }
723
704
  };
724
705
  graphrealization.set_svg_container($('#graphcanvas'));
@@ -1120,48 +1101,50 @@ function save_svgfile() {// {{{
1120
1101
  var url = $('body').attr('current-instance');
1121
1102
 
1122
1103
  var gc = $('#graphcanvas').clone();
1123
- $.ajax({
1124
- type: "GET",
1125
- url: "css/wfadaptor.css",
1126
- success: function(res){
1127
- gc.prepend($X('<style xmlns="http://www.w3.org/2000/svg" type="text/css"><![CDATA[' + res + ']]></style>'));
1128
- $(window.document.styleSheets).each(function(i,x){
1129
- if (x && x.href && x.href.match(/wfadaptor\.css$/)) {
1130
- var varreps = {};
1131
- $(x.cssRules).each(function(j,y){
1132
- if (y.selectorText == ":root") {
1133
- $(y.style).each(function(k,z) {
1134
- varreps['var\\(' + z + '\\)'] = getComputedStyle(document.documentElement).getPropertyValue(z).toString();
1135
- });
1136
- }
1137
- var loc = $(gc).find(y.selectorText.replace(/svg /g,''));
1138
- var cst = y.style.cssText;
1139
- for (k in varreps) {
1140
- cst = cst.replace(new RegExp(k,'g'),varreps[k]);
1141
- }
1142
- loc.each(function(k,loco) {
1143
- var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
1144
- $(loco).attr('style',cst + sty);
1145
- });
1104
+ var start = parseInt(gc.attr('width'));
1105
+ $('#graphgrid > svg:not(#graphcanvas)').each( (i,ele) => {
1106
+ const gr = $X('<g transform="translate(' + start + ')" xmlns="http://www.w3.org/2000/svg"></g>');
1107
+ start = start + parseInt(ele.getAttribute('width'));
1108
+ $('g',ele).each((j,g) => {
1109
+ gr.append($(g).clone());
1110
+ });
1111
+ gc.append(gr);
1112
+ });
1113
+ var varreps = {};
1114
+ $(window.document.styleSheets).each(function(i,x){
1115
+ if (x && x.href && x.ownerNode.attributes.getNamedItem('data-include-export')) {
1116
+ $(x.cssRules).each(function(j,y){
1117
+ if (y.selectorText == ":root") {
1118
+ $(y.style).each(function(k,z) {
1119
+ varreps['var\\(' + z + '\\)'] = getComputedStyle(document.documentElement).getPropertyValue(z).toString();
1146
1120
  });
1147
- var loc = $(gc).find('text.super');
1148
- loc.attr('style',loc.attr('style') + ' display: none');
1149
- var loc = $(gc).find('.stripe');
1150
- loc.attr('style',loc.attr('style') + ' display: none');
1151
1121
  }
1122
+ var loc = $(gc).find(y.selectorText.replace(/svg /g,''));
1123
+ var cst = y.style.cssText;
1124
+ for (k in varreps) {
1125
+ cst = cst.replace(new RegExp(k,'g'),varreps[k]);
1126
+ }
1127
+ loc.each(function(k,loco) {
1128
+ var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
1129
+ $(loco).attr('style',cst + sty);
1130
+ console.log(loco);
1131
+ });
1152
1132
  });
1153
- $.ajax({
1154
- type: "GET",
1155
- url: url + "/properties/attributes/info/",
1156
- success: function(res){
1157
- $('#savesvgfile').attr('download',res + '.svg');
1158
- $('#savesvgfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(gc.serializeXML()));
1159
- document.getElementById('savesvgfile').click();
1160
- },
1161
- error: report_failure
1162
- });
1133
+ var loc = $(gc).find('text.super');
1134
+ loc.attr('style',loc.attr('style') + ' display: none; ');
1163
1135
  }
1164
1136
  });
1137
+ gc.attr('width',start+1);
1138
+ $.ajax({
1139
+ type: "GET",
1140
+ url: url + "/properties/attributes/info/",
1141
+ success: function(res){
1142
+ $('#savesvgfile').attr('download',res + '.svg');
1143
+ $('#savesvgfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(gc.serializePrettyXML()));
1144
+ document.getElementById('savesvgfile').click();
1145
+ },
1146
+ error: report_failure
1147
+ });
1165
1148
  }// }}}
1166
1149
  async function set_testset(testset,exec) {// {{{
1167
1150
  var url = $('body').attr('current-instance');
@@ -1208,6 +1191,8 @@ async function set_testset(testset,exec) {// {{{
1208
1191
 
1209
1192
  await Promise.all(promises);
1210
1193
 
1194
+ document.dispatchEvent(model_loaded);
1195
+
1211
1196
  $.ajax({
1212
1197
  type: "GET",
1213
1198
  url: url + "/properties/state/",
@@ -1224,7 +1209,9 @@ async function set_testset(testset,exec) {// {{{
1224
1209
  });
1225
1210
  }
1226
1211
  });
1227
- }// }}}
1212
+
1213
+
1214
+ }// }}}
1228
1215
 
1229
1216
  function load_testsetfile_after() { //{{{
1230
1217
  if (loading) return;
@@ -1344,7 +1331,10 @@ async function load_des(url,model) { //{{{
1344
1331
  'CPEE-Event-Source': myid
1345
1332
  },
1346
1333
  data: model,
1347
- error: report_failure
1334
+ error: report_failure,
1335
+ success: () => {
1336
+ document.dispatchEvent(model_loaded);
1337
+ }
1348
1338
  });
1349
1339
  } //}}}
1350
1340
 
@@ -7,20 +7,6 @@ $(document).ready(function() {
7
7
  clearTimeout(timer);
8
8
  timer = setTimeout(function(){ do_mod_save(e.target) }, 5000);
9
9
  });
10
- $(document).on('change','#modifiers div.additional select',function(e){
11
- clearTimeout(timer);
12
- do_mod_save(e.target);
13
- });
14
- $(document).on('blur','#modifiers div.additional input, #modifiers div.additional textarea, #modifiers div.additional [contenteditable]',function(e){
15
- clearTimeout(timer);
16
- do_mod_save(e.target);
17
- });
18
- $(document).on('keypress','#modifiers div.additional input',function(e){
19
- if (e.keyCode == 13) {
20
- clearTimeout(timer);
21
- do_mod_save(e.target);
22
- }
23
- });
24
10
  $(document).on('keypress','#modifiers div.additional [contenteditable]',function(e){
25
11
  if (e.keyCode == 13) {
26
12
  document.execCommand('insertText', false, '\n');
@@ -35,6 +21,10 @@ $(document).ready(function() {
35
21
  clearTimeout(timer);
36
22
  do_mod_save(e.target);
37
23
  });
24
+ $(document).on('relaxngui_change', '#modifiers div.additional', function(e){
25
+ clearTimeout(timer);
26
+ do_mod_save(e.target);
27
+ });
38
28
  });
39
29
 
40
30
  function do_mod_save(target) {
@@ -46,16 +46,6 @@ $(document).ready(function() {
46
46
  clearTimeout(timer);
47
47
  timer = setTimeout(function(){ do_parameters_save(event); }, 5000);
48
48
  });
49
- $(document).on('blur','#dat_dataelements input, #dat_endpoints input, #dat_attributes input',function(event){
50
- clearTimeout(timer);
51
- do_parameters_save(event);
52
- }); //}}}
53
- $(document).on('keypress','#dat_dataelements input, #dat_endpoints input, #dat_attributes input',function(event){
54
- if (event.keyCode == 13) {
55
- clearTimeout(timer);
56
- do_parameters_save(event);
57
- }
58
- }); //}}}
59
49
  $(document).on('relaxngui_remove', '#dat_dataelements, #dat_endpoints, #dat_attributes', function(event){
60
50
  clearTimeout(timer);
61
51
  do_parameters_save(event);
@@ -64,6 +54,10 @@ $(document).ready(function() {
64
54
  clearTimeout(timer);
65
55
  do_parameters_save(event);
66
56
  });
57
+ $(document).on('relaxngui_change', '#dat_dataelements, #dat_endpoints, #dat_attributes', function(event){
58
+ clearTimeout(timer);
59
+ do_parameters_save(event);
60
+ });
67
61
  });
68
62
 
69
63
  function do_parameters_save(event) { //{{{