PLCControler.py
changeset 625 b7062a7018ec
parent 622 05394e275a1c
child 629 ddf363817ffa
--- a/PLCControler.py	Thu Jan 12 17:04:22 2012 +0100
+++ b/PLCControler.py	Tue Jan 17 16:44:00 2012 +0100
@@ -809,6 +809,27 @@
                 resource.setname(new_name)
                 self.BufferProject()
     
+    # Return the description of the pou given by its name
+    def GetPouDescription(self, name, debug = False):
+        project = self.GetProject(debug)
+        if project is not None:
+            # Found the pou correponding to name and return its type
+            pou = project.getpou(name)
+            if pou is not None:
+                return pou.getdescription()
+        return ""
+    
+    # Return the description of the pou given by its name
+    def SetPouDescription(self, name, description, debug = False):
+        project = self.GetProject(debug)
+        if project is not None:
+            # Found the pou correponding to name and return its type
+            pou = project.getpou(name)
+            if pou is not None:
+                pou.setdescription(description)
+                project.RefreshCustomBlockTypes()
+                self.BufferProject()
+    
     # Return the type of the pou given by its name
     def GetPouType(self, name, debug = False):
         project = self.GetProject(debug)