--- a/exemples/svghmi_jumps/svghmi_0@svghmi/svghmi.svg Sun Jan 05 23:12:53 2025 +0100
+++ b/exemples/svghmi_jumps/svghmi_0@svghmi/svghmi.svg Thu Jan 09 18:05:45 2025 +0100
@@ -45,12 +45,12 @@
- inkscape:cx="626.58683"
- inkscape:cy="1233.5329"
+ inkscape:cx="3312.0958" + inkscape:cy="360.71856" inkscape:window-maximized="1"
- inkscape:current-layer="g845"
+ inkscape:current-layer="g2763" inkscape:guide-bbox="true"
@@ -656,6 +656,16 @@
+ 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:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3.628;stroke-linecap:round;stroke-linejoin:miter;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" + inkscape:label="active" /> @@ -663,7 +673,8 @@
- 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77952766;stroke-linecap:round;stroke-linejoin:miter;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" />
+ 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77953;stroke-linecap:round;stroke-linejoin:miter;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" + inkscape:label="inactive" /> @@ -679,14 +690,25 @@
- 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77952766;stroke-linecap:round;stroke-linejoin:miter;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"
+ 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:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3.628;stroke-linecap:round;stroke-linejoin:miter;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" + inkscape:label="active" /> + 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77953;stroke-linecap:round;stroke-linejoin:miter;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"
+ inkscape:label="inactive" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -702,6 +724,16 @@
+ 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:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3.628;stroke-linecap:round;stroke-linejoin:miter;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" + inkscape:label="active" /> @@ -709,7 +741,8 @@
- 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77952766;stroke-linecap:round;stroke-linejoin:miter;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" />
+ 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77953;stroke-linecap:round;stroke-linejoin:miter;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" + inkscape:label="inactive" /> @@ -725,14 +758,25 @@
- 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77952766;stroke-linecap:round;stroke-linejoin:miter;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"
+ 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:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3.628;stroke-linecap:round;stroke-linejoin:miter;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" + inkscape:label="active" /> + 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;vector-effect:none;fill:#ffa32a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.77953;stroke-linecap:round;stroke-linejoin:miter;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"
+ inkscape:label="inactive" /> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
--- a/features.py Sun Jan 05 23:12:53 2025 +0100
+++ b/features.py Thu Jan 09 18:05:45 2025 +0100
@@ -12,7 +12,8 @@
('Native', 'NativeLib.NativeLibrary', True),
('Python', 'py_ext.PythonLibrary', True),
# FIXME ('Etherlab', 'etherlab.EthercatMaster.EtherlabLibrary', False),
- ('SVGHMI', 'svghmi.SVGHMILibrary', 'svghmi')]
+ ('SVGHMI', 'svghmi.SVGHMILibrary', 'svghmi'), + ('MQTT', 'mqtt.MQTTLibrary', False)] ('mqtt', _('MQTT client'), _('Map MQTT topics as located variables'), 'mqtt.MQTTClient'),
--- a/images/icons.svg Sun Jan 05 23:12:53 2025 +0100
+++ b/images/icons.svg Thu Jan 09 18:05:45 2025 +0100
@@ -42,14 +42,14 @@
inkscape:zoom="11.313708"
- inkscape:cy="207.40326"
+ inkscape:cx="1247.3364" + inkscape:cy="197.94571" inkscape:current-layer="svg2"
inkscape:guide-bbox="true"
inkscape:window-maximized="1"
inkscape:measure-start="904.956,703.964"
@@ -88341,6 +88341,232 @@
d="m 566.50059,73.36489 c -3.21171,0 -6.18403,1.71679 -7.78988,4.49822 -0.54331,0.94101 -0.88738,1.959 -1.06307,2.99881 h -6.14112 c -2.02768,-0.0286 -2.02768,3.0275 0,2.99882 h 6.14112 c 0.17569,1.03979 0.51976,2.05778 1.06307,2.99881 1.60585,2.78143 4.57817,4.49822 7.78988,4.49822 0.82807,-9e-5 1.49932,-0.67134 1.49941,-1.4994 v -1.49941 h 4.49822 c 2.02743,0.02842 2.02743,-3.027239 0,-2.99882 H 568 v -5.99762 h 4.49822 c 2.02743,0.02842 2.02743,-3.027239 0,-2.99882 H 568 v -1.49941 c -9e-5,-0.82806 -0.67134,-1.49931 -1.49941,-1.4994 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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;vector-effect:none;fill-opacity:1;fill-rule:nonzero;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
+ inkscape:collect="always" + xlink:href="#linearGradient2447-4" + id="linearGradient17971-3" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.04239823,0,0,0.00991741,-845.33196,211.34544)" + inkscape:collect="always" + xlink:href="#linearGradient28187-2" + id="radialGradient17973-56" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-0.01451008,0,0,0.00991741,-831.50006,211.34544)" + inkscape:collect="always" + xlink:href="#linearGradient28187-2" + id="radialGradient17975-2" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.01451008,0,0,0.00991741,-828.51591,211.34544)" + inkscape:collect="always" + xlink:href="#linearGradient2435-0" + id="linearGradient17977-7" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.58493109,0,0,0.57567037,-844.0462,187.63732)" + inkscape:collect="always" + xlink:href="#linearGradient2438-2" + id="linearGradient17979-0" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.47232114,0,0,0.53873584,-809.29599,186.99575)" + inkscape:collect="always" + xlink:href="#radialGradient2432-8" + id="radialGradient17981-61" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.20497637,0,0,-0.22967565,-843.12666,217.0488)" + id="radialGradient2432-8" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.17021,0,0,-0.19072,274.84858,216.03233)" + style="stop-color:#b7b8b9" + style="stop-color:#ececec" + style="stop-color:#fafafa;stop-opacity:0" + style="stop-color:#fff;stop-opacity:0" + style="stop-color:#fafafa;stop-opacity:0" + style="stop-color:#ebecec;stop-opacity:0" + style="stop-color:#e1e2e3;stop-opacity:0" + inkscape:collect="always" + xlink:href="#linearGradient2429-7" + id="linearGradient17983-5" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.5473824,0,0,0.56012342,-843.14533,188.89357)" + inkscape:collect="always" + xlink:href="#linearGradient2425-2" + id="linearGradient17985-2" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.5754536,0,0,0.66532721,-844.01077,188.39578)" + id="radialGradient2432-6" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.17021,0,0,-0.19072,274.84858,216.03233)" + style="stop-color:#b7b8b9" + style="stop-color:#ececec" + style="stop-color:#fafafa;stop-opacity:0" + style="stop-color:#fff;stop-opacity:0" + style="stop-color:#fafafa;stop-opacity:0" + style="stop-color:#ebecec;stop-opacity:0" + style="stop-color:#e1e2e3;stop-opacity:0" + inkscape:collect="always" + xlink:href="#linearGradient2447-4" + id="linearGradient43533" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.04239823,0,0,0.00991741,-917.58729,211.34544)" + inkscape:collect="always" + xlink:href="#linearGradient28187-2" + id="radialGradient43535" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-0.01451008,0,0,0.00991741,-903.75539,211.34544)" + inkscape:collect="always" + xlink:href="#linearGradient28187-2" + id="radialGradient43537" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.01451008,0,0,0.00991741,-900.77124,211.34544)" + inkscape:collect="always" + xlink:href="#linearGradient2435-0" + id="linearGradient43539" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.58493109,0,0,0.57567037,-916.30153,187.63732)" + inkscape:collect="always" + xlink:href="#linearGradient2438-2" + id="linearGradient43541" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.47232114,0,0,0.53873584,-881.55132,186.99575)" + inkscape:collect="always" + xlink:href="#radialGradient2432-8" + id="radialGradient43543" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.20497637,0,0,-0.22967565,-915.38199,217.0488)" + inkscape:collect="always" + xlink:href="#linearGradient2429-7" + id="linearGradient43545" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.5473824,0,0,0.56012342,-915.40066,188.89357)" + inkscape:collect="always" + xlink:href="#linearGradient2425-2" + id="linearGradient43547" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.5754536,0,0,0.66532721,-916.2661,188.39578)" @@ -88524,7 +88750,7 @@
- style="font-size:12.761px;line-height:1.25">%% Build Clean editPLC HMIEditor ImportFile ManageFolder ImportSVG NetworkEdit ShowMaster ExportSlave Run ShowIECcode Stop EditSVG OpenPOT EditPO AddFont DelFont %%</tspan></text>
+ style="font-size:12.761px;line-height:1.25">%% Build Clean editPLC HMIEditor ImportFile ManageFolder ImportSVG NetworkEdit ShowMaster ExportSlave Run ShowIECcode Stop EditSVG OpenPOT EditPO AddFont DelFont AddFile DelFile %%</tspan></text> style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
@@ -90515,9 +90741,9 @@
- style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" /> - style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" @@ -90529,9 +90755,9 @@
- style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" /> - style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" @@ -90543,9 +90769,9 @@
- style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" /> - style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" @@ -90557,16 +90783,16 @@
- style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" /> - style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" /> - style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" @@ -90578,9 +90804,9 @@
- style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" /> - style="fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="display:inline;overflow:visible;visibility:visible;fill:#4fadf7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;enable-background:accumulate" @@ -92895,87 +93121,130 @@
transform="matrix(0.53388959,0,0,0.53388959,296.50976,221.2112)"
- transform="translate(1334.3348,-308.68253)"
+ style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate" /> + transform="translate(0.0556,-0.06105)">
- style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate" />
+ style="opacity:0.15;fill:url(#linearGradient17971)" + d="m 277.24218,214.31533 v 1.9999 c -0.6205,0.004 -1.5,-0.448 -1.5,-1 0,-0.552 0.6924,-1 1.5,-1 z" + style="opacity:0.15;fill:url(#radialGradient17973)" + inkscape:connector-curvature="0" /> + d="m 294.24218,214.31533 v 1.9999 c 0.62047,0.004 1.5,-0.44807 1.5,-1.0001 0,-0.552 -0.6924,-0.99982 -1.5,-0.99982 z" + style="opacity:0.15;fill:url(#radialGradient17975)" + inkscape:connector-curvature="0" /> + d="m 277.24218,192.81529 h 11.5 c 0.683,0.2373 4.541,3.1281 5.5,5 0,5.7292 4e-5,11.271 4e-5,17 h -17 v -22 z" + style="display:inline;fill:url(#linearGradient17977);stroke:url(#linearGradient17979);stroke-width:0.99992;stroke-linejoin:round" + inkscape:connector-curvature="0" /> + d="m 277.91238,214.31533 c -0.0938,0 -0.1702,-0.086 -0.1702,-0.191 v -20.598 c 0,-0.105 0.0764,-0.1905 0.1702,-0.1905 3.5215,0.0527 7.4238,-0.0788 10.941,0.0131 l 4.839,4.3272 0.05,16.448 c 0,0.105 -0.076,0.191 -0.17,0.191 h -15.66 z" + style="fill:url(#radialGradient17981)" + inkscape:connector-curvature="0" /> + d="m 293.24218,197.99233 v 15.823 h -15 v -20 h 10.394" + style="opacity:0.6;fill:none;stroke:url(#linearGradient17983)" + inkscape:connector-curvature="0" /> + d="m 287.81718,193.31533 c 1.1563,0.32877 0.33906,4.6144 0.33906,4.6144 0,0 4.5154,-0.42774 5.6077,1.195 1.489,2.2122 -0.068,-0.6352 -0.173,-0.8217 -0.756,-1.3401 -3.867,-4.5471 -5.046,-4.9412 -0.088,-0.0295 -0.283,-0.0465 -0.728,-0.0465 z" + style="opacity:0.2;fill-rule:evenodd" + inkscape:connector-curvature="0" /> + d="m 287.74218,193.31533 c 1.5262,0 1,4 1,4 0,0 4.9921,-0.45326 4.9921,2 0,-0.59774 0.0557,-1.4784 -0.0641,-1.6559 -0.839,-1.243 -3.744,-3.8619 -4.798,-4.2976 -0.086,-0.0356 -0.686,-0.0465 -1.13,-0.0465 z" + style="fill:url(#linearGradient17985);fill-rule:evenodd" + inkscape:connector-curvature="0" /> + transform="matrix(0.08604141,0,0,0.08604141,274.401,193.46035)"
- transform="translate(-1334.2792,308.62148)">
- style="opacity:0.15;fill:url(#linearGradient17971)"
- d="m 277.24218,214.31533 v 1.9999 c -0.6205,0.004 -1.5,-0.448 -1.5,-1 0,-0.552 0.6924,-1 1.5,-1 z"
- style="opacity:0.15;fill:url(#radialGradient17973)"
- inkscape:connector-curvature="0" />
- d="m 294.24218,214.31533 v 1.9999 c 0.62047,0.004 1.5,-0.44807 1.5,-1.0001 0,-0.552 -0.6924,-0.99982 -1.5,-0.99982 z"
- style="opacity:0.15;fill:url(#radialGradient17975)"
- inkscape:connector-curvature="0" />
- d="m 277.24218,192.81529 h 11.5 c 0.683,0.2373 4.541,3.1281 5.5,5 0,5.7292 4e-5,11.271 4e-5,17 h -17 v -22 z"
- style="display:inline;fill:url(#linearGradient17977);stroke:url(#linearGradient17979);stroke-width:0.99992001;stroke-linejoin:round"
- inkscape:connector-curvature="0" />
- d="m 277.91238,214.31533 c -0.0938,0 -0.1702,-0.086 -0.1702,-0.191 v -20.598 c 0,-0.105 0.0764,-0.1905 0.1702,-0.1905 3.5215,0.0527 7.4238,-0.0788 10.941,0.0131 l 4.839,4.3272 0.05,16.448 c 0,0.105 -0.076,0.191 -0.17,0.191 h -15.66 z"
- style="fill:url(#radialGradient17981)"
- inkscape:connector-curvature="0" />
- d="m 293.24218,197.99233 v 15.823 h -15 v -20 h 10.394"
- style="opacity:0.6;fill:none;stroke:url(#linearGradient17983)"
- inkscape:connector-curvature="0" />
- d="m 287.81718,193.31533 c 1.1563,0.32877 0.33906,4.6144 0.33906,4.6144 0,0 4.5154,-0.42774 5.6077,1.195 1.489,2.2122 -0.068,-0.6352 -0.173,-0.8217 -0.756,-1.3401 -3.867,-4.5471 -5.046,-4.9412 -0.088,-0.0295 -0.283,-0.0465 -0.728,-0.0465 z"
- style="opacity:0.2;fill-rule:evenodd"
- inkscape:connector-curvature="0" />
- d="m 287.74218,193.31533 c 1.5262,0 1,4 1,4 0,0 4.9921,-0.45326 4.9921,2 0,-0.59774 0.0557,-1.4784 -0.0641,-1.6559 -0.839,-1.243 -3.744,-3.8619 -4.798,-4.2976 -0.086,-0.0356 -0.686,-0.0465 -1.13,-0.0465 z"
- style="fill:url(#linearGradient17985);fill-rule:evenodd"
+ transform="matrix(5.0027792,0,0,5.0027792,-215.17835,-168.84627)" + transform="matrix(0.3316761,0,0,0.3316761,48.927852,9.2318583)" + style="fill:#84c225;fill-rule:evenodd;stroke:#5d9d35;stroke-width:2.8222" /> + d="m 84.515333,38.943636 v 3.981494 h 3.981494 v 4.799639 h -3.981494 v 3.981494 H 79.732961 V 47.724769 H 75.751467 V 42.92513 h 3.981494 v -3.981494 h 4.782372" + style="font-style:normal;font-weight:normal;font-size:12px;font-family:'Bitstream Vera Sans';display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none" + inkscape:connector-curvature="0" /> + d="m 82.190677,35.644078 c 5.025924,0 9.194867,3.673581 9.969229,8.481465 -6.921917,-5.82623 -17.958314,0.09291 -16.467662,9.346307 -2.201037,-1.852678 -3.600446,-4.62745 -3.600446,-7.728889 0,-5.576508 4.522377,-10.098883 10.098879,-10.098883 z" + style="fill:url(#linearGradient16528-1);fill-opacity:1;fill-rule:evenodd" inkscape:connector-curvature="0" />
- transform="matrix(0.08604141,0,0,0.08604141,-1059.9338,502.14288)"
- transform="matrix(5.0027792,0,0,5.0027792,-215.17835,-168.84627)"
- transform="matrix(0.3316761,0,0,0.3316761,48.927852,9.2318583)"
- style="fill:#84c225;fill-rule:evenodd;stroke:#5d9d35;stroke-width:2.82220006" />
- d="m 84.515333,38.943636 v 3.981494 h 3.981494 v 4.799639 h -3.981494 v 3.981494 H 79.732961 V 47.724769 H 75.751467 V 42.92513 h 3.981494 v -3.981494 h 4.782372"
- style="font-style:normal;font-weight:normal;font-size:12px;font-family:'Bitstream Vera Sans';display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none"
- inkscape:connector-curvature="0" />
- d="m 82.190677,35.644078 c 5.025924,0 9.194867,3.673581 9.969229,8.481465 -6.921917,-5.82623 -17.958314,0.09291 -16.467662,9.346307 -2.201037,-1.852678 -3.600446,-4.62745 -3.600446,-7.728889 0,-5.576508 4.522377,-10.098883 10.098879,-10.098883 z"
- style="fill:url(#linearGradient16528-1);fill-opacity:1;fill-rule:evenodd"
- inkscape:connector-curvature="0" />
+ transform="matrix(0.83038841,0,0,0.83038841,975.02677,35.736476)" + style="stroke-width:1.20426"> + style="opacity:0.15;fill:url(#linearGradient17971-3);stroke-width:1.20426" + d="m 277.24218,214.31533 v 1.9999 c -0.6205,0.004 -1.5,-0.448 -1.5,-1 0,-0.552 0.6924,-1 1.5,-1 z" + style="opacity:0.15;fill:url(#radialGradient17973-56);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 294.24218,214.31533 v 1.9999 c 0.62047,0.004 1.5,-0.44807 1.5,-1.0001 0,-0.552 -0.6924,-0.99982 -1.5,-0.99982 z" + style="opacity:0.15;fill:url(#radialGradient17975-2);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 277.24218,192.81529 h 11.5 c 0.683,0.2373 4.541,3.1281 5.5,5 0,5.7292 4e-5,11.271 4e-5,17 h -17 v -22 z" + style="display:inline;fill:url(#linearGradient17977-7);stroke:url(#linearGradient17979-0);stroke-width:1.20416;stroke-linejoin:round" + inkscape:connector-curvature="0" /> + d="m 277.91238,214.31533 c -0.0938,0 -0.1702,-0.086 -0.1702,-0.191 v -20.598 c 0,-0.105 0.0764,-0.1905 0.1702,-0.1905 3.5215,0.0527 7.4238,-0.0788 10.941,0.0131 l 4.839,4.3272 0.05,16.448 c 0,0.105 -0.076,0.191 -0.17,0.191 h -15.66 z" + style="fill:url(#radialGradient17981-61);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 293.24218,197.99233 v 15.823 h -15 v -20 h 10.394" + style="opacity:0.6;fill:none;stroke:url(#linearGradient17983-5);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 287.81718,193.31533 c 1.1563,0.32877 0.33906,4.6144 0.33906,4.6144 0,0 4.5154,-0.42774 5.6077,1.195 1.489,2.2122 -0.068,-0.6352 -0.173,-0.8217 -0.756,-1.3401 -3.867,-4.5471 -5.046,-4.9412 -0.088,-0.0295 -0.283,-0.0465 -0.728,-0.0465 z" + style="opacity:0.2;fill-rule:evenodd;stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 287.74218,193.31533 c 1.5262,0 1,4 1,4 0,0 4.9921,-0.45326 4.9921,2 0,-0.59774 0.0557,-1.4784 -0.0641,-1.6559 -0.839,-1.243 -3.744,-3.8619 -4.798,-4.2976 -0.086,-0.0356 -0.686,-0.0465 -1.13,-0.0465 z" + style="fill:url(#linearGradient17985-2);fill-rule:evenodd;stroke-width:1.20426" + inkscape:connector-curvature="0" /> @@ -95098,7 +95367,7 @@
style="font-style:normal;font-weight:normal;font-size:10px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#00ff00;fill-opacity:1;stroke:none;stroke-width:1"
- d="m 1104,192.36218 v 3 h 3 v 1 h -3 v 3 h -1 v -3 l -2.9971,9.8e-4 -0,-1.00098 h 3 v -3 z"
+ d="m 1104,192.36218 v 3 h 3 v 1 h -3 v 3 h -1 v -3 l -2.9971,9.8e-4 v -1.00098 h 3 v -3 z" style="fill:#00ff00;fill-opacity:1;stroke-width:1"
inkscape:connector-curvature="0"
@@ -95114,18 +95383,12 @@
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15.39169598px;line-height:1.25;font-family:MathJax_Script;-inkscape-font-specification:MathJax_Script;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.99999994"
inkscape:connector-curvature="0" />
+ inkscape:connector-curvature="0" style="font-style:normal;font-weight:normal;font-size:10px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#fe0000;fill-opacity:1;stroke:none;stroke-width:1"
- transform="translate(60)">
- inkscape:connector-curvature="0"
- style="fill:#fe0000;fill-opacity:1;stroke-width:1"
- d="m 1106,195.36218 v 1 h -6 v -1 z"
- sodipodi:nodetypes="ccccc" />
+ d="m 1166,195.36218 v 1 h -6 v -1 z" + sodipodi:nodetypes="ccccc" /> transform="rotate(45,111.50001,200.12138)">
@@ -95171,4 +95434,192 @@
d="m 615.63605,136.99738 a 8.9999978,8.9999978 0 0 0 0,12.7279 8.9999978,8.9999978 0 0 0 12.7279,0 8.9999978,8.9999978 0 0 0 0,-12.7279 8.9999978,8.9999978 0 0 0 -12.7279,0 z m 1.59098,1.59098 a 6.7499981,6.7499981 0 0 1 8.68207,-0.72921 l -9.40608,9.40612 a 6.7499981,6.7499981 0 0 1 0.72401,-8.67691 z m 0.8618,10.27309 9.40609,-9.40612 a 6.7499981,6.7499981 0 0 1 -0.72195,8.67897 6.7499981,6.7499981 0 0 1 -8.68414,0.72715 z"
inkscape:connector-curvature="0" />
+ inkscape:label="AddFile" + style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate" /> + style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;enable-background:accumulate" + inkscape:label="DelFile" /> + inkscape:connector-curvature="0" + style="font-style:normal;font-weight:normal;font-size:10px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#fe0000;fill-opacity:1;stroke:none;stroke-width:1" + d="m 1286,195.36218 v 1 h -6 v -1 z" + sodipodi:nodetypes="ccccc" /> + style="font-style:normal;font-weight:normal;font-size:10px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#00ff00;fill-opacity:1;stroke:none;stroke-width:1" + transform="translate(120)"> + d="m 1104,192.36218 v 3 h 3 v 1 h -3 v 3 h -1 v -3 l -2.9971,9.8e-4 v -1.00098 h 3 v -3 z" + style="fill:#00ff00;fill-opacity:1;stroke-width:1" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccccccccc" /> + transform="matrix(0.83038841,0,0,0.83038841,1035.0268,35.736476)" + style="stroke-width:1.20426"> + style="opacity:0.15;fill:url(#linearGradient43533);stroke-width:1.20426" + d="m 277.24218,214.31533 v 1.9999 c -0.6205,0.004 -1.5,-0.448 -1.5,-1 0,-0.552 0.6924,-1 1.5,-1 z" + style="opacity:0.15;fill:url(#radialGradient43535);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 294.24218,214.31533 v 1.9999 c 0.62047,0.004 1.5,-0.44807 1.5,-1.0001 0,-0.552 -0.6924,-0.99982 -1.5,-0.99982 z" + style="opacity:0.15;fill:url(#radialGradient43537);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 277.24218,192.81529 h 11.5 c 0.683,0.2373 4.541,3.1281 5.5,5 0,5.7292 4e-5,11.271 4e-5,17 h -17 v -22 z" + style="display:inline;fill:url(#linearGradient43539);stroke:url(#linearGradient43541);stroke-width:1.20416;stroke-linejoin:round" + inkscape:connector-curvature="0" /> + d="m 277.91238,214.31533 c -0.0938,0 -0.1702,-0.086 -0.1702,-0.191 v -20.598 c 0,-0.105 0.0764,-0.1905 0.1702,-0.1905 3.5215,0.0527 7.4238,-0.0788 10.941,0.0131 l 4.839,4.3272 0.05,16.448 c 0,0.105 -0.076,0.191 -0.17,0.191 h -15.66 z" + style="fill:url(#radialGradient43543);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 293.24218,197.99233 v 15.823 h -15 v -20 h 10.394" + style="opacity:0.6;fill:none;stroke:url(#linearGradient43545);stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 287.81718,193.31533 c 1.1563,0.32877 0.33906,4.6144 0.33906,4.6144 0,0 4.5154,-0.42774 5.6077,1.195 1.489,2.2122 -0.068,-0.6352 -0.173,-0.8217 -0.756,-1.3401 -3.867,-4.5471 -5.046,-4.9412 -0.088,-0.0295 -0.283,-0.0465 -0.728,-0.0465 z" + style="opacity:0.2;fill-rule:evenodd;stroke-width:1.20426" + inkscape:connector-curvature="0" /> + d="m 287.74218,193.31533 c 1.5262,0 1,4 1,4 0,0 4.9921,-0.45326 4.9921,2 0,-0.59774 0.0557,-1.4784 -0.0641,-1.6559 -0.839,-1.243 -3.744,-3.8619 -4.798,-4.2976 -0.086,-0.0356 -0.686,-0.0465 -1.13,-0.0465 z" + style="fill:url(#linearGradient43547);fill-rule:evenodd;stroke-width:1.20426" + inkscape:connector-curvature="0" /> + transform="matrix(0.89197136,0,0,0.62499897,131.25613,79.500217)" + style="opacity:1;stroke-width:1.33932" /> + style="color:#000000;overflow:visible;opacity:1;fill:#90e4ff;fill-opacity:1;stroke:none;stroke-width:3.77953;stroke-linecap:round" + style="color:#000000;overflow:visible;opacity:1;fill:#8bbe99;fill-opacity:1;stroke:none;stroke-width:5.06201;stroke-linecap:round" + inkscape:flatsided="true" + sodipodi:cx="1208.8774" + sodipodi:cy="210.19722" + sodipodi:r1="3.6055512" + sodipodi:r2="1.8027756" + sodipodi:arg1="0.52359878" + sodipodi:arg2="1.5707963" + inkscape:randomized="0" + d="m 1211.9999,212 -6.245,0 3.1225,-5.40833 z" + inkscape:transform-center-y="-0.35546995" + transform="matrix(0.89197136,0,0,0.62499897,131.25613,79.500217)" /> + style="color:#000000;overflow:visible;opacity:1;fill:#8bbe99;fill-opacity:1;stroke:none;stroke-width:3.42213;stroke-linecap:round" + inkscape:flatsided="true" + sodipodi:cx="1213.8774" + sodipodi:cy="210.19722" + sodipodi:r1="3.6055512" + sodipodi:r2="1.8027756" + sodipodi:arg1="0.52359878" + sodipodi:arg2="1.5707963" + inkscape:randomized="0" + d="m 1216.9999,212 -6.245,0 3.1225,-5.40833 z" + inkscape:transform-center-y="-0.52581525" + transform="matrix(1.3194045,0,0,0.92449879,-387.59533,16.006253)" + inkscape:transform-center-x="4.3143207e-05" /> + style="color:#000000;overflow:visible;opacity:1;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:3.77953;stroke-linecap:round" + transform="translate(60)"> + style="color:#000000;overflow:visible;opacity:1;fill:#90e4ff;fill-opacity:1;stroke:none;stroke-width:3.77953;stroke-linecap:round" + style="color:#000000;overflow:visible;opacity:1;fill:#8bbe99;fill-opacity:1;stroke:none;stroke-width:5.06201;stroke-linecap:round" + inkscape:flatsided="true" + sodipodi:cx="1208.8774" + sodipodi:cy="210.19722" + sodipodi:r1="3.6055512" + sodipodi:r2="1.8027756" + sodipodi:arg1="0.52359878" + sodipodi:arg2="1.5707963" + inkscape:randomized="0" + d="m 1211.9999,212 -6.245,0 3.1225,-5.40833 z" + inkscape:transform-center-y="-0.35546995" + transform="matrix(0.89197136,0,0,0.62499897,131.25613,79.500217)" /> + style="color:#000000;overflow:visible;opacity:1;fill:#8bbe99;fill-opacity:1;stroke:none;stroke-width:3.42213;stroke-linecap:round" + inkscape:flatsided="true" + sodipodi:cx="1213.8774" + sodipodi:cy="210.19722" + sodipodi:r1="3.6055512" + sodipodi:r2="1.8027756" + sodipodi:arg1="0.52359878" + sodipodi:arg2="1.5707963" + inkscape:randomized="0" + d="m 1216.9999,212 -6.245,0 3.1225,-5.40833 z" + inkscape:transform-center-y="-0.52581525" + transform="matrix(1.3194045,0,0,0.92449879,-387.59533,16.006253)" + inkscape:transform-center-x="4.3143207e-05" /> + style="color:#000000;overflow:visible;opacity:1;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:3.77953;stroke-linecap:round" --- a/mqtt/mqtt_client_gen.py Sun Jan 05 23:12:53 2025 +0100
+++ b/mqtt/mqtt_client_gen.py Thu Jan 09 18:05:45 2025 +0100
@@ -356,7 +356,7 @@
writer.writerow([direction] + row)
- def GenerateC(self, path, locstr, config, datatype_info_getter):
+ def GenerateC(self, name, path, locstr, config, datatype_info_getter): c_template_filepath = paths.AbsNeighbourFile(__file__, "mqtt_template.c")
c_template_file = open(c_template_filepath , 'rb')
c_template = c_template_file.read()
@@ -365,6 +365,7 @@
clientID = config["clientID"],
@@ -476,7 +477,8 @@
if item_datatype not in MQTT_JSON_SUPPORTED_types and\
item_datatype not in MQTT_UNSUPPORTED_types:
recurseJsonTypes(item_datatype)
- def typeCategory(iec_type):
+ def typeCategory(field_iec_type): if field_iec_type in arrays:
elif field_iec_type in structures:
--- a/mqtt/mqtt_template.c Sun Jan 05 23:12:53 2025 +0100
+++ b/mqtt/mqtt_template.c Thu Jan 09 18:05:45 2025 +0100
@@ -30,7 +30,7 @@
// MQTTCLIENT_TRACE_PROTOCOL, MQTTCLIENT_TRACE_MAXIMUM, MQTTCLIENT_TRACE_ERROR
#define MQTT_DEBUG_LEVEL MQTTCLIENT_TRACE_ERROR
-void trace_callback(enum MQTTCLIENT_TRACE_LEVELS level, char* message)
+static void trace_callback(enum MQTTCLIENT_TRACE_LEVELS level, char* message) if(level >= MQTT_DEBUG_LEVEL)
@@ -148,7 +148,7 @@
#define DECL_JSON_INPUT(C_type, c_loc_name) \
-int json_parse_##c_loc_name(char *json, const int len, void *void_ptr) {{ \
+static int json_parse_##c_loc_name(char *json, const int len, void *void_ptr) {{ \ C_type *struct_ptr = (C_type *)void_ptr; \
return json_scanf(json, len, "{{" TYPE_##C_type(scanf_fmt,) "}}", TYPE_##C_type(scanf_args, struct_ptr)); \
@@ -159,7 +159,7 @@
static int json_out_len = 0;
#define DECL_JSON_OUTPUT(C_type, c_loc_name) \
-int json_gen_##c_loc_name(C_type *struct_ptr) {{ \
+static int json_gen_##c_loc_name(C_type *struct_ptr) {{ \ struct json_out out = JSON_OUT_BUF(json_out_buf, json_out_size); \
json_out_len = json_printf(&out, "{{" TYPE_##C_type(printf_fmt,) "}}", TYPE_##C_type(printf_args, struct_ptr)); \
if(json_out_len > json_out_size){{ \
@@ -247,7 +247,7 @@
MQTTClient_destroy(&client);
-void connectionLost(void* context, char* reason)
+static void connectionLost(void* context, char* reason) LogWarning("ConnectionLost, reconnecting\\n");
@@ -260,8 +260,10 @@
+typedef int(*callback_fptr_t)(char* topic, char* data, uint32_t datalen); +static callback_fptr_t __mqtt_python_callback_fptr_{name} = NULL; -int messageArrived(void *context, char *topicName, int topicLen, MQTTClient_message *message)
+static int messageArrived(void *context, char *topicName, int topicLen, MQTTClient_message *message) int size = sizeof(topics) / sizeof(topics[0]);
@@ -307,7 +309,15 @@
// If we reach here, then the element was not present
- LogWarning("MQTT unknown topic: %s\n", topicName);
+ if(__mqtt_python_callback_fptr_{name} && + (*__mqtt_python_callback_fptr_{name})(topicName, + (char*)message->payload, + message->payloadlen) == 0){{ + // Topic was handled in python + LogWarning("MQTT unknown topic: %s\n", topicName); @@ -357,19 +367,19 @@
#define _SUBSCRIBE(Topic, QoS) \
- MQTTResponse response = MQTTClient_subscribe5(client, #Topic, QoS, NULL, NULL); \
+ MQTTResponse response = MQTTClient_subscribe5(client, Topic, QoS, NULL, NULL); \ /* when using MQTT5 responce code is 1 for some reason even if no error */ \
rc = response.reasonCode == 1 ? MQTTCLIENT_SUCCESS : response.reasonCode; \
MQTTResponse_free(response);
#define _SUBSCRIBE(Topic, QoS) \
- rc = MQTTClient_subscribe(client, #Topic, QoS);
+ rc = MQTTClient_subscribe(client, Topic, QoS); #define INIT_SUBSCRIPTION(Topic, QoS) \
- _SUBSCRIBE(Topic, QoS) \
+ _SUBSCRIBE(#Topic, QoS) \ if (rc != MQTTCLIENT_SUCCESS) \
LogError("MQTT client failed to subscribe to '%s', return code %d\n", #Topic, rc); \
@@ -379,18 +389,18 @@
#define _PUBLISH(Topic, QoS, cstring_size, cstring_ptr, Retained) \
- MQTTResponse response = MQTTClient_publish5(client, #Topic, cstring_size, \
+ MQTTResponse response = MQTTClient_publish5(client, Topic, cstring_size, \ cstring_ptr, QoS, Retained, NULL, NULL); \
rc = response.reasonCode; \
MQTTResponse_free(response);
#define _PUBLISH(Topic, QoS, cstring_size, cstring_ptr, Retained) \
- rc = MQTTClient_publish(client, #Topic, cstring_size, \
+ rc = MQTTClient_publish(client, Topic, cstring_size, \ cstring_ptr, QoS, Retained, NULL);
#define PUBLISH_SIMPLE(Topic, QoS, C_type, c_loc_name, Retained) \
- _PUBLISH(Topic, QoS, sizeof(C_type), &MQTT_##c_loc_name##_buf, Retained)
+ _PUBLISH(#Topic, QoS, sizeof(C_type), &MQTT_##c_loc_name##_buf, Retained) #define PUBLISH_JSON(Topic, QoS, C_type, c_loc_name, Retained) \
int res = json_gen_##c_loc_name(&MQTT_##c_loc_name##_buf); \
@@ -589,3 +599,39 @@
+int __mqtt_python_publish_{name}(char* topic, char* data, uint32_t datalen, uint8_t QoS, uint8_t Retained) + if((rc = pthread_mutex_lock(&MQTT_thread_wakeup_mutex)) == 0){{ + _PUBLISH(topic, QoS, datalen, data, Retained) + pthread_mutex_unlock(&MQTT_thread_wakeup_mutex); + if (rc != MQTTCLIENT_SUCCESS){{ + LogError("MQTT python can't publish \"%s\", return code %d\n", topic, rc); + LogError("MQTT python can't obtain lock, return code %d\n", rc); +int __mqtt_python_subscribe_{name}(char* topic, uint8_t QoS) + if (rc != MQTTCLIENT_SUCCESS) + LogError("MQTT client failed to subscribe to '%s', return code %d\n", topic, rc); +int __mqtt_python_callback_setter_{name}(callback_fptr_t cb) + __mqtt_python_callback_fptr_{name} = cb; --- a/runtime/PLCObject.py Sun Jan 05 23:12:53 2025 +0100
+++ b/runtime/PLCObject.py Thu Jan 09 18:05:45 2025 +0100
@@ -591,46 +591,59 @@
return getPSKID(partial(self.LogMessage, 0))
+ self.blobs = {} # dict of list if os.path.exists(self.tmpdir):
shutil.rmtree(self.tmpdir)
+ def _append_blob(self, blob, newBlobID): + self.blobs.setdefault(newBlobID,[]).append(blob) + def _pop_blob(self, blobID): + blobs = self.blobs.pop(blobID, None) + # insert same blob list back if not empty + blobs = self.blobs[blobID] = blobs def SeedBlob(self, seed):
blob = (mkstemp(dir=self.tmpdir) + (hashlib.new('md5'),))
_fd, _path, md5sum = blob
newBlobID = md5sum.digest()
- self.blobs[newBlobID] = blob
+ self._append_blob(blob, newBlobID) def AppendChunkToBlob(self, data, blobID):
- blob = self.blobs.pop(blobID, None)
+ blob = self._pop_blob(blobID) newBlobID = md5sum.digest()
- self.blobs[newBlobID] = blob
+ self._append_blob(blob, newBlobID) - for fd, _path, _md5sum in list(self.blobs.values()):
+ for blobs in list(self.blobs.values()): + for fd, _path, _md5sum in blobs: def BlobAsFile(self, blobID, newpath):
- blob = self.blobs.pop(blobID, None)
+ blob = self._pop_blob(blobID) - _(f"Missing data to create file: {newpath}").decode())
+ _(f"Missing data to create file: {newpath}")) self._BlobAsFile(blob, newpath)
--- a/svghmi/gen_index_xhtml.xslt Sun Jan 05 23:12:53 2025 +0100
+++ b/svghmi/gen_index_xhtml.xslt Thu Jan 09 18:05:45 2025 +0100
@@ -4475,7 +4475,7 @@
<xsl:text>ForEach widget is used to span a small set of widget over a larger set of
- <xsl:text>repeated HMI_NODEs.
+ <xsl:text>repeated HMI_NODEs. @@ -4951,14 +4951,11 @@
- <xsl:text> init: function() {
- <xsl:text> this.animate();
+ <xsl:template xmlns="http://www.w3.org/2000/svg" mode="inline_svg" match="svg:image[starts-with(@inkscape:label, 'HMI:Image')]"> + <xsl:apply-templates mode="inline_svg" select="@*[not(contains(name(), 'href'))] | node()"/> <xsl:template match="widget[@type='Input']" mode="widget_desc">
@@ -4997,12 +4994,6 @@
<xsl:text>InputWidget</xsl:text>
<xsl:text> extends Widget{
- <xsl:text> on_op_click(opstr) {
- <xsl:text> this.change_hmi_value(0, opstr);
<xsl:text> edit_callback(new_val) {
<xsl:text> this.apply_hmi_value(0, new_val);
@@ -5143,6 +5134,58 @@
<xsl:value-of select="@id"/>
+ <xsl:variable name="current_id" select="@id"/> + <xsl:variable name="active" select="$hmi_element/*[@id = $current_id]/*[regexp:test(@inkscape:label,'active')]"/> + <xsl:text> activable_sub_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:for-each select="$active"> + <xsl:value-of select="@inkscape:label"/> + <xsl:text>_elt: id("</xsl:text> + <xsl:value-of select="@id"/> + <xsl:text>")</xsl:text> + <xsl:if test="position()!=last()"> + <xsl:text> on_op_mouse_down_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text>: function(){ + <xsl:text> svg_root.addEventListener("pointerup", this.bound_on_op_mouse_up_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text> set_activity_state(this.activable_sub_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text> on_op_mouse_up_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text>: function(){ + <xsl:text> svg_root.removeEventListener("pointerup", this.bound_on_op_mouse_up_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text> set_activity_state(this.activable_sub_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text> this.change_hmi_value(0, "</xsl:text> + <xsl:value-of select="func:escape_quotes(@inkscape:label)"/> <xsl:text> init: function() {
@@ -5163,9 +5206,15 @@
<xsl:for-each select="$action_elements">
<xsl:text> this.action_elt_</xsl:text>
<xsl:value-of select="position()"/>
- <xsl:text>.onclick = () => this.on_op_click("</xsl:text>
- <xsl:value-of select="func:escape_quotes(@inkscape:label)"/>
+ <xsl:text>.onmousedown = () => this.on_op_mouse_down_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text> this.bound_on_op_mouse_up_</xsl:text> + <xsl:value-of select="position()"/> + <xsl:text> = this.on_op_mouse_up_</xsl:text> + <xsl:value-of select="position()"/> <xsl:if test="$have_value">
@@ -10296,6 +10345,8 @@
<xsl:text> let widget = hmi_widgets[id];
+ <xsl:text> if(widget.curr_value != undefined) return; <xsl:text> widget.do_init();
--- a/svghmi/svghmi.py Sun Jan 05 23:12:53 2025 +0100
+++ b/svghmi/svghmi.py Thu Jan 09 18:05:45 2025 +0100
@@ -399,6 +399,18 @@
"tooltip": _("Remove font previously added to HMI"),
+ "tooltip": _("Add file to be served for HMI"), + "name": _("Delete File"), + "tooltip": _("Remove file previously added to HMI"), def _getSVGpath(self, project_path=None):
@@ -554,6 +566,21 @@
ctroot.logger.write("SVGHMI:\n")
+ # To serve user provided static files + # - transfer them as file with a prefixed name + # to avoid potential conflicts + # - generate server code that serve them with + # original name as http path + project_path = self.CTNPath() + static_dir = os.path.join(project_path, "static") + static_files_pairs = [] + if os.path.exists(static_dir): + for fname in os.listdir(static_dir): + undercover_fname = location_str+"_"+fname + static_files_pairs.append('("%s","%s")'%(fname, undercover_fname)) + res += ((undercover_fname, open(os.path.join(static_dir, fname), "rb")),) + static_files = ",\n ".join(static_files_pairs) if os.path.exists(svgfile):
@@ -673,6 +700,10 @@
max_svghmi_sessions = {maxConnections_total}
+_{location}_static_files = [ def _runtime_{location}_svghmi_start():
global svghmi_watchdog, svghmi_servers, browser_proc
@@ -699,6 +730,10 @@
path_list.append("{path}")
+ for url_path, file_path in _{location}_static_files: + svghmi_root.putChild(url_path, File(file_path)) + path_list.append(url_path) browser_proc = {svghmi_cmds[Start]}
@@ -723,6 +758,10 @@
path_list.remove('{path}')
+ for url_path, file_path in _{location}_static_files: + svghmi_root.delEntity(url_path) + path_list.remove(url_path) svghmi_root.delEntity(b"ws")
svghmi_listener.stopListening()
@@ -740,6 +779,7 @@
watchdog_interval = self.GetParamsAttributes("SVGHMI.WatchdogInterval")["value"],
maxConnections = self.GetParamsAttributes("SVGHMI.MaxConnections")["value"],
maxConnections_total = svghmilib.maxConnectionsTotal,
+ static_files = static_files, @@ -814,6 +854,62 @@
self.GetCTRoot().logger.write_error(_("POT file does not exist, add translatable text (label starting with '_') in Inkscape first\n"))
+ dialog = wx.FileDialog( + self.GetCTRoot().AppFrame, + _("Choose files so serve"), + os.path.expanduser("~"), + _("Any files (*.*)|*.*"), wx.FD_OPEN) + if dialog.ShowModal() == wx.ID_OK: + staticfile = dialog.GetPath() + if not os.path.isfile(staticfile): + self.GetCTRoot().logger.write_error( + _('Selected file%s is not a readable file\n')%staticfile) + project_path = self.CTNPath() + staticfname = os.path.basename(staticfile) + staticdir = os.path.join(project_path, "static") + newstaticfile = os.path.join(staticdir, staticfname) + if not os.path.exists(staticdir): + shutil.copyfile(staticfile, newstaticfile) + self.GetCTRoot().logger.write( + _('Added file %s as %s\n')%(staticfile,newstaticfile)) + project_path = self.CTNPath() + staticdir = os.path.join(project_path, "static") + if not os.path.exists(staticdir) or len(os.listdir(staticdir))==0 : + self.GetCTRoot().logger.write_error( + _("No file in %s\n")%staticdir) + dialog = wx.FileDialog( + self.GetCTRoot().AppFrame, + _("Choose a file to remove"), + _("Any files (*.*);*.*"), wx.FD_OPEN) + if dialog.ShowModal() == wx.ID_OK: + staticfile = dialog.GetPath() + if os.path.isfile(staticfile): + if os.path.relpath(staticfile, staticdir) == os.path.basename(staticfile): + self.GetCTRoot().logger.write( + _('Removed static file%s\n')%staticfile) + self.GetCTRoot().logger.write_error( + _("StaticFile to remove %s is not in %s\n") % (staticfile,staticdir)) + self.GetCTRoot().logger.write_error( + _("StaticFile file does not exist: %s\n") % staticfile) self.GetCTRoot().AppFrame,
@@ -852,6 +948,10 @@
project_path = self.CTNPath()
fontdir = os.path.join(project_path, "fonts")
+ if not os.path.exists(fontdir) or len(os.listdir(fontdir))==0 : + self.GetCTRoot().logger.write_error( + _("No font file in %s\n")%fontdir) self.GetCTRoot().AppFrame,
_("Choose a font to remove"),
--- a/tests/projects/mqtt_client/plc.xml Sun Jan 05 23:12:53 2025 +0100
+++ b/tests/projects/mqtt_client/plc.xml Thu Jan 09 18:05:45 2025 +0100
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/>
- <contentHeader name="First Steps" modificationDateTime="2024-07-25T16:55:27">
+ <contentHeader name="First Steps" modificationDateTime="2024-12-18T14:47:09"> @@ -41,6 +41,18 @@
+ <variable name="python_eval0"> + <derived name="python_eval"/> + <variable name="python_eval1"> + <derived name="python_eval"/> @@ -52,7 +64,7 @@
<expression>LocalVar0</expression>
<inVariable localId="3" executionOrderId="0" height="27" width="82" negated="false">
- <position x="126" y="224"/>
+ <position x="814" y="106"/> <relPosition x="82" y="13"/>
@@ -224,11 +236,11 @@
<variable formalParameter="IN0">
<relPosition x="0" y="50"/>
- <connection refLocalId="12">
+ <connection refLocalId="3"> <position x="956" y="103"/>
- <position x="927" y="103"/>
- <position x="927" y="115"/>
- <position x="898" y="115"/>
+ <position x="926" y="103"/> + <position x="926" y="119"/> + <position x="896" y="119"/> @@ -238,8 +250,8 @@
<connection refLocalId="13">
<position x="956" y="123"/>
<position x="933" y="123"/>
- <position x="933" y="171"/>
- <position x="910" y="171"/>
+ <position x="933" y="159"/> + <position x="910" y="159"/> @@ -253,20 +265,186 @@
- <inVariable localId="12" executionOrderId="0" height="27" width="34" negated="false">
- <position x="872" y="102"/>
+ <inVariable localId="13" executionOrderId="0" height="27" width="34" negated="false"> + <position x="876" y="146"/> <relPosition x="34" y="13"/>
<expression>666</expression>
- <inVariable localId="13" executionOrderId="0" height="27" width="34" negated="false">
- <position x="876" y="158"/>
+ <block localId="14" typeName="python_eval" instanceName="python_eval0" executionOrderId="0" height="60" width="98"> + <position x="849" y="235"/> + <variable formalParameter="TRIG"> + <relPosition x="0" y="30"/> + <connection refLocalId="8" formalParameter="OUT"> + <position x="849" y="265"/> + <position x="782" y="265"/> + <position x="782" y="199"/> + <position x="794" y="199"/> + <position x="794" y="95"/> + <position x="784" y="95"/> + <variable formalParameter="CODE"> + <relPosition x="0" y="50"/> + <connection refLocalId="16"> + <position x="849" y="285"/> + <position x="797" y="285"/> + <position x="797" y="291"/> + <position x="745" y="291"/> + <variable formalParameter="ACK"> + <relPosition x="98" y="30"/> + <variable formalParameter="RESULT"> + <relPosition x="98" y="50"/> + <inVariable localId="15" executionOrderId="0" height="27" width="354" negated="false"> + <position x="1384" y="186"/> + <relPosition x="354" y="13"/> + <expression>'sys.stdout.write("MQTT PYTHON TEST OK\n")'</expression> + <inVariable localId="16" executionOrderId="0" height="27" width="218" negated="false"> + <position x="527" y="278"/> - <relPosition x="34" y="13"/>
+ <relPosition x="218" y="13"/> - <expression>666</expression>
+ <expression>'publish_example("mhooo")'</expression> + <block localId="12" typeName="python_eval" instanceName="python_eval1" executionOrderId="0" height="60" width="98"> + <position x="1803" y="146"/> + <variable formalParameter="TRIG"> + <relPosition x="0" y="30"/> + <connection refLocalId="19" formalParameter="OUT"> + <position x="1803" y="176"/> + <position x="1472" y="176"/> + <position x="1472" y="173"/> + <position x="1302" y="173"/> + <variable formalParameter="CODE"> + <relPosition x="0" y="50"/> + <connection refLocalId="15"> + <position x="1803" y="196"/> + <position x="1748" y="196"/> + <position x="1748" y="199"/> + <position x="1738" y="199"/> + <variable formalParameter="ACK"> + <relPosition x="98" y="30"/> + <variable formalParameter="RESULT"> + <relPosition x="98" y="50"/> + <block localId="17" typeName="EQ" executionOrderId="0" height="60" width="63"> + <position x="1144" y="204"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="18"> + <position x="1144" y="234"/> + <position x="1114" y="234"/> + <position x="1114" y="235"/> + <position x="1104" y="235"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="50"/> + <connection refLocalId="14" formalParameter="RESULT"> + <position x="1144" y="254"/> + <position x="1063" y="254"/> + <position x="1063" y="285"/> + <position x="947" y="285"/> + <variable formalParameter="OUT"> + <relPosition x="63" y="30"/> + <inVariable localId="18" executionOrderId="0" height="27" width="95" negated="false"> + <position x="1009" y="222"/> + <relPosition x="95" y="13"/> + <expression>'mhooo'</expression> + <block localId="19" typeName="AND" executionOrderId="0" height="60" width="63"> + <position x="1239" y="143"/> + <variable formalParameter="IN1"> + <relPosition x="0" y="30"/> + <connection refLocalId="14" formalParameter="ACK"> + <position x="1239" y="173"/> + <position x="990" y="173"/> + <position x="990" y="265"/> + <position x="947" y="265"/> + <variable formalParameter="IN2"> + <relPosition x="0" y="50"/> + <connection refLocalId="17" formalParameter="OUT"> + <position x="1239" y="193"/> + <position x="1223" y="193"/> + <position x="1223" y="234"/> + <position x="1207" y="234"/> + <variable formalParameter="OUT"> + <relPosition x="63" y="30"/>