lpcmanager

8bc894a439da
Parents b4f9c39fbcda
Children 39171ebf1781
SVGHMI: reflect changes in Beremiz' SVGHMI for multiclient
  • +29 -3
    LPCSVGHMI.py
  • --- a/LPCSVGHMI.py Thu Jun 17 14:58:58 2021 +0200
    +++ b/LPCSVGHMI.py Tue Jul 13 16:04:12 2021 +0200
    @@ -1,7 +1,7 @@
    from svghmi.svghmi import SVGHMI, SVGHMILibrary
    -browser_commandline = 'qt_webenginewidgets_minimal --js-flags="--max_old_space_size=16 --gc_interval=100 --optimize_for_size" --single-process --no-sandbox http://127.0.0.1:{port}/{name}'
    +browser_commandline = 'qt_webenginewidgets_minimal --js-flags="--max_old_space_size=16 --gc_interval=100 --optimize_for_size" --single-process --no-sandbox "{url}"'
    # set default values so that COG browser is managed by SVGHMI
    SVGHMI.XSD = """<?xml version="1.0" encoding="utf-8" ?>
    @@ -10,10 +10,36 @@
    <xsd:complexType>
    <xsd:attribute name="OnStart" type="xsd:string" use="optional" default='"""+browser_commandline+"""'/>
    <xsd:attribute name="OnStop" type="xsd:string" use="optional" default="killall qt_webenginewidgets_minimal"/>
    + <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="true"/>
    <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="sh -c 'killall qt_webenginewidgets_minimal; sleep 1; """+\
    browser_commandline.replace('"', '&quot;')+"""'"/>
    - <xsd:attribute name="WatchdogInitial" type="xsd:integer" use="optional" default="30"/>
    - <xsd:attribute name="WatchdogInterval" type="xsd:integer" use="optional" default="5"/>
    + <xsd:attribute name="WatchdogInitial" use="optional" default="30">
    + <xsd:simpleType>
    + <xsd:restriction base="xsd:integer">
    + <xsd:minInclusive value="2"/>
    + <xsd:maxInclusive value="600"/>
    + </xsd:restriction>
    + </xsd:simpleType>
    + </xsd:attribute>
    + <xsd:attribute name="WatchdogInterval" use="optional" default="5">
    + <xsd:simpleType>
    + <xsd:restriction base="xsd:integer">
    + <xsd:minInclusive value="2"/>
    + <xsd:maxInclusive value="60"/>
    + </xsd:restriction>
    + </xsd:simpleType>
    + </xsd:attribute>
    + <xsd:attribute name="Port" type="xsd:integer" use="optional" default="8008"/>
    + <xsd:attribute name="Interface" type="xsd:string" use="optional" default="localhost"/>
    + <xsd:attribute name="Path" type="xsd:string" use="optional" default="{name}"/>
    + <xsd:attribute name="MaxConnections" use="optional" default="4">
    + <xsd:simpleType>
    + <xsd:restriction base="xsd:integer">
    + <xsd:minInclusive value="1"/>
    + <xsd:maxInclusive value="16"/>
    + </xsd:restriction>
    + </xsd:simpleType>
    + </xsd:attribute>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>