--- a/svghmi/widget_animate.ysl2 Thu Oct 01 14:23:27 2020 +0200
+++ b/svghmi/widget_animate.ysl2 Mon Oct 19 09:29:11 2020 +0200
@@ -5,6 +5,7 @@
class AnimateWidget extends Widget{
widget_center = undefined;
@@ -17,20 +18,21 @@
// change animation properties
for(let child of this.element.children){
- if(child.nodeName == "animateTransform"){
+ if(child.nodeName.startsWith("animate")){ + if(this.speed != 0 && !this.start){ + this.element.beginElement(); child.setAttribute("dur", this.speed+"s");
- child.setAttribute("from", "0 "+this.widget_center[0]+" "+this.widget_center[1]);
- child.setAttribute("to", "360 "+this.widget_center[0]+" "+this.widget_center[1]);
child.setAttribute("dur", (-1)*this.speed+"s");
- child.setAttribute("from", "360 "+this.widget_center[0]+" "+this.widget_center[1]);
- child.setAttribute("to", "0 "+this.widget_center[0]+" "+this.widget_center[1]);
- child.setAttribute("from", "0 "+this.widget_center[0]+" "+this.widget_center[1]);
- child.setAttribute("to", "0 "+this.widget_center[0]+" "+this.widget_center[1]);
+ this.element.endElement(); --- a/tests/svghmi_v2/svghmi_0@svghmi/svghmi.svg Thu Oct 01 14:23:27 2020 +0200
+++ b/tests/svghmi_v2/svghmi_0@svghmi/svghmi.svg Mon Oct 19 09:29:11 2020 +0200
@@ -16,7 +16,7 @@
sodipodi:docname="svghmi.svg"
- inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
+ inkscape:version="0.92.5 (0.92.5+68)" @@ -92,10 +92,10 @@
sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="-173.06414 : 591.30354 : 1"
+ inkscape:vp_x="-470.06413 : 851.30353 : 1" inkscape:vp_y="0 : 1319.7648 : 0"
- inkscape:vp_z="1192.2994 : 402.34211 : 1"
- inkscape:persp3d-origin="671.58536 : 432.93175 : 1"
+ inkscape:vp_z="895.29941 : 662.3421 : 1" + inkscape:persp3d-origin="374.58537 : 692.93174 : 1" @@ -109,13 +109,13 @@
inkscape:current-layer="hmi0"
- inkscape:zoom="0.7071068"
- inkscape:cx="-76.932824"
- inkscape:cy="317.38961"
- inkscape:window-width="1920"
- inkscape:window-height="1137"
+ inkscape:cx="379.07861" + inkscape:cy="265.09897" + inkscape:window-width="2503" + inkscape:window-height="1416" inkscape:window-maximized="1"
inkscape:guide-bbox="true" />
@@ -130,7 +130,7 @@
sodipodi:insensitive="true" />
inkscape:label="HMI:Slider@/SPEED"
- transform="matrix(7.5590552,0,0,7.5590552,-710.78539,551.61779)"
+ transform="matrix(7.5590552,0,0,7.5590552,-780.78539,561.61779)" style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:0.52916664;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
@@ -183,67 +183,21 @@
style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.26458332px"
id="tspan102-1">000</tspan></text>
- transform="translate(-1.4499385)">
- style="opacity:0.29800002;fill:#de2cc9;fill-opacity:1;stroke:none;stroke-width:0.13229167" />
- style="font-style:normal;font-weight:normal;font-size:5.29166698px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.13229167px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- xml:space="preserve"><tspan
- style="stroke-width:0.13229167px"
- sodipodi:role="line">UP</tspan></text>
- transform="translate(0.28063515)">
- style="opacity:0.29800002;fill:#de2cc9;fill-opacity:1;stroke:none;stroke-width:0.12294135" />
- style="font-style:normal;font-weight:normal;font-size:5.29166698px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.13229167px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- xml:space="preserve"><tspan
- style="stroke-width:0.13229167px"
- sodipodi:role="line">DN</tspan></text>
inkscape:label="HMI:Input@/SOMEPLCGLOBAL">
- transform="scale(1.1201068,0.89277203)"
+ transform="scale(1.1201068,0.89277202)"
style="font-style:normal;font-weight:normal;font-size:124.08008575px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.10200214px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="stroke-width:3.10200214px"
sodipodi:role="line">Test</tspan></text>
@@ -251,8 +205,8 @@
style="opacity:0;fill:#de2cc9;fill-opacity:1;stroke:none;stroke-width:3.45667744"
@@ -1412,7 +1366,7 @@
inkscape:label="HMI:CircularBar@/PUMP0/SLOTH"
- transform="matrix(0.39840034,0,0,0.35920948,224.04409,96.134885)">
+ transform="matrix(0.39840034,0,0,0.35920948,-97.955902,106.13488)"> @@ -1456,7 +1410,7 @@
inkscape:label="HMI:CircularSlider@/PUMP0/SLOTH"
- transform="matrix(0.45707797,0,0,0.45707797,330.74411,340.99474)">
+ transform="matrix(0.45707797,0,0,0.45707797,33.744118,80.994747)"> d="M 970.29569,399.76446 A 184.25998,167.44942 0 0 1 866.26395,284.77467 184.25998,167.44942 0 0 1 904.10823,139.93753"
@@ -1484,43 +1438,43 @@
sodipodi:type="inkscape:box3dside"
inkscape:box3dsidetype="6"
- d="m 919.8592,371.09874 v 61.75093 l 51.05152,-25.59855 V 348.7668 Z"
- points="919.8592,432.84967 970.91072,407.25112 970.91072,348.7668 919.8592,371.09874 "
+ d="m 919.8592,371.09875 v 61.75093 l 51.05152,-25.59855 v -58.48432 z" + points="919.8592,432.84968 970.91072,407.25113 970.91072,348.76681 919.8592,371.09875 " style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-width:21.82598114px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
sodipodi:type="inkscape:box3dside"
inkscape:box3dsidetype="13"
- d="m 919.8592,432.84967 49.77111,22.08625 49.54589,-27.39008 -48.26548,-20.29472 z"
- points="969.63031,454.93592 1019.1762,427.54584 970.91072,407.25112 919.8592,432.84967 "
+ d="m 919.8592,432.84968 49.77112,22.08624 49.54588,-27.39007 -48.26548,-20.29472 z" + points="969.63032,454.93592 1019.1762,427.54585 970.91072,407.25113 919.8592,432.84968 " style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-width:21.82598114px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
sodipodi:type="inkscape:box3dside"
inkscape:box3dsidetype="11"
- d="m 970.91072,348.7668 48.26548,18.93314 v 59.8459 l -48.26548,-20.29472 z"
- points="1019.1762,367.69994 1019.1762,427.54584 970.91072,407.25112 970.91072,348.7668 "
+ d="m 970.91072,348.76681 48.26548,18.93313 v 59.84591 l -48.26548,-20.29472 z" + points="1019.1762,367.69994 1019.1762,427.54585 970.91072,407.25113 970.91072,348.76681 " style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-width:21.82598114px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
sodipodi:type="inkscape:box3dside"
inkscape:box3dsidetype="5"
- d="m 919.8592,371.09874 49.77111,20.56633 49.54589,-23.96513 -48.26548,-18.93314 z"
- points="969.63031,391.66507 1019.1762,367.69994 970.91072,348.7668 919.8592,371.09874 "
+ d="m 919.8592,371.09875 49.77112,20.56633 49.54588,-23.96514 -48.26548,-18.93313 z" + points="969.63032,391.66508 1019.1762,367.69994 970.91072,348.76681 919.8592,371.09875 " style="fill:#4d4d9f;fill-rule:evenodd;stroke:none;stroke-width:21.82598114px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
sodipodi:type="inkscape:box3dside"
inkscape:box3dsidetype="14"
- d="m 969.63031,391.66507 v 63.27085 l 49.54589,-27.39008 v -59.8459 z"
- points="969.63031,454.93592 1019.1762,427.54584 1019.1762,367.69994 969.63031,391.66507 "
+ d="m 969.63032,391.66508 v 63.27084 l 49.54588,-27.39007 v -59.84591 z" + points="969.63032,454.93592 1019.1762,427.54585 1019.1762,367.69994 969.63032,391.66508 " style="fill:#d7d7ff;fill-rule:evenodd;stroke:none;stroke-width:21.82598114px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
sodipodi:type="inkscape:box3dside"
inkscape:box3dsidetype="3"
- d="m 919.8592,371.09874 49.77111,20.56633 v 63.27085 L 919.8592,432.84967 Z"
- points="969.63031,391.66507 969.63031,454.93592 919.8592,432.84967 919.8592,371.09874 "
+ d="m 919.8592,371.09875 49.77112,20.56633 v 63.27084 L 919.8592,432.84968 Z" + points="969.63032,391.66508 969.63032,454.93592 919.8592,432.84968 919.8592,371.09875 " style="fill:#8686bf;fill-rule:evenodd;stroke:none;stroke-width:21.82598114px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
@@ -1538,27 +1492,7 @@
style="fill:#ff00ca;fill-opacity:1;stroke:none;stroke-width:2.25346255px;stroke-opacity:1">000</tspan></text>
- inkscape:label="HMI:ToggleButton@/TOGGLE2">
- inkscape:label="inactive"
- style="opacity:1;fill:#ff0015;fill-opacity:1;stroke:none" />
- inkscape:label="active"
- style="opacity:1;fill:#00ff03;fill-opacity:1;stroke:none" />
- transform="translate(-67.175138,-1.0606552)"
+ transform="translate(-289.17513,-33.060654)" inkscape:label="HMI:ToggleButton@/TOGGLE1">
@@ -1579,28 +1513,7 @@
style="opacity:1;fill:#00ff03;fill-opacity:1;stroke:none" />
- transform="translate(63.639613)"
- inkscape:label="HMI:Button@/TOGGLE">
- inkscape:label="active"
- style="opacity:1;fill:#00ff03;fill-opacity:1;stroke:none" />
- inkscape:label="inactive"
- style="opacity:1;fill:#ff0015;fill-opacity:1;stroke:none" />
- transform="translate(153.9447,-0.96668484)"
+ transform="translate(-287.05529,41.033314)" inkscape:label="HMI:Button@/TOGGLE">
@@ -1621,8 +1534,39 @@
style="opacity:1;fill:#ff0015;fill-opacity:1;stroke:none" />
- inkscape:label="HMI:Animate@/SPEED">
+ inkscape:label="HMI:AnimateRotation@/SPEED"> + style="fill:#ececec;fill-opacity:1;stroke:#ff0000;stroke-width:2.95733476;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:0;fill:#ececec;fill-opacity:1;stroke:none;stroke-width:3.69000006;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + sodipodi:nodetypes="sssssss" + inkscape:connector-curvature="0" + d="m 719.75481,403.83452 c 1.9692,9.54564 9.417,-4.37059 26.6751,-4.06174 27.2477,0.48762 30.0401,21.24497 35.5749,12.81174 6.6594,-10.14673 12.6699,-22.7446 14.75,-33.25 13.5509,-68.43783 -46.4736,-97.18589 -72,-91.49999 -40.88858,9.10778 -49.54078,47.21136 -31.99998,71.75 13.16428,18.41615 23.37448,26.67508 26.99998,44.24999 z" + style="fill:#fd0000;fill-opacity:1;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + sodipodi:nodetypes="sssssss" + inkscape:connector-curvature="0" + d="m 789.45321,432.25975 c -8.9783,-3.79302 -1.7422,10.23457 -11.7862,24.27224 -15.8577,22.16324 -34.5364,12.68834 -30.7308,22.03024 4.5788,11.24 11.5443,23.3361 19.0162,31.0083 48.6752,49.9808 106.3992,16.8549 116.1963,-7.3926 15.6932,-38.84015 -10.7791,-67.57972 -40.9378,-67.05341 -22.634,0.39495 -35.2273,4.11873 -51.7577,-2.86477 z" + style="fill:#fd0000;fill-opacity:1;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + sodipodi:nodetypes="sssssss" + inkscape:connector-curvature="0" + d="m 730.85671,475.85643 c 7.5732,-6.1355 -8.2092,-6.3552 -15.8654,-21.82523 -12.0882,-24.42445 5.0646,-36.44319 -4.9688,-37.48364 -12.07218,-1.25186 -26.02318,-0.80116 -36.30958,2.17903 -67.0109,19.41388 -64.9607,85.93594 -48.1806,105.99474 26.8787,32.1304 64.6969,22.3051 78.43058,-4.5502 10.3071,-20.1549 12.9505,-33.0184 26.8938,-44.3147 z" + style="fill:#fd0000;fill-opacity:1;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> attributeName="transform"
@@ -1631,36 +1575,45 @@
repeatCount="indefinite" />
- style="fill:#ececec;fill-opacity:1;stroke:#ff0000;stroke-width:2.95733476;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ inkscape:label="HMI:CustomHtml">
- style="opacity:0;fill:#ececec;fill-opacity:1;stroke:none;stroke-width:3.69000006;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
- sodipodi:nodetypes="sssssss"
- inkscape:connector-curvature="0"
- d="m 1021.7548,245.83452 c 1.9692,9.54564 9.417,-4.37059 26.6751,-4.06174 27.2477,0.48762 30.0401,21.24497 35.5749,12.81174 6.6594,-10.14673 12.6699,-22.7446 14.75,-33.25 13.5509,-68.43783 -46.4736,-97.18589 -72,-91.49999 -40.88858,9.10778 -49.54078,47.21136 -31.99998,71.75 13.16428,18.41615 23.37448,26.67508 26.99998,44.24999 z"
- style="fill:#fd0000;fill-opacity:1;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- sodipodi:nodetypes="sssssss"
- inkscape:connector-curvature="0"
- d="m 1091.4532,274.25975 c -8.9783,-3.79302 -1.7422,10.23457 -11.7862,24.27224 -15.8577,22.16324 -34.5364,12.68834 -30.7308,22.03024 4.5788,11.24 11.5443,23.3361 19.0162,31.0083 48.6752,49.9808 106.3992,16.8549 116.1963,-7.3926 15.6932,-38.84015 -10.7791,-67.57972 -40.9378,-67.05341 -22.634,0.39495 -35.2273,4.11873 -51.7577,-2.86477 z"
- style="fill:#fd0000;fill-opacity:1;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- sodipodi:nodetypes="sssssss"
- inkscape:connector-curvature="0"
- d="m 1032.8567,317.85643 c 7.5732,-6.1355 -8.2092,-6.3552 -15.8654,-21.82523 -12.0882,-24.42445 5.0646,-36.44319 -4.9688,-37.48364 -12.07218,-1.25186 -26.02318,-0.80116 -36.30958,2.17903 -67.0109,19.41388 -64.9607,85.93594 -48.1806,105.99474 26.8787,32.1304 64.6969,22.3051 78.43058,-4.5502 10.3071,-20.1549 12.9505,-33.0184 26.8938,-44.3147 z"
- style="fill:#fd0000;fill-opacity:1;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ inkscape:label="container" + style="opacity:0.29800002;fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.11057007" /> + transform="scale(0.57360572,1.7433578)" + style="font-style:normal;font-weight:normal;font-size:9.29032898px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.87096828px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + xml:space="preserve"><tspan + style="stroke-width:0.87096828px" + sodipodi:role="line"> <img xmlns="http://www.w3.org/1999/xhtml" id="img" src="https://thumbs.gfycat.com/ImpoliteSoupyKakapo-size_restricted.gif" width="100%" height="80%" /></tspan><tspan + style="stroke-width:0.87096828px" + sodipodi:role="line"> <a xmlns="http://www.w3.org/1999/xhtml" href='www.gmail.com'>Gmail</a></tspan><tspan + style="stroke-width:0.87096828px" + sodipodi:role="line"> <p xmlns="http://www.w3.org/1999/xhtml">Koj kurac to ne dela</p></tspan><tspan + style="stroke-width:0.87096828px" + sodipodi:role="line" /></text>