svghmi/svghmi.py
changeset 3348 cfac764413dd
parent 3341 dce1d5413310
child 3372 e5cb7447320c
equal deleted inserted replaced
3347:f31f062703a2 3348:cfac764413dd
   292 
   292 
   293         on_hmitree_update(hmi_tree_root)
   293         on_hmitree_update(hmi_tree_root)
   294 
   294 
   295         return ret
   295         return ret
   296 
   296 
       
   297 if wx.Platform == '__WXMSW__':
       
   298     browser_launch_cmd="cmd.exe /c 'start msedge {url}'"
       
   299 else:
       
   300     browser_launch_cmd="chromium {url}"
       
   301 
   297 class SVGHMI(object):
   302 class SVGHMI(object):
   298     XSD = """<?xml version="1.0" encoding="utf-8" ?>
   303     XSD = """<?xml version="1.0" encoding="utf-8" ?>
   299     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   304     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   300       <xsd:element name="SVGHMI">
   305       <xsd:element name="SVGHMI">
   301         <xsd:complexType>
   306         <xsd:complexType>
   302           <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="chromium {url}"/>
   307           <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%s"/>
   303           <xsd:attribute name="OnStop" type="xsd:string" use="optional" default="echo 'please close chromium window at {url}'"/>
   308           <xsd:attribute name="OnStop" type="xsd:string" use="optional" default=""/>
   304           <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="echo 'Watchdog for {name} !'"/>
   309           <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default=""/>
   305           <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/>
   310           <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/>
   306           <xsd:attribute name="WatchdogInitial" use="optional" default="30">
   311           <xsd:attribute name="WatchdogInitial" use="optional" default="30">
   307             <xsd:simpleType>
   312             <xsd:simpleType>
   308                 <xsd:restriction base="xsd:integer">
   313                 <xsd:restriction base="xsd:integer">
   309                     <xsd:minInclusive value="2"/>
   314                     <xsd:minInclusive value="2"/>
   331             </xsd:simpleType>
   336             </xsd:simpleType>
   332           </xsd:attribute>
   337           </xsd:attribute>
   333         </xsd:complexType>
   338         </xsd:complexType>
   334       </xsd:element>
   339       </xsd:element>
   335     </xsd:schema>
   340     </xsd:schema>
   336     """
   341     """%browser_launch_cmd
   337 
   342 
   338     EditorType = SVGHMIEditor
   343     EditorType = SVGHMIEditor
   339 
   344 
   340     ConfNodeMethods = [
   345     ConfNodeMethods = [
   341         {
   346         {