# HG changeset patch # User Edouard Tisserant # Date 1664874364 -7200 # Node ID c1796e57affd2530bd11e5777edba13b324892b9 # Parent 1b627c2c743c449e74afbd9bc53b7d2bd77a9fc8 SVGHMI: Update svghmi_references example to demonstrate use of Assign widget. diff -r 1b627c2c743c -r c1796e57affd exemples/svghmi_references/svghmi_0@svghmi/svghmi.svg --- a/exemples/svghmi_references/svghmi_0@svghmi/svghmi.svg Tue Oct 04 11:04:33 2022 +0200 +++ b/exemples/svghmi_references/svghmi_0@svghmi/svghmi.svg Tue Oct 04 11:06:04 2022 +0200 @@ -25,7 +25,7 @@ image/svg+xml - + @@ -90,9 +90,9 @@ inkscape:window-height="836" id="namedview4" showgrid="false" - inkscape:zoom="0.92709556" - inkscape:cx="1883.1062" - inkscape:cy="712.84763" + inkscape:zoom="0.23177389" + inkscape:cx="1502.9251" + inkscape:cy="-465.32787" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -103,7 +103,8 @@ fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" - fit-margin-bottom="0" /> + fit-margin-bottom="0" + inkscape:pagecheckerboard="true" /> + 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:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4, 4;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> Switch widget - - - - - Home - - - - - Swith - - - - - Buttons - - - - declaration of "position" HMI local variable - - - - - Show popup 1 - - - - Show popup 2 - - - + x="76.354057" + y="466.02609" /> + x="496.35406" + y="466.02609" /> + height="190.44576" + x="254.41968" + y="382.29605" /> Page + x="141.59323" + y="402.47458">Page (inkscape) final position in page offset positionoffset positionfor "B" offset positionfor "C" HMI:Switch@... (group) |-. "A" (group) | |- reference (rect) | |- ... |-. "B" (group) | |- frame (rect) | |- ... |-. "C" (group) | |- frame (rect) | |- ... @@ -774,74 +592,280 @@ sodipodi:role="line" x="317.2059" y="99.850906" - id="tspan1259" - style="text-align:start;text-anchor:start;stroke-width:1px">groups that represent the possible states of the widget.groups that represent the possible states of the widget. Since all groups need to appear in the same place, they overlap and Since all groups need to appear in the same place, they overlap the drawing becomes hard to understand and maintain.and the drawing becomes hard to understand and maintain.Using specially labelled "reference" and "frame" rectangles, Using specially labelled "reference" and "frame" rectangles, groups can be spread out. Theses rectangles can be used groups can be spread out. + style="text-align:start;text-anchor:start;stroke-width:1px" + id="tspan474">in widget or anywhere in the drawing, and do not appear in final result. reference + x="137.59323" + y="560.47461">reference frame frame + x="557.59326" + y="560.47461">frame + Button widgets + HMI:Switch@... (group) |- reference (rect) |-. "A" (group) | |- ... |-. "B" (group) | |- frame (rect) | |- ... |-. "C" (group) | |- frame (rect) | |- ... + or + + + simple + + + + with widgets + + + user choice : %s + + + selected dialog : %s + + Switch and Assign widgets can be used together to simulate behavior modal dialog or "popup" with user feedback."selection" and "userChoice" local HMI are used to respectivelyselect dialog to be shown and store user choice.Here, "reference" and "frame" rectangles are necessary toto spread out dialogs and page, otherwise overlapping. + inkscape:label=""simple""> - - - - Close - - A MODAL DIALOG + sodipodi:role="line">A SIMPLE MODAL DIALOG + + + OK + + + + Cancel + + + + + X + + + inkscape:label=""withWidgets""> - - - - Close - - A MODAL DIALOGA MODAL DIALOGwith widgets + y="1068.5115">with widgets + + + + X + + + + :dialog="None" +:return="Applied" +:plcvar=uservar +@dialog=selection +@return=userChoice +@uservar=.position +@plcvar=/PLCHMIVAR + + Apply + + + + In this example, 3 types of button ar connected to the sameHMI local variable. Here, "reference" and "frame" rectangles are used toseparate active and inactive state of buttons + A + B + C + + + Page (final result) + + + A + + + + B + + + + C + + + + + + + Home + + + + + Swith + + + + + Buttons - + + declaration of user_level HMI local variabledeclaration of "position" HMI local variable + + + declaration of 'selection' local variable + + + declaration of 'userChoice' local variable + + + (not a PLC variable) - - - declaration of "range" HMI local variable + + + declaration of "range" HMI local variable - - - declaration of "size" HMI local variable + + + declaration of "size" HMI local variable - - Button widgets - - declaration of "position" HMI local variable + id="text193">declaration of "position" HMI local variable +