Fixed bug with return type in elements that don't need return type tree and dimension
authorLaurent Bessard
Tue, 10 Sep 2013 10:36:44 +0200
changeset 1311 85ca4fa0720b
parent 1310 3d7fa2257b24
child 1312 250c3ae0787c
Fixed bug with return type in elements that don't need return type tree and dimension
PLCControler.py
dialogs/BlockPreviewDialog.py
editors/LDViewer.py
--- a/PLCControler.py	Tue Sep 10 10:35:18 2013 +0200
+++ b/PLCControler.py	Tue Sep 10 10:36:44 2013 +0200
@@ -2376,7 +2376,7 @@
                     if words[0] == "T" and varname == words[2]:
                         return "BOOL"
                     if words[1] == varname:
-                        return self.GetPouInterfaceReturnType(pou)
+                        return self.GetPouInterfaceReturnType(pou)[0]
                     for type, varlist in pou.getvars():
                         for var in varlist.getvariable():
                             if var.getname() == varname:
--- a/dialogs/BlockPreviewDialog.py	Tue Sep 10 10:35:18 2013 +0200
+++ b/dialogs/BlockPreviewDialog.py	Tue Sep 10 10:36:44 2013 +0200
@@ -177,7 +177,7 @@
         
         # Add POU name to variable list if POU is a function 
         returntype = self.Controller.GetEditedElementInterfaceReturnType(
-                                                            self.TagName)
+                                                            self.TagName)[0]
         if returntype is not None:
             self.VariableList[
                 self.Controller.GetEditedElementName(self.TagName)] = \
--- a/editors/LDViewer.py	Tue Sep 10 10:35:18 2013 +0200
+++ b/editors/LDViewer.py	Tue Sep 10 10:36:44 2013 +0200
@@ -487,7 +487,7 @@
             for var in vars:
                 if var["Class"] != "Input" and var["Type"] == "BOOL":
                     varlist.append(var["Name"])
-        returntype = self.Controler.GetEditedElementInterfaceReturnType(self.TagName, self.Debug)
+        returntype = self.Controler.GetEditedElementInterfaceReturnType(self.TagName, self.Debug)[0]
         if returntype == "BOOL":
             varlist.append(self.Controler.GetEditedElementName(self.TagName))
         dialog.SetVariables(varlist)
@@ -801,7 +801,7 @@
                             for var in vars:
                                 if var["Class"] != "Input" and var["Type"] == "BOOL":
                                     varlist.append(var["Name"])
-                        returntype = self.Controler.GetEditedElementInterfaceReturnType(self.TagName, self.Debug)
+                        returntype = self.Controler.GetEditedElementInterfaceReturnType(self.TagName, self.Debug)[0]
                         if returntype == "BOOL":
                             varlist.append(self.Controler.GetEditedElementName(self.TagName))
                         dialog.SetVariables(varlist)