controls/SearchResultPanel.py
changeset 1948 b9a3f771aaab
parent 1884 48bd91d7a0ae
child 2177 10aa87518401
equal deleted inserted replaced
1947:7c2cd9d33070 1948:b9a3f771aaab
    30 import wx.lib.buttons
    30 import wx.lib.buttons
    31 import wx.lib.agw.customtreectrl as CT
    31 import wx.lib.agw.customtreectrl as CT
    32 
    32 
    33 from PLCControler import *
    33 from PLCControler import *
    34 from util.BitmapLibrary import GetBitmap
    34 from util.BitmapLibrary import GetBitmap
       
    35 from plcopen.types_enums import GetElementType
    35 
    36 
    36 
    37 
    37 def GenerateName(infos):
    38 def GenerateName(infos):
    38     if infos[0] in ["input", "output", "value"]:
    39     if infos[0] in ["input", "output", "value"]:
    39         return "%s %d:" % (infos[0], infos[1])
    40         return "%s %d:" % (infos[0], infos[1])
   194                 results = self.SearchResults.get(tagname, [])
   195                 results = self.SearchResults.get(tagname, [])
   195                 matches_number += len(results)
   196                 matches_number += len(results)
   196 
   197 
   197                 words = tagname.split("::")
   198                 words = tagname.split("::")
   198 
   199 
   199                 element_type = self.ParentWindow.Controler.GetElementType(tagname)
   200                 element_type = GetElementType(tagname)
   200                 if element_type == ITEM_POU:
   201                 if element_type == ITEM_POU:
   201                     element_type = self.ParentWindow.Controler.GetPouType(words[1])
   202                     element_type = self.ParentWindow.Controler.GetPouType(words[1])
   202 
   203 
   203                 element_infos = {"name": words[-1],
   204                 element_infos = {"name": words[-1],
   204                                  "type": element_type,
   205                                  "type": element_type,