PLCControler.py
changeset 1222 775b48a2be3b
parent 1186 0ce4104d58ed
child 1223 d51cea72baa7
equal deleted inserted replaced
1221:d18ccec78117 1222:775b48a2be3b
   559                     var_type = vartype_content["value"].getname()
   559                     var_type = vartype_content["value"].getname()
   560                     if var_type == pou_type:
   560                     if var_type == pou_type:
   561                         instances.append(var_path)
   561                         instances.append(var_path)
   562                     else:
   562                     else:
   563                         pou = project.getpou(var_type)
   563                         pou = project.getpou(var_type)
   564                         if pou is not None:
   564                         if pou is not None and project.ElementIsUsedBy(pou_type, var_type):
   565                             instances.extend(
   565                             instances.extend(
   566                                 self.RecursiveSearchPouInstances(
   566                                 self.RecursiveSearchPouInstances(
   567                                     project, pou_type, var_path, 
   567                                     project, pou_type, var_path, 
   568                                     [varlist for type, varlist in pou.getvars()], 
   568                                     [varlist for type, varlist in pou.getvars()], 
   569                                     debug))
   569                                     debug))
   594                             pou_path = "%s.%s" % (res_path, pou_instance.getname())
   594                             pou_path = "%s.%s" % (res_path, pou_instance.getname())
   595                             pou_type = pou_instance.gettypeName()
   595                             pou_type = pou_instance.gettypeName()
   596                             if pou_type == words[1]:
   596                             if pou_type == words[1]:
   597                                 instances.append(pou_path)
   597                                 instances.append(pou_path)
   598                             pou = project.getpou(pou_type)
   598                             pou = project.getpou(pou_type)
   599                             if pou is not None:
   599                             if pou is not None and project.ElementIsUsedBy(words[1], pou_type):
   600                                 instances.extend(
   600                                 instances.extend(
   601                                     self.RecursiveSearchPouInstances(
   601                                     self.RecursiveSearchPouInstances(
   602                                         project, words[1], pou_path, 
   602                                         project, words[1], pou_path, 
   603                                         [varlist for type, varlist in pou.getvars()], 
   603                                         [varlist for type, varlist in pou.getvars()], 
   604                                         debug))
   604                                         debug))