33 from lxml import etree |
33 from lxml import etree |
34 from xmlclass import GenerateParserFromXSDstring |
34 from xmlclass import GenerateParserFromXSDstring |
35 |
35 |
36 from PLCControler import UndoBuffer |
36 from PLCControler import UndoBuffer |
37 from ConfigTreeNode import XSDSchemaErrorMessage |
37 from ConfigTreeNode import XSDSchemaErrorMessage |
|
38 |
|
39 from plcopen.plcopen import TestTextElement |
38 |
40 |
39 CODEFILE_XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?> |
41 CODEFILE_XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?> |
40 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
42 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
41 xmlns:xhtml="http://www.w3.org/1999/xhtml"> |
43 xmlns:xhtml="http://www.w3.org/1999/xhtml"> |
42 <xsd:element name="%(codefile_name)s"> |
44 <xsd:element name="%(codefile_name)s"> |
210 return ret |
212 return ret |
211 |
213 |
212 |
214 |
213 def CTNSearch(self, criteria): |
215 def CTNSearch(self, criteria): |
214 # TODO really search |
216 # TODO really search |
215 return [((self.CTNFullName(),"var_inout",1,"name"), (0,2),(0,4),"a_cow"), |
217 variables = self.GetVariables() |
|
218 results = [] |
|
219 tagname = self.CTNFullName() |
|
220 for index, var in enumerate(variables): |
|
221 varname = var["Name"] |
|
222 results.extend([((tagname, "var_inout", index, "name"),) + result |
|
223 for result in TestTextElement(varname, criteria)]) |
|
224 print("FFFFFFFFFF", results) |
|
225 return results + [((self.CTNFullName(),"var_inout",1,"name"), (0,2),(0,4),"a_cow"), |
216 ((self.CTNFullName(),"body"), (1,12),(1,15),"Bitch I'm a cow !")] |
226 ((self.CTNFullName(),"body"), (1,12),(1,15),"Bitch I'm a cow !")] |
217 |
227 |
218 # ------------------------------------------------------------------------------- |
228 # ------------------------------------------------------------------------------- |
219 # Current Buffering Management Functions |
229 # Current Buffering Management Functions |
220 # ------------------------------------------------------------------------------- |
230 # ------------------------------------------------------------------------------- |