297 on_hmitree_update(hmi_tree_root) |
297 on_hmitree_update(hmi_tree_root) |
298 |
298 |
299 return ret |
299 return ret |
300 |
300 |
301 if wx.Platform == '__WXMSW__': |
301 if wx.Platform == '__WXMSW__': |
302 browser_launch_cmd="cmd.exe /c 'start msedge {url}'" |
302 default_cmds={ |
|
303 "launch":"cmd.exe /c 'start msedge {url}'", |
|
304 "watchdog":"cmd.exe /k 'echo watchdog for {url} !'"} |
303 else: |
305 else: |
304 browser_launch_cmd="chromium {url}" |
306 default_cmds={ |
|
307 "launch":"chromium {url}", |
|
308 "watchdog":"echo Watchdog for {name} !"} |
305 |
309 |
306 class SVGHMI(object): |
310 class SVGHMI(object): |
307 XSD = """<?xml version="1.0" encoding="utf-8" ?> |
311 XSD = """<?xml version="1.0" encoding="utf-8" ?> |
308 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
312 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
309 <xsd:element name="SVGHMI"> |
313 <xsd:element name="SVGHMI"> |
310 <xsd:complexType> |
314 <xsd:complexType> |
311 <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%s"/> |
315 <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%(launch)s"/> |
312 <xsd:attribute name="OnStop" type="xsd:string" use="optional" default=""/> |
316 <xsd:attribute name="OnStop" type="xsd:string" use="optional" default=""/> |
313 <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default=""/> |
317 <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="%(watchdog)s"/> |
314 <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/> |
318 <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/> |
315 <xsd:attribute name="WatchdogInitial" use="optional" default="30"> |
319 <xsd:attribute name="WatchdogInitial" use="optional" default="30"> |
316 <xsd:simpleType> |
320 <xsd:simpleType> |
317 <xsd:restriction base="xsd:integer"> |
321 <xsd:restriction base="xsd:integer"> |
318 <xsd:minInclusive value="2"/> |
322 <xsd:minInclusive value="2"/> |
397 |
401 |
398 def OnCTNSave(self, from_project_path=None): |
402 def OnCTNSave(self, from_project_path=None): |
399 if from_project_path is not None: |
403 if from_project_path is not None: |
400 shutil.copyfile(self._getSVGpath(from_project_path), |
404 shutil.copyfile(self._getSVGpath(from_project_path), |
401 self._getSVGpath()) |
405 self._getSVGpath()) |
402 shutil.copyfile(self._getPOTpath(from_project_path), |
406 |
403 self._getPOTpath()) |
407 potpath = self._getPOTpath(from_project_path) |
404 # XXX TODO copy .PO files |
408 if os.path.isfile(potpath): |
|
409 shutil.copyfile(potpath, self._getPOTpath()) |
|
410 # copy .PO files |
|
411 for _name, pofile in GetPoFiles(from_project_path): |
|
412 shutil.copy(pofile, self.CTNPath()) |
405 return True |
413 return True |
406 |
414 |
407 def GetSVGGeometry(self): |
415 def GetSVGGeometry(self): |
408 self.ProgressStart("inkscape", "collecting SVG geometry (Inkscape)") |
416 self.ProgressStart("inkscape", "collecting SVG geometry (Inkscape)") |
409 # invoke inskscape -S, csv-parse output, produce elements |
417 # invoke inskscape -S, csv-parse output, produce elements |