Remove limitation on complex types in POU interface
authorlaurent
Tue, 15 Dec 2009 16:30:39 +0100
changeset 491 d22a4a95fd5e
parent 490 c47a09e1da3e
child 492 73b93ef3f09e
Remove limitation on complex types in POU interface
PLCControler.py
VariablePanel.py
plcopen/plcopen.py
--- a/PLCControler.py	Tue Dec 15 11:31:23 2009 +0100
+++ b/PLCControler.py	Tue Dec 15 16:30:39 2009 +0100
@@ -1245,7 +1245,7 @@
         return blocktypes
 
     # Return Data Types checking for recursion
-    def GetDataTypes(self, tagname = "", basetypes = True, complextypes = True, debug = False):
+    def GetDataTypes(self, tagname = "", basetypes = True, debug = False):
         if basetypes:
             datatypes = self.GetBaseTypes()
         else:
@@ -1256,7 +1256,7 @@
             words = tagname.split("::")
             if words[0] in ["D"]:
                 name = words[1]
-            datatypes.extend(project.GetCustomDataTypes(name, complextypes=complextypes))
+            datatypes.extend(project.GetCustomDataTypes(name))
         return datatypes
 
     # Return Base Type of given possible derived type
--- a/VariablePanel.py	Tue Dec 15 11:31:23 2009 +0100
+++ b/VariablePanel.py	Tue Dec 15 16:30:39 2009 +0100
@@ -761,8 +761,7 @@
             datatype_menu = wx.Menu(title='')
             
             # TODO : remove complextypes argument when matiec can manage complex types in pou interface
-            datatypes = self.Controler.GetDataTypes(basetypes = False, 
-                                                    complextypes = self.Table.GetValueByName(row, "Class") not in ["Input", "Ouput", "InOut"])
+            datatypes = self.Controler.GetDataTypes(basetypes = False)
             for datatype in datatypes:
                 new_id = wx.NewId()
                 AppendMenu(datatype_menu, help='', id=new_id, kind=wx.ITEM_NORMAL, text=datatype)
--- a/plcopen/plcopen.py	Tue Dec 15 11:31:23 2009 +0100
+++ b/plcopen/plcopen.py	Tue Dec 15 16:30:39 2009 +0100
@@ -649,12 +649,10 @@
     setattr(cls, "GetCustomBlockResource", GetCustomBlockResource)
 
     # Return Data Types checking for recursion
-    def GetCustomDataTypes(self, exclude = "", complextypes = True):
+    def GetCustomDataTypes(self, exclude = ""):
         customdatatypes = []
         for customdatatype in self.getdataTypes():
             customdatatype_name = customdatatype.getname()
-            if not complextypes and customdatatype.baseType.getcontent()["name"] in ["array"]:#, "struct"]:
-                continue
             if customdatatype_name != exclude and not self.ElementIsUsedBy(exclude, customdatatype_name):
                 customdatatypes.append(customdatatype_name)
         return customdatatypes