cpee 2.1.56 → 2.1.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/resources-label.css +33 -32
  3. data/cockpit/css/resources-svg.css +2 -2
  4. data/cockpit/css/ui.css +2 -42
  5. data/cockpit/css/wfadaptor.css +9 -0
  6. data/cockpit/edit.html +15 -2
  7. data/cockpit/graph.html +12 -1
  8. data/cockpit/index.html +14 -1
  9. data/cockpit/js/details.js +1 -0
  10. data/cockpit/js/instance.js +29 -13
  11. data/cockpit/js/resources.js +59 -11
  12. data/cockpit/js/wfadaptor.js +10 -6
  13. data/cockpit/model.html +3 -2
  14. data/cockpit/themes/base.js +1506 -0
  15. data/cockpit/themes/compact/rngs/start.rng +10 -0
  16. data/cockpit/themes/compact/symbols/start_event.svg +1 -1
  17. data/cockpit/themes/compact/theme.js +8 -1487
  18. data/cockpit/themes/control/rngs/start.rng +10 -0
  19. data/cockpit/themes/control/symbols/start_event.svg +1 -1
  20. data/cockpit/themes/control/theme.js +277 -1334
  21. data/cockpit/themes/dataflow/rngs/start.rng +10 -0
  22. data/cockpit/themes/dataflow/symbols/start_event.svg +1 -1
  23. data/cockpit/themes/dataflow/theme.js +144 -1563
  24. data/cockpit/themes/default/rngs/start.rng +10 -0
  25. data/cockpit/themes/default/symbols/start_event.svg +1 -1
  26. data/cockpit/themes/default/theme.js +1 -1493
  27. data/cockpit/themes/extended/rngs/start.rng +10 -0
  28. data/cockpit/themes/extended/symbols/start_event.svg +1 -1
  29. data/cockpit/themes/extended/theme.js +81 -1529
  30. data/cockpit/themes/felix/symbols/start_event.svg +1 -1
  31. data/cockpit/themes/felix/theme.js +68 -1528
  32. data/cockpit/themes/model/symbols/start_event.svg +1 -1
  33. data/cockpit/themes/model/theme.js +735 -1383
  34. data/cockpit/themes/packed/rngs/start.rng +10 -0
  35. data/cockpit/themes/packed/symbols/start_event.svg +1 -1
  36. data/cockpit/themes/packed/theme.js +9 -1487
  37. data/cockpit/themes/preset/rngs/start.rng +10 -0
  38. data/cockpit/themes/preset/symbols/start_event.svg +1 -1
  39. data/cockpit/themes/preset/theme.js +1 -1493
  40. data/cockpit/track.html +11 -0
  41. data/cpee.gemspec +1 -1
  42. data/lib/properties/executionhandler.rng +1 -1
  43. data/lib/properties.xml +1 -1
  44. data/server/executionhandlers/ruby/connection.rb +8 -11
  45. data/server/executionhandlers/rust/backend/README.md +17 -0
  46. data/server/executionhandlers/rust/backend/compile.sh +5 -0
  47. data/server/executionhandlers/rust/backend/opts.yaml +6 -0
  48. data/server/executionhandlers/rust/execution.rb +84 -0
  49. data/server/routing/end.pid +1 -1
  50. data/server/routing/forward-events-00.pid +1 -1
  51. data/server/routing/forward-votes.pid +1 -1
  52. data/server/routing/persist.pid +1 -1
  53. metadata +8 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d77967638de8fff8f7c245c4913c4f49811645831bb8029a40515862ef0b65c
4
- data.tar.gz: 32b6ab1f5ddc14fb1e8584ce2aacfcec2a44f988d7bb9ada9db844f7524409b0
3
+ metadata.gz: 880c2cfd824abd01dda1b53285ef3fd95527fff1fd85084534e1158f1f9ed68b
4
+ data.tar.gz: 18269ab06823c002e027af1c111cb61a9865f82263e0aba59254c219c6424d66
5
5
  SHA512:
6
- metadata.gz: f6c79e249af879938e24817a2a943b35864280a95e6dd9153a8f7286c6f2160dcc282e0341a9d67569e906e3e04d6a5f1c6a6fc0309df451a79dff982edcb13c
7
- data.tar.gz: 0b3d58a8a0cc37333d45e3f7681062ab8ab9abdddc5123c67c6b493a73ea7c844e8015ac3d219fdca69c664a2e785ce77a3963a189cae7aff476d58cb678ba89
6
+ metadata.gz: 6359ca4690a8dbfc2ebbf3f03bb812c1dd27282cc8e7549404ec24404fa99c7f863ccd8bd2c1fb4aab6beb19468aa480fea2a4e127872a62ec888aa162a5b3d3
7
+ data.tar.gz: 4af5818c1a0779992da01302a989919b218ef4fd09d2cca4bd5f9253c3455563ca12984f77d04def36ae90b26ef29e14bfab9e5a2c2a8e3b97dbb4219eaa4c87
@@ -1,35 +1,36 @@
1
- .resource-label {
2
- position: absolute;
3
- padding-left: 0.5em;
4
- padding-right: 0.5em;
5
- min-width: 10ex;
6
- height: 2em;
7
- text-align: center;
8
- line-height: 2em;
9
- background-color: var(--wfadaptor-background);
10
- border: 1pt solid var(--wfadaptor-border);
11
- border-radius: 1em;
1
+ svg.displaylabel .displaylabel {
2
+ fill: var(--wfadaptor-background);
3
+ fill-opacity:1;
4
+ stroke: var(--wfadaptor-border);
5
+ stroke-width:1.6;
6
+ stroke-linecap:round;
7
+ stroke-linejoin:round;
8
+ stroke-miterlimit:4;
9
+ stroke-opacity:1;
10
+ stroke-dasharray:none;
12
11
  }
13
-
14
- .resource-label:before {
15
- content: ' ';
16
- position: absolute;
17
- width: 0;
18
- height: 0;
19
- left: 15px;
20
- top: 2em;
21
- border: 8.5px solid;
22
- border-color: var(--wfadaptor-border) transparent transparent var(--wfadaptor-border);
12
+ svg.displaylabel .displaylabelinner {
13
+ fill: var(--wfadaptor-background);
14
+ fill-opacity:1;
15
+ stroke: var(--wfadaptor-background);
16
+ stroke-width:1.6;
17
+ stroke-linecap:round;
18
+ stroke-linejoin:round;
19
+ stroke-miterlimit:4;
20
+ stroke-opacity:1;
21
+ stroke-dasharray:none;
23
22
  }
24
-
25
- .resource-label:after {
26
- content: ' ';
27
- position: absolute;
28
- width: 0;
29
- height: 0;
30
- left: 16px;
31
- top: 2em;
32
- border: 7.5px solid;
33
- border-color: var(--wfadaptor-background) transparent transparent var(--wfadaptor-background);
23
+ svg.displaylabel text.label {
24
+ font-size:12px;
25
+ font-style:normal;
26
+ font-variant:normal;
27
+ font-stretch:normal;
28
+ text-align:center;
29
+ line-height:125%;
30
+ writing-mode:horizontal-tb;
31
+ text-anchor:start;
32
+ fill: var(--wfadaptor-base);
33
+ fill-opacity:1;
34
+ stroke:none;
35
+ font-family:Arial;
34
36
  }
35
-
@@ -10,11 +10,11 @@ svg .resource-point.write {
10
10
  svg .resource-point.both {
11
11
  fill: blue;
12
12
  }
13
- svg line.resource-line {
13
+ svg line.resource-column {
14
14
  stroke: red;
15
15
  stroke-opacity: 0.1;
16
16
  }
17
- svg line.resource-line:hover {
17
+ svg line.resource-column:hover {
18
18
  stroke: red;
19
19
  stroke-opacity: 0.2;
20
20
  }
data/cockpit/css/ui.css CHANGED
@@ -22,54 +22,14 @@ body {
22
22
  #graphcanvas {
23
23
  grid-column: 1;
24
24
  }
25
- #graphgrid .graphlabel {
26
- padding-left: 0.5em;
27
- padding-right: 0.5em;
28
- display: flex;
29
- flex-direction: row;
30
- }
31
- #graphgrid .graphempty {
32
- padding-left: 0.5em;
33
- display: flex;
34
- flex-direction: row;
35
- }
36
25
  #graphgrid .graphlast {
37
26
  padding-left: 0.5em;
38
27
  display: flex;
39
28
  flex-direction: row;
40
29
  }
41
- #graphgrid.striped .graphlabel, #graphgrid.striped .graphempty {
42
- border-left: 1pt solid var(--wfadaptor-border);
43
- }
44
- #graphgrid.striped .graphlabel.even, #graphgrid.striped .graphempty.even, #graphgrid.striped .graphlast.even {
45
- background-color: #e9e9e9;
46
- }
47
- #graphgrid .graphlabel > span {
48
- align-self: center;
49
- white-space: nowrap;
50
- }
51
- #graphgrid .graphlabel.hover {
52
- color: var(--wfadaptor-selected);
53
- cursor: pointer;
54
- }
55
- #graphgrid .graphlabel.selected {
56
- color: var(--wfadaptor-selected);
57
- }
58
30
 
59
- #graphgrid .graphlabel.selected a, #graphgrid .graphlabel.hover a {
60
- color: var(--wfadaptor-selected);
61
- }
62
- #graphgrid .graphlabel a {
63
- color: var(--x-ui-light-text-color);
64
- }
65
- #graphgrid .graphlabel a::after {
66
- font: normal normal normal 14px/1 FontAwesome;
67
- font-size: 0.8em;
68
- text-rendering: auto;
69
- content: ' ';
70
- }
71
- #graphgrid .graphlabel.selected a::after, graphgrid .graphlabel.hover a::after {
72
- color: var(--wfadaptor-selected);
31
+ #graphgrid.striped .graphlast.even {
32
+ background-color: #e9e9e9;
73
33
  }
74
34
 
75
35
  #instance ui-content { height: 7em; }
@@ -218,6 +218,15 @@ svg .marked .cline {
218
218
  stroke-dasharray:none;
219
219
  }
220
220
 
221
+ svg.labelsrow text.label {
222
+ cursor: pointer;
223
+ }
224
+ svg.labelsrow text.label:hover, svg.labelsrow text.label.hover {
225
+ fill: var(--wfadaptor-selected);
226
+ }
227
+ svg text.label.selected {
228
+ fill: var(--wfadaptor-selected);
229
+ }
221
230
  svg .selected text.label {
222
231
  color: var(--wfadaptor-selected);
223
232
  fill: var(--wfadaptor-selected);
data/cockpit/edit.html CHANGED
@@ -17,6 +17,7 @@
17
17
  <!DOCTYPE html>
18
18
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
19
19
  <head>
20
+ <meta charset="utf-8"/>
20
21
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
21
22
  <title>CPEE Cockpit</title>
22
23
 
@@ -46,16 +47,17 @@
46
47
 
47
48
  <!-- modelling ui -->
48
49
  <script type="text/javascript" src="js/wfadaptor.js"></script>
49
- <link rel="stylesheet" href="css/wfadaptor.css" type="text/css"/>
50
+ <link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
50
51
 
51
52
  <!-- custom stuff, play arround -->
52
53
  <script type="text/javascript" src="js/ui.js"></script>
53
54
  <script type="text/javascript" src="js/instance.js"></script>
54
55
  <script type="text/javascript" src="js/details.js"></script>
55
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
+ <script type="text/javascript" src="js/resources.js"></script>
56
58
  <script type="text/javascript" src="js/edit.js"></script>
57
59
  <script type="text/javascript" src="js/modifiers.js"></script>
58
- <script type="text/javascript" src="js/resources.js"></script>
60
+ <script type="text/javascript" src="themes/base.js"></script>
59
61
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
62
  <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
61
63
  <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
@@ -120,6 +122,17 @@
120
122
  <div class='menu' id='templates'></div>
121
123
  <div class='menu' id='modeltypes'></div>
122
124
 
125
+ <template id="label">
126
+ <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0;" class="displaylabel">
127
+ <g transform="translate(1 %%1) rotate(-%%2)">
128
+ <rect class="displaylabel" width="200" height="14" x="8" y="0" rx="5" ry="5"/>
129
+ <path class="displaylabel" d="M10,13 0,13 8,8"/>
130
+ <path class="displaylabelinner" d="M10,11.5 8.5,11.5 8.5,9.5 10,9.5"/>
131
+ <text class="label" x="18" y="10">aaaa</text>
132
+ </g>
133
+ </svg>
134
+ </template>
135
+
123
136
  <ui-tabbed id="instance">
124
137
  <ui-tabbar>
125
138
  <ui-tab class="switch" ></ui-tab>
data/cockpit/graph.html CHANGED
@@ -47,7 +47,7 @@
47
47
 
48
48
  <!-- modelling ui -->
49
49
  <script type="text/javascript" src="js/wfadaptor.js"></script>
50
- <link rel="stylesheet" href="css/wfadaptor.css" type="text/css"/>
50
+ <link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
51
51
 
52
52
  <!-- custom stuff, play arround -->
53
53
  <script type="text/javascript" src="js/ui.js"></script>
@@ -56,6 +56,7 @@
56
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
57
  <script type="text/javascript" src="js/modifiers.js"></script>
58
58
  <script type="text/javascript" src="js/resources.js"></script>
59
+ <script type="text/javascript" src="themes/base.js"></script>
59
60
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
61
  <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
61
62
  <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
@@ -63,6 +64,16 @@
63
64
  </head>
64
65
  <body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
65
66
  <div class='hidden' id='relaxngworker'></div>
67
+ <template id="label">
68
+ <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0;" class="displaylabel">
69
+ <g transform="translate(1 %%1) rotate(-%%2)">
70
+ <rect class="displaylabel" width="200" height="14" x="8" y="0" rx="5" ry="5"/>
71
+ <path class="displaylabel" d="M10,13 0,13 8,8"/>
72
+ <path class="displaylabelinner" d="M10,11.5 8.5,11.5 8.5,9.5 10,9.5"/>
73
+ <text class="label" x="18" y="10">aaaa</text>
74
+ </g>
75
+ </svg>
76
+ </template>
66
77
  <div id="trackfull">
67
78
  <div id='graphcolumn'>
68
79
  <div id='graphgrid'>
data/cockpit/index.html CHANGED
@@ -17,6 +17,7 @@
17
17
  <!DOCTYPE html>
18
18
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
19
19
  <head>
20
+ <meta charset="utf-8"/>
20
21
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
21
22
  <title>CPEE Cockpit</title>
22
23
 
@@ -53,8 +54,9 @@
53
54
  <script type="text/javascript" src="js/instance.js"></script>
54
55
  <script type="text/javascript" src="js/details.js"></script>
55
56
  <script type="text/javascript" src="js/parameters.js"></script>
56
- <script type="text/javascript" src="js/modifiers.js"></script>
57
57
  <script type="text/javascript" src="js/resources.js"></script>
58
+ <script type="text/javascript" src="js/modifiers.js"></script>
59
+ <script type="text/javascript" src="themes/base.js"></script>
58
60
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
59
61
  <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
60
62
  <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
@@ -119,6 +121,17 @@
119
121
  <div class='menu' id='templates'></div>
120
122
  <div class='menu' id='modeltypes'></div>
121
123
 
124
+ <template id="label">
125
+ <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0;" class="displaylabel">
126
+ <g transform="translate(1 %%1) rotate(-%%2)">
127
+ <rect class="displaylabel" width="200" height="14" x="8" y="0" rx="5" ry="5"/>
128
+ <path class="displaylabel" d="M10,13 0,13 8,8"/>
129
+ <path class="displaylabelinner" d="M10,11.5 8.5,11.5 8.5,9.5 10,9.5"/>
130
+ <text class="label" x="18" y="10">aaaa</text>
131
+ </g>
132
+ </svg>
133
+ </template>
134
+
122
135
  <ui-tabbed id="instance">
123
136
  <ui-tabbar>
124
137
  <ui-tab class="switch" ></ui-tab>
@@ -68,6 +68,7 @@ function do_main_work() { //{{{
68
68
  vtarget.parents('g.element[element-id]').addClass('selected');
69
69
  }
70
70
  manifestation.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
71
+ $('#graphgrid [element-id=' + svgid + ']').addClass('selected');
71
72
 
72
73
 
73
74
  var newnode = vtarget.parents('g.element[element-id]');
@@ -567,7 +567,7 @@ function adaptor_init(url,theme,dslx) { //{{{
567
567
  $('#graphgrid').removeClass('striped');
568
568
  }
569
569
 
570
- $('#graphgrid .graphlabel, #graphgrid .graphempty, #resources, #graphgrid .graphlast').remove();
570
+ $('.labelsrow, #graphgrid .graphlast').remove();
571
571
  let tcolumns = [];
572
572
  let tcolumntype = {};
573
573
  let tcolumncount = {}
@@ -605,9 +605,10 @@ function adaptor_init(url,theme,dslx) { //{{{
605
605
  mapPoints.set(k, p);
606
606
  }
607
607
 
608
- let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
608
+ let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg" class="resource-row" element-row="' + (val.row-1) + '"></g>');
609
609
 
610
610
  var cx = space;
611
+ var count = 0;
611
612
  for (const [k, p] of mapPoints) {
612
613
  let firstAssignFlag = false;
613
614
  p.x = cx;
@@ -617,12 +618,15 @@ function adaptor_init(url,theme,dslx) { //{{{
617
618
  let inner;
618
619
 
619
620
  if (p.AR == "Read") {
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
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x) + ',' + pos + ' ' + (p.x + iconsize) + ',' + (pos + iconsize/2) + ' ' + (p.x + iconsize) + ',' + (pos - iconsize/2) + '" class="resource-point read"></polygon>');
621
622
  if (pos == p.y0) { firstAssignFlag = true; }
622
623
  } else if (p.AR == "Assign") { // Define points for a triangle pointing to the left
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>');
624
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x + iconsize) + ',' + pos + ' ' + (p.x) + ',' + (pos + iconsize/2) + ' ' + (p.x) + ',' + (pos - iconsize/2) + '" class="resource-point write"></polygon>');
624
625
  } else if (p.AR == "AssignRead") {
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
+ inner = $X('<circle xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
627
+ } else if (p.AR == "ReadAssign") {
628
+ inner = $X('<circle xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
629
+ if (pos == p.y0) { firstAssignFlag = true; }
626
630
  }
627
631
 
628
632
  // extend the bars
@@ -635,16 +639,26 @@ function adaptor_init(url,theme,dslx) { //{{{
635
639
  }
636
640
 
637
641
  if (firstAssignFlag) {
638
- // Additional logic and construction of another polygon for orange triangle pointing left
642
+ // Additional logic and construction of another polygon for orange triangle pointing left in row 0
639
643
  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"></polygon>').append($X('<text xmlns="http://www.w3.org/2000/svg"></text>').text(k)));
644
+ if (tcolumnsvgs[col.column][1] == undefined) {
645
+ tcolumnsvgs[col.column][1] = $X('<g xmlns="http://www.w3.org/2000/svg" class="resource-row" element-row="' + 0 + '"></g>');
646
+ }
647
+ tcolumnsvgs[col.column][1].append($X('<polygon xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" points="' + (p.x + iconsize) + ',' + firstpos + ' ' + (p.x) + ',' + (firstpos + iconsize/2) + ' ' + (p.x) + ',' + (firstpos - iconsize/2) + '" class="resource-point write"></polygon>').append($X('<text xmlns="http://www.w3.org/2000/svg"></text>').text(k)));
641
648
  }
642
649
  cx += iconsize + space;
650
+ count += 1;
643
651
  }
644
652
 
645
- tcolumnsvgs[col.column][val.row] = tsvg;
653
+ if (tsvg.children().length > 0) {
654
+ tcolumnsvgs[col.column][val.row] = tsvg;
655
+ }
646
656
  } else {
647
- tsvg = $X('<text x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg"></text>').text(col.value);
657
+ tsvg = $X('<text class="label" element-id="' + val.element_id + '" x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg"></text>')
658
+ tsvg.text(col.value);
659
+ tsvg.mouseover(function(ev){ manifestation.events.mouseover($(ev.currentTarget).attr('element-id')); });
660
+ tsvg.mouseout(function(ev){ manifestation.events.mouseout($(ev.currentTarget).attr('element-id')); });
661
+ tsvg.click(function(ev){ manifestation.events.click($(ev.currentTarget).attr('element-id')); });
648
662
  tcolumnsvgs[col.column][val.row] = tsvg;
649
663
  }
650
664
 
@@ -661,7 +675,7 @@ function adaptor_init(url,theme,dslx) { //{{{
661
675
 
662
676
  tcolumns.forEach(h => {
663
677
  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>');
678
+ const svgcolumn = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" class="labelsrow"></svg>');
665
679
  const svgback = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
666
680
  const svgfront = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
667
681
  let xwidth = 0;
@@ -684,8 +698,10 @@ function adaptor_init(url,theme,dslx) { //{{{
684
698
  }
685
699
  }
686
700
  if (tcolumntype[h] == 'resource' || tcolumntype[h] == 'bodsod') {
701
+ let count = 0;
687
702
  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="' + tcolumntype[h] + '-line" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
703
+ svgback.append($X('<line xmlns="http://www.w3.org/2000/svg" resource-column="' + count + '" x1="' + (p.x + iconsize/2) + '" y1="' + p.y0 + '" x2="' + (p.x + iconsize/2) + '" y2="' + (p.ymax + 0.01) + '" class="' + tcolumntype[h] + '-column" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
704
+ count += 1;
689
705
  }
690
706
  }
691
707
 
@@ -1110,6 +1126,7 @@ function save_svgfile() {// {{{
1110
1126
  });
1111
1127
  gc.append(gr);
1112
1128
  });
1129
+ gc.find('.selected').removeClass('selected');
1113
1130
  var varreps = {};
1114
1131
  $(window.document.styleSheets).each(function(i,x){
1115
1132
  if (x && x.href && x.ownerNode.attributes.getNamedItem('data-include-export')) {
@@ -1127,7 +1144,6 @@ function save_svgfile() {// {{{
1127
1144
  loc.each(function(k,loco) {
1128
1145
  var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
1129
1146
  $(loco).attr('style',cst + sty);
1130
- console.log(loco);
1131
1147
  });
1132
1148
  });
1133
1149
  var loc = $(gc).find('text.super');
@@ -1152,7 +1168,7 @@ async function set_testset(testset,exec) {// {{{
1152
1168
  var promises = [];
1153
1169
 
1154
1170
  var tset = $X('<properties xmlns="http://cpee.org/ns/properties/2.0"/>');
1155
- tset.append($("testset > executionwrapper",testset));
1171
+ tset.append($("testset > executionhandler",testset));
1156
1172
  tset.append($("testset > positions",testset));
1157
1173
  tset.append($("testset > dataelements",testset));
1158
1174
  tset.append($("testset > endpoints",testset));
@@ -1,16 +1,64 @@
1
+ function show_label(x,y,deg,text) {
2
+ const degrees_to_radians = deg => (deg * Math.PI) / 180.0;
3
+
4
+ let clone = $('svg',document.querySelector('#label').content.cloneNode(true));
5
+ $('text',clone).text(text);
6
+ let n = $('body').append(clone);
7
+ let dim = $('text',clone)[0].getBBox();
8
+ let height = $('rect',clone).attr('height');
9
+ let width = dim.width + dim.x;
10
+ let shift = (width + 10) * Math.sin(degrees_to_radians(deg));
11
+ let shift_plus = height * Math.sin(degrees_to_radians(90-deg));
12
+ let neigh = (width + 10) * Math.cos(degrees_to_radians(deg)) + height * Math.cos(degrees_to_radians(90-deg));
13
+
14
+ let top_y = 23 * Math.cos(degrees_to_radians(deg));
15
+ let top_x = 23 * Math.sin(degrees_to_radians(deg));
16
+
17
+ $(clone).css('left',x-top_x);
18
+ $(clone).css('top',y-shift-top_y);
19
+
20
+ $(clone).attr('height',shift + shift_plus + 2);
21
+ $(clone).attr('width',neigh + 2);
22
+ $('g',clone).attr('transform',$('g',clone).attr('transform').replace(/%%1/, shift + 1).replace(/%%2/, deg));
23
+ $('rect',clone).attr('width',width);
24
+ }
25
+
26
+ function show_row_label(data) {
27
+ let pos = data.getBoundingClientRect();
28
+ let pos_top = $('#graphcolumn')[0].getBoundingClientRect();
29
+ let pos_y;
30
+ let text = $('text',data).text();
31
+ if (pos.y < (pos_top.y + 10)) {
32
+ pos_y = pos_top.y + 10;
33
+ } else {
34
+ pos_y = pos.y;
35
+ }
36
+ show_label(pos.x + 12, pos_y, 60, text);
37
+ }
38
+
1
39
  $(document).ready(function() {
2
- $('.resource-label').on('mouseover',()=>{
3
- $('.resource-label').hide(); // Speech Bubble hide when over
40
+ var current_label;
41
+ $('#graphgrid').on('mouseout','svg .resource-column, svg .resource-point',(data)=>{
42
+ $('.displaylabel').remove();
43
+ current_label = undefined;
4
44
  });
5
- $('#graphgrid').on('mouseover','#resources line.resource-line, #resources g polygon.resource-point',(data)=>{
6
- const left = $('.resource-label').offset().left;
7
- const pos = $(data.target).offset().left - 11;
8
- if ($('.resource-label').is(":hidden") || left != pos) {
9
- let labeltext = $('text',data.currentTarget).text();
10
- $('.resource-label').text(labeltext);
11
- $('.resource-label').css('left', pos);
12
- $('.resource-label').css('top', data.originalEvent.clientY - 50);
13
- $('.resource-label').show();
45
+ $('#graphcolumn').scroll((data)=>{
46
+ if (current_label != undefined) {
47
+ $('.displaylabel').remove();
48
+ show_row_label(current_label);
14
49
  }
15
50
  });
51
+ $('#graphgrid').on('mouseover','svg .resource-column',(data)=>{
52
+ show_row_label(data.target);
53
+ current_label = data.target;
54
+ });
55
+ $('#graphgrid').on('mouseover','svg .resource-point',(ev)=>{
56
+ let rc = $(ev.target).attr('resource-column');
57
+ let data = $('.resource-column[resource-column=' + rc + ']')[0];
58
+ show_row_label(data);
59
+ current_label = data;
60
+ // let pos = data.target.getBoundingClientRect();
61
+ // let text = $('text',data.target).text();
62
+ // show_label(pos.x + 12, pos.y + 5, 60, text);
63
+ });
16
64
  });
@@ -153,12 +153,14 @@ function WfAdaptor(theme_base,doit) { // Controller {{{
153
153
  } // }}}
154
154
 
155
155
  // WfIllustrator:
156
- // Is in charge of displaying the Graph. It is further able insert and remove elements with given ID's from the illsutration.
156
+ // Is in charge of displaying the Graph. It is further able insert and remove elements with given ID's from the illustration.
157
157
  function WfIllustrator(wf_adaptor) { // View {{{
158
158
  // Variable {{{
159
159
  // public
160
160
  this.height = 40;
161
161
  this.width = 40;
162
+ this.default_width = 40;
163
+ this.default_height = 40;
162
164
  this.height_shift = this.height * 0.26;
163
165
  this.width_shift = this.width * 0.39;
164
166
  this.elements = {}; // the svgs
@@ -230,14 +232,16 @@ function WfIllustrator(wf_adaptor) { // View {{{
230
232
 
231
233
  var draw_symbol = this.draw.draw_symbol = function (sname, id, title, row, col, group, addition) { // {{{
232
234
  if(self.elements[sname] == undefined || self.elements[sname].svg == undefined) sname = 'unknown';
235
+ let center_x = (self.width - self.default_width) / 2;
236
+ let center_y = (self.height - self.default_height) / 2;
233
237
  if (addition) {
234
- var g = $X('<g class="element" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
235
- '<g transform="translate(' + String(col*self.width-self.width_shift) + ',' + String(row*self.height-(self.height-self.height_shift)) + ')"></g>' +
238
+ var g = $X('<g class="element" element-row="' + (row-1) + '" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
239
+ '<g transform="translate(' + String(col*self.width+center_x-self.width_shift) + ',' + String(row*self.height+center_y-(self.height-self.height_shift)) + ')"></g>' +
236
240
  '</g>');
237
241
  } else {
238
- var g = $X('<g class="element" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
239
- '<g transform="translate(' + String(col*self.width-self.width_shift) + ',' + String(row*self.height-(self.height-self.height_shift)) + ')">' +
240
- '<text class="super" transform="translate(30,8.4)">' +
242
+ var g = $X('<g class="element" element-row="' + (row-1) + '" element-type="' + sname + '" element-id="' + id + '" xmlns="http://www.w3.org/2000/svg">' +
243
+ '<g transform="translate(' + String(col*self.width+center_x-self.width_shift) + ',' + String(row*self.height+center_y-(self.height-self.height_shift)) + ')">' +
244
+ '<text class="super" transform="translate(' + (self.default_width-10) + ',8.4)">' +
241
245
  '<tspan class="active">0</tspan>' +
242
246
  '<tspan class="colon">,</tspan>' +
243
247
  '<tspan class="vote">0</tspan>' +
data/cockpit/model.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>
@@ -54,8 +54,9 @@
54
54
  <script type="text/javascript" src="js/details.js"></script>
55
55
  <script type="text/javascript" src="js/parameters.js"></script>
56
56
  <script type="text/javascript" src="js/model.js"></script>
57
- <script type="text/javascript" src="js/modifiers.js"></script>
58
57
  <script type="text/javascript" src="js/edit.js"></script>
58
+ <script type="text/javascript" src="js/modifiers.js"></script>
59
+ <script type="text/javascript" src="themes/base.js"></script>
59
60
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
61
  <link rel="stylesheet" href="css/model.css" type="text/css"/>
61
62
  <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>