--- a/CodeFileTreeNode.py Mon Mar 11 13:51:07 2019 +0100
+++ b/CodeFileTreeNode.py Fri Mar 15 14:11:49 2019 +0100
@@ -209,6 +209,11 @@
if variable.getonchange()])
return ret
+
+ def CTNSearch(self, criteria):
+ # TODO really search
+ return [((self.CTNFullName()), (0,0),(0,3),"cow")]
+
# -------------------------------------------------------------------------------
# Current Buffering Management Functions
# -------------------------------------------------------------------------------
--- a/ConfigTreeNode.py Mon Mar 11 13:51:07 2019 +0100
+++ b/ConfigTreeNode.py Fri Mar 15 14:11:49 2019 +0100
@@ -36,6 +36,7 @@
import traceback
import types
import shutil
+from operator import add
from builtins import str as text
from past.builtins import execfile
@@ -121,6 +122,12 @@
return parent + "." + self.CTNName()
return self.BaseParams.getName()
+ def CTNSearch(self, criteria):
+ # TODO match config's fields name and fields contents
+ return reduce(add, [
+ CTNChild.CTNSearch(criteria)
+ for CTNChild in self.IterChildren()])
+
def GetIconName(self):
return None
--- a/PLCControler.py Mon Mar 11 13:51:07 2019 +0100
+++ b/PLCControler.py Fri Mar 15 14:11:49 2019 +0100
@@ -2749,7 +2749,10 @@
# -------------------------------------------------------------------------------
def SearchInProject(self, criteria):
- return self.Project.Search(criteria)
+ project_matches = self.Project.Search(criteria)
+ print(project_matches)
+ ctn_matches = self.CTNSearch(criteria)
+ return project_matches + ctn_matches
def SearchInPou(self, tagname, criteria, debug=False):
pou = self.GetEditedElement(tagname, debug)