--- a/svghmi/default.svg Mon Jul 12 14:13:29 2021 +0200
+++ b/svghmi/default.svg Mon Jul 12 16:29:55 2021 +0200
@@ -2,6 +2,7 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@@ -9,84 +10,19 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" sodipodi:docname="default.svg"
- inkscape:version="0.92.3 (2405546, 2018-03-11)">
- <dc:format>image/svg+xml</dc:format>
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:document-units="px"
- inkscape:current-layer="hmi0"
- inkscape:cx="576.80864"
- inkscape:cy="330.28432"
- inkscape:window-width="1600"
- inkscape:window-height="886"
- inkscape:window-maximized="1" />
+ inkscape:label="HMI:Page:Home"
- id="desc_page0">This is description for page 0
-all lines in the form "name: value"
-are used as js object definition initializer
-after triple opening braces is global JavaScript code
-alert("Hello World");
-after triple closing braces is back to description
- style="font-style:normal;font-weight:normal;font-size:160px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- inkscape:label="count"><desc
- id="desc5153">path: "count"
-format: "%4.4d"</desc><tspan
- style="stroke-width:1px">8888</tspan></text>
+ style="color:#000000;opacity:1;fill:#d6d6d6;fill-opacity:1" /> --- a/svghmi/svghmi.py Mon Jul 12 14:13:29 2021 +0200
+++ b/svghmi/svghmi.py Mon Jul 12 16:29:55 2021 +0200
@@ -535,7 +535,10 @@
target_file = open(target_path, 'wb')
target_file.write("""<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"> <h1> No SVG file provided </h1>
@@ -548,6 +551,8 @@
port = self.GetParamsAttributes("SVGHMI.Port")["value"]
interface = self.GetParamsAttributes("SVGHMI.Interface")["value"]
path = self.GetParamsAttributes("SVGHMI.Path")["value"].format(name=view_name)
+ if path and path[0]=='/': enable_watchdog = self.GetParamsAttributes("SVGHMI.EnableWatchdog")["value"]
url="http://"+interface+("" if port==80 else (":"+str(port))
) + (("/"+path) if path else ""
@@ -672,7 +677,9 @@
if not os.path.isfile(svgfile):
+ # make a copy of default svg from source + default = os.path.join(ScriptDirectory, "default.svg") + shutil.copyfile(default, svgfile) def _StartPOEdit(self, POFile):
--- a/svghmi/ui.py Mon Jul 12 14:13:29 2021 +0200
+++ b/svghmi/ui.py Mon Jul 12 16:29:55 2021 +0200
@@ -290,6 +290,8 @@
self.Config = wx.ConfigBase.Get()
self.libdir = self.RecallLibDir()
+ if self.libdir is None: + self.libdir = os.path.join(ScriptDirectory, "widgetlib") self.picker_desc_splitter = wx.SplitterWindow(self, style=wx.SUNKEN_BORDER | wx.SP_3D)