# HG changeset patch # User Edouard Tisserant # Date 1713201197 -7200 # Node ID 129202e555e0cb0bfab8ae0b91e1e1c248a0fca9 # Parent 62d04933d56922fa44747afd24509f1311ed1f5b More documentation. Work in progress. diff -r 62d04933d569 -r 129202e555e0 doc/programming/configuration.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/programming/configuration.rst Mon Apr 15 19:13:17 2024 +0200 @@ -0,0 +1,16 @@ +Configuration Tree +================== + +Project (Root) node +------------------- + +.. _project-files: + +Project files +^^^^^^^^^^^^^ + +Types and POUS +-------------- + +Extensions +---------- diff -r 62d04933d569 -r 129202e555e0 doc/programming/connect.rst --- a/doc/programming/connect.rst Mon Apr 15 09:09:59 2024 +0200 +++ b/doc/programming/connect.rst Mon Apr 15 19:13:17 2024 +0200 @@ -96,3 +96,10 @@ .. TODO : crossbar server setup with example config and minimal backend. + + +About Security +-------------- + + .. + TODO : diff -r 62d04933d569 -r 129202e555e0 doc/programming/index.rst --- a/doc/programming/index.rst Mon Apr 15 09:09:59 2024 +0200 +++ b/doc/programming/index.rst Mon Apr 15 19:13:17 2024 +0200 @@ -7,6 +7,7 @@ :maxdepth: 2 create + configuration edit connect run diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/configuration.rst --- a/doc/svghmi/configuration.rst Mon Apr 15 09:09:59 2024 +0200 +++ b/doc/svghmi/configuration.rst Mon Apr 15 19:13:17 2024 +0200 @@ -1,14 +1,55 @@ -Configure SVGHMI instances -========================== +SVGHMI instances configuration +============================== -Ports and interfaces --------------------- +.. list-table:: + + * - Multiple SVGHMI instances can be configured simultaneously in the same Beremiz :doc:`../programming/configuration`, exposing different HMIs. + + .. image:: svghmi_multi.png + + - .. figure:: svghmi_configuration.png + + SVGHMI configuration panel + +Ports, interfaces, path and MaxConnections +------------------------------------------ + + Each SVGHMI instance must bind to different interface-port-path triplet. In case of conflict, a build error is issued. + + By default, interface is set to ``localhost``, port to ``8008`` and path is set to :doc:`../programming/configuration` Node's name: ``{name}``. + As an example, in case SVGHMI instance is first node in :doc:`../programming/configuration`, default URL to reach HMI is ``http://localhost:8008/svghmi_0`` + + Up to ``MaxConnections`` clients (i.e. web browser) can connect to the same SVGHMI instance simultaneously. + This number has an influence on memory footprint of generated code. + In case of repeated connection loss with long TCP `TTL `_, small ``MaxConnections`` number can lead to connection refusal. + + + +About Security +^^^^^^^^^^^^^^ + + .. + TODO : + Watchdog -------- -Launching browser ------------------ + Purpose of SVGHMI watchdog is to detect if HMI is still functioning and connected to PLC. + ``/HEARTBEAT`` variable is periodically updated by PLC and HMI to detect failure. + + When SVHGMI server doesn't receive HMI heartbeat in due time, watchdog is triggered, and ``OnWatchdog`` command is executed. + For example, ``OnWatchdog`` can be used to restart a new web browser in case it did crash. -Static files ------------- \ No newline at end of file + Only one single client can use watchdog at a time, and ``Watchdog`` configuration setting can be active on only one SVGHMI instance at a time. + + ``WatchdogInitial`` and ``WatchdogInterval`` define how long watchdog will accept to wait before receiving first heartbeat, + and then how long it will wait in between heartbeats once first heartbeat has been received. + + +Starting and stopping browser +----------------------------- + + ``OnStart`` and ``OnStop`` configuration settings are commands meant control web browser execution when PLC is started or stopped. + PID of commands are monitored, and the end of web browser process is awaited after command. + If web browser process isn't finished 3s after calling ``OnStop`` command, warning is logged. diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/fonts.rst --- a/doc/svghmi/fonts.rst Mon Apr 15 09:09:59 2024 +0200 +++ b/doc/svghmi/fonts.rst Mon Apr 15 19:13:17 2024 +0200 @@ -1,11 +1,57 @@ Include fonts in HMI ==================== -Inkscape uses system fonts --------------------------- +Text inside HMI designed with Inkscape may not display properly in web browser. +The reason is that Inkscape and targeted web browser may disagree on fonts support. -Supported font types --------------------- +To keep HMI text design consistent, missing fonts can be added to project in order +to have them served together with HMI so that web browser can support them. + +Fonts used by Inkscape +---------------------- + +* System fonts + + Vector fonts available at system level are systematically available + in Inkscape + +* User fonts + + When selected in Inkscape preferences, Inkscape also considers fonts + from these sources: + + - "fonts" directory in Inkscape user's directory + + - arbitrary absolute font directories set by user + + There is no way to point to a directory relative to the SVG file + being edited. + At the time of writing this documentation, Inkscape doesn't support + embedding font in SVG file. + + User then have to regularly update Inkscape preferences to ensure + that fonts used in currently edited design are available when editing + it. + + +Supported font types in SVGHMI +------------------------------ + + * Web Open Font Format 1 and 2 + + ``.woff```, ``.woff2`` + + * TrueType fonts + + ``.ttf`` + + * OpenType fonts + + ``.otf`` + + .. note:: + + In order to be embedded in HMI, fonts are encoded base64 Add/remove fonts ---------------- \ No newline at end of file diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/index.rst --- a/doc/svghmi/index.rst Mon Apr 15 09:09:59 2024 +0200 +++ b/doc/svghmi/index.rst Mon Apr 15 19:13:17 2024 +0200 @@ -16,4 +16,5 @@ i18n fonts hacking - widgets \ No newline at end of file + widgets + library \ No newline at end of file diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/library.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/svghmi/library.rst Mon Apr 15 19:13:17 2024 +0200 @@ -0,0 +1,53 @@ +Pre-made Widget Library +======================= + +Each widget type such as for example ``HMI:Meter`` can be applied to different +SVG elements to make a new widget in an HMI. + ++------------------------------------+---------------------------------+ +| Meter Widget Template (`HMI:Meter`)| Voltmeter (`HMI:Meter`) | ++====================================+=================================+ +| .. image:: svghmi_meter.svg | .. image:: svghmi_voltmeter.svg | ++------------------------------------+---------------------------------+ + +It is possible to collect customized widgets into libraries in order to re-use +them in future HMI designs. + + +Widget selection and configuration +---------------------------------- + +SVGHMI comes with a UI dedicated to: + + * Select SVG widget from a library + + Button on top of library tree opens a directory selector dialog to select another widget library. + When a widget is selected in library tree, a miniature of this widget is displayed in preview panel. + + * Set widget arguments + + Given values are checked against expected argument types and boundaries, and validity is shown as a + check mark on the right side of each argument. + + * Bind widget to HMI Tree variables + + Variables are dragged from HMI Tree to text fields in "Widget's variables" section, and then a + valid path corresponding to selected variable is assigned to this field. + + .. image:: svghmi_library_ui.svg + + * Place widget in HMI design + + Once configured, widget is placed in HMI design by dragging widget preview in Inkscape directly. + + .. image:: svghmi_dnd.svg + + +How to create a widget library +------------------------------ + + A widget library is a directory containing SVG files organized into arbitrarily nested subdirectories. + + Individual SVG file must only contain one widget, no nested widgets, and no pages. + It can be created by simply copying an existing widget into an empty SVG file. + Existing attributes are ignored when using widget from library and can be left as-is. \ No newline at end of file diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/pages.rst --- a/doc/svghmi/pages.rst Mon Apr 15 09:09:59 2024 +0200 +++ b/doc/svghmi/pages.rst Mon Apr 15 19:13:17 2024 +0200 @@ -34,11 +34,15 @@ HMI:Page:PageName@RootPath +Example:: + + HMI:Page:PumpControl@/PUMP0 + .. image:: svghmi_relative.svg -Jump and Back -------------- +Jumps +----- ``HMI:Jump`` can have ``inactive``, ``active`` and ``disabled`` labeled children: @@ -49,19 +53,34 @@ Relative page label:: - HMI:Jump:PageName[@RelativePath] + HMI:Jump:PageName@RelativePath Absolute page label:: HMI:Jump:PageName +Example:: -``HMI:Back`` takes no parameter and just go back one step in page change history. + HMI:Jump:PumpControl@/PUMP7 -Special ``/CURRENTPAGE_N`` variable +Back: Jump to previous page +---------------------------- + +``HMI:Back`` takes no parameter and goes back one step in page change history when clicked. + + +Special ``/CURRENT_PAGE_n`` variable ----------------------------------- +Each SVGHMI instance have its own ``/CURRENT_PAGE_n``, with ``n`` being the position of SVGHMI instance in Configuration Tree. + +By reading ``/CURRENT_PAGE_n`` value, PLC knows last page being displayed in HMI. Variable is of type STRING, and formatted as follows:: + + PageName + + + .. TODO @@ -74,6 +93,9 @@ .. TODO +Discarded element +----------------- + References frames ----------------- diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/svghmi_configuration.png Binary file doc/svghmi/svghmi_configuration.png has changed diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/svghmi_library_ui.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/svghmi/svghmi_library_ui.svg Mon Apr 15 19:13:17 2024 +0200 @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HMI tree + Attributes + Description + Library + Preview + D'n'D + + + + + + + + diff -r 62d04933d569 -r 129202e555e0 doc/svghmi/svghmi_multi.png Binary file doc/svghmi/svghmi_multi.png has changed