96 shutil.copyfile(self._getSVGpath(from_project_path), |
98 shutil.copyfile(self._getSVGpath(from_project_path), |
97 self._getSVGpath()) |
99 self._getSVGpath()) |
98 return True |
100 return True |
99 |
101 |
100 def GetSVGGeometry(self): |
102 def GetSVGGeometry(self): |
101 # TODO : invoke inskscape -S, csv-parse output, produce elements |
103 # invoke inskscape -S, csv-parse output, produce elements |
102 return [etree.Element("bbox", id="blah0", x="1", y="2", w="3", h="4"), |
104 InkscapeGeomColumns = ["Id", "x", "y", "w", "h"] |
103 etree.Element("bbox", id="blah1", x="5", y="6", w="7", h="8")] |
105 |
|
106 # TODO : move following line to __init__ |
|
107 inkpath = get_inkscape_path() |
|
108 svgpath = self._getSVGpath() |
|
109 _status, result, _err_result = ProcessLogger(None, |
|
110 inkpath + " -S " + svgpath, |
|
111 no_stdout=True, |
|
112 no_stderr=True).spin() |
|
113 res = [] |
|
114 for line in result.split(): |
|
115 strippedline = line.strip() |
|
116 attrs = dict( |
|
117 zip(InkscapeGeomColumns, line.strip().split(','))) |
|
118 |
|
119 res.append(etree.Element("bbox", **attrs)) |
|
120 |
|
121 return res |
104 |
122 |
105 def CTNGenerate_C(self, buildpath, locations): |
123 def CTNGenerate_C(self, buildpath, locations): |
106 """ |
124 """ |
107 Return C code generated by iec2c compiler |
125 Return C code generated by iec2c compiler |
108 when _generate_softPLC have been called |
126 when _generate_softPLC have been called |