# HG changeset patch # User Edouard Tisserant # Date 1603399469 -7200 # Node ID 81758c94f3dfda6a2255d76df92a395b0c36083d # Parent 2263f2ecf9bbd0c8facd4c13caaf7c00afddf225 SVGHMI: Fix HMI_REAL support, and add a HMI_REAL use case in tests/svghmi. diff -r 2263f2ecf9bb -r 81758c94f3df svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Tue Oct 20 00:24:49 2020 +0200 +++ b/svghmi/gen_index_xhtml.xslt Thu Oct 22 22:44:29 2020 +0200 @@ -1,6 +1,6 @@ - - + + @@ -5940,7 +5940,7 @@ - + @@ -6059,6 +6059,8 @@ NODE: (dv,offset) => [dv.getInt8(offset, true), 1], + REAL: (dv,offset) => [dv.getFloat32(offset, true), 4], + STRING: (dv, offset) => { size = dv.getInt8(offset); diff -r 2263f2ecf9bb -r 81758c94f3df svghmi/svghmi.js --- a/svghmi/svghmi.js Tue Oct 20 00:24:49 2020 +0200 +++ b/svghmi/svghmi.js Thu Oct 22 22:44:29 2020 +0200 @@ -39,6 +39,7 @@ INT: (dv,offset) => [dv.getInt16(offset, true), 2], BOOL: (dv,offset) => [dv.getInt8(offset, true), 1], NODE: (dv,offset) => [dv.getInt8(offset, true), 1], + REAL: (dv,offset) => [dv.getFloat32(offset, true), 4], STRING: (dv, offset) => { size = dv.getInt8(offset); return [ diff -r 2263f2ecf9bb -r 81758c94f3df svghmi/svghmi.py --- a/svghmi/svghmi.py Tue Oct 20 00:24:49 2020 +0200 +++ b/svghmi/svghmi.py Thu Oct 22 22:44:29 2020 +0200 @@ -35,7 +35,8 @@ "HMI_NODE":{}, "HMI_STRING":{}, "HMI_INT":{}, - "HMI_BOOL":{} + "HMI_BOOL":{}, + "HMI_REAL":{} } HMI_TYPES = HMI_TYPES_DESC.keys() diff -r 2263f2ecf9bb -r 81758c94f3df tests/svghmi/plc.xml --- a/tests/svghmi/plc.xml Tue Oct 20 00:24:49 2020 +0200 +++ b/tests/svghmi/plc.xml Thu Oct 22 22:44:29 2020 +0200 @@ -1,7 +1,7 @@ - + @@ -279,6 +279,11 @@ + + + + + @@ -659,6 +664,90 @@ 0 + + + + + + + + + + + + floating + + + + + + + Sloth + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + REAL#100.0 + + + + + + + + + + + + + + + + + + + + + + + diff -r 2263f2ecf9bb -r 81758c94f3df tests/svghmi/svghmi_0@svghmi/svghmi.svg --- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Tue Oct 20 00:24:49 2020 +0200 +++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Thu Oct 22 22:44:29 2020 +0200 @@ -16,7 +16,7 @@ version="1.1" id="hmi0" sodipodi:docname="svghmi.svg" - inkscape:version="0.92.5 (0.92.5+68)"> + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"> @@ -200,13 +200,13 @@ inkscape:current-layer="hmi0" showgrid="false" units="px" - inkscape:zoom="2.1826317" - inkscape:cx="-408.38959" - inkscape:cy="176.28106" - inkscape:window-width="1863" - inkscape:window-height="1176" - inkscape:window-x="57" - inkscape:window-y="24" + inkscape:zoom="0.38583842" + inkscape:cx="-56.535477" + inkscape:cy="77.476632" + inkscape:window-width="1920" + inkscape:window-height="1043" + inkscape:window-x="0" + inkscape:window-y="0" inkscape:window-maximized="1" showguides="true" inkscape:guide-bbox="true" /> @@ -6088,4 +6088,16 @@ style="text-align:center;text-anchor:middle;fill:#ff6600;stroke-width:0.99999994px">Alarms + 8888