PLCControler.py
changeset 625 b7062a7018ec
parent 622 05394e275a1c
child 629 ddf363817ffa
equal deleted inserted replaced
624:efedc9d06a59 625:b7062a7018ec
   805         if self.Project is not None:
   805         if self.Project is not None:
   806             # Found the resource corresponding to old name and change its name to new name
   806             # Found the resource corresponding to old name and change its name to new name
   807             resource = self.Project.getconfigurationResource(config_name, old_name)
   807             resource = self.Project.getconfigurationResource(config_name, old_name)
   808             if resource is not None:
   808             if resource is not None:
   809                 resource.setname(new_name)
   809                 resource.setname(new_name)
       
   810                 self.BufferProject()
       
   811     
       
   812     # Return the description of the pou given by its name
       
   813     def GetPouDescription(self, name, debug = False):
       
   814         project = self.GetProject(debug)
       
   815         if project is not None:
       
   816             # Found the pou correponding to name and return its type
       
   817             pou = project.getpou(name)
       
   818             if pou is not None:
       
   819                 return pou.getdescription()
       
   820         return ""
       
   821     
       
   822     # Return the description of the pou given by its name
       
   823     def SetPouDescription(self, name, description, debug = False):
       
   824         project = self.GetProject(debug)
       
   825         if project is not None:
       
   826             # Found the pou correponding to name and return its type
       
   827             pou = project.getpou(name)
       
   828             if pou is not None:
       
   829                 pou.setdescription(description)
       
   830                 project.RefreshCustomBlockTypes()
   810                 self.BufferProject()
   831                 self.BufferProject()
   811     
   832     
   812     # Return the type of the pou given by its name
   833     # Return the type of the pou given by its name
   813     def GetPouType(self, name, debug = False):
   834     def GetPouType(self, name, debug = False):
   814         project = self.GetProject(debug)
   835         project = self.GetProject(debug)