edouard@3936: Pre-made Widget Library edouard@3936: ======================= edouard@3936: edouard@3936: Each widget type such as for example ``HMI:Meter`` can be applied to different edouard@3936: SVG elements to make a new widget in an HMI. edouard@3936: edouard@3936: +------------------------------------+---------------------------------+ edouard@3936: | Meter Widget Template (`HMI:Meter`)| Voltmeter (`HMI:Meter`) | edouard@3936: +====================================+=================================+ edouard@3936: | .. image:: svghmi_meter.svg | .. image:: svghmi_voltmeter.svg | edouard@3936: +------------------------------------+---------------------------------+ edouard@3936: edouard@3936: It is possible to collect customized widgets into libraries in order to re-use edouard@3936: them in future HMI designs. edouard@3936: edouard@3936: edouard@3936: Widget selection and configuration edouard@3936: ---------------------------------- edouard@3936: edouard@3936: SVGHMI comes with a UI dedicated to: edouard@3936: edouard@3936: * Select SVG widget from a library edouard@3936: edouard@3936: Button on top of library tree opens a directory selector dialog to select another widget library. edouard@3936: When a widget is selected in library tree, a miniature of this widget is displayed in preview panel. edouard@3936: edouard@3936: * Set widget arguments edouard@3936: edouard@3936: Given values are checked against expected argument types and boundaries, and validity is shown as a edouard@3936: check mark on the right side of each argument. edouard@3936: edouard@3936: * Bind widget to HMI Tree variables edouard@3936: edouard@3936: Variables are dragged from HMI Tree to text fields in "Widget's variables" section, and then a edouard@3936: valid path corresponding to selected variable is assigned to this field. edouard@3936: edouard@3936: .. image:: svghmi_library_ui.svg edouard@3936: edouard@3936: * Place widget in HMI design edouard@3936: edouard@3936: Once configured, widget is placed in HMI design by dragging widget preview in Inkscape directly. edouard@3936: edouard@3936: .. image:: svghmi_dnd.svg edouard@3936: edouard@3936: edouard@3936: How to create a widget library edouard@3936: ------------------------------ edouard@3936: edouard@3936: A widget library is a directory containing SVG files organized into arbitrarily nested subdirectories. edouard@3936: edouard@3936: Individual SVG file must only contain one widget, no nested widgets, and no pages. edouard@3936: It can be created by simply copying an existing widget into an empty SVG file. edouard@3936: Existing attributes are ignored when using widget from library and can be left as-is.