SVGHMI: set some boundaries for watchdog timings and max connection count. svghmi
authorEdouard Tisserant
Tue, 13 Jul 2021 16:13:21 +0200
branchsvghmi
changeset 3277 8e81e4ce9bc6
parent 3276 c696ecf5173a
child 3278 2bcfbea6a2a8
SVGHMI: set some boundaries for watchdog timings and max connection count.
svghmi/svghmi.py
--- a/svghmi/svghmi.py	Tue Jul 13 16:12:15 2021 +0200
+++ b/svghmi/svghmi.py	Tue Jul 13 16:13:21 2021 +0200
@@ -290,13 +290,33 @@
           <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="chromium {url}"/>
           <xsd:attribute name="OnStop" type="xsd:string" use="optional" default="echo 'please close chromium window at {url}'"/>
           <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/>
-          <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="chromium {url}"/>
-          <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" type="xsd:integer" use="optional" default="16"/>
+          <xsd:attribute name="MaxConnections" use="optional" default="16">
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:integer">
+                    <xsd:minInclusive value="1"/>
+                    <xsd:maxInclusive value="1024"/>
+                </xsd:restriction>
+            </xsd:simpleType>
+          </xsd:attribute>
         </xsd:complexType>
       </xsd:element>
     </xsd:schema>