Adding datatypes defined in ConfNode as possible function return type
authorLaurent Bessard
Tue, 16 Oct 2012 18:58:45 +0200
changeset 853 0f97bddb5a30
parent 852 1009f956d2ee
child 854 c10f2092c43a
Adding datatypes defined in ConfNode as possible function return type
PLCControler.py
controls/VariablePanel.py
--- a/PLCControler.py	Tue Oct 16 11:34:24 2012 +0200
+++ b/PLCControler.py	Tue Oct 16 18:58:45 2012 +0200
@@ -1568,6 +1568,8 @@
             if words[0] in ["D"]:
                 name = words[1]
             datatypes.extend([datatype["name"] for datatype in project.GetCustomDataTypes(name, only_locatables)])
+        for category in self.GetConfNodeDataTypes():
+            datatypes.extend(category["list"])
         return datatypes
 
     # Return Base Type of given possible derived type
--- a/controls/VariablePanel.py	Tue Oct 16 11:34:24 2012 +0200
+++ b/controls/VariablePanel.py	Tue Oct 16 18:58:45 2012 +0200
@@ -580,8 +580,8 @@
         else:
             if self.ElementType == "function":
                 self.ReturnType.Clear()
-                for base_type in self.Controler.GetDataTypes(self.TagName, True, debug=self.Debug):
-                    self.ReturnType.Append(base_type)
+                for data_type in self.Controler.GetDataTypes(self.TagName, debug=self.Debug):
+                    self.ReturnType.Append(data_type)
                 returnType = self.Controler.GetEditedElementInterfaceReturnType(self.TagName)
             description = self.Controler.GetPouDescription(words[1])
             self.PouIsUsed = self.Controler.PouIsUsed(words[1])