# HG changeset patch # User etisserant # Date 1191340813 -7200 # Node ID 3f06a178b960948d7805d770822201c6053d39d8 # Parent 4e3f5b320bc31b1ea84b087a8b8a1d398312b35b Fixed crash while draging connector from pins with undefined types diff -r 4e3f5b320bc3 -r 3f06a178b960 Dialogs.py --- a/Dialogs.py Thu Sep 20 17:38:27 2007 +0200 +++ b/Dialogs.py Tue Oct 02 18:00:13 2007 +0200 @@ -526,7 +526,7 @@ values["name"] = expression else: values["name"] = self.VariableName.GetStringSelection() - values["value_type"] = "" + values["value_type"] = None for var_name, var_type, value_type in self.VarList: if var_name == values["name"]: values["value_type"] = value_type diff -r 4e3f5b320bc3 -r 3f06a178b960 PLCControler.py --- a/PLCControler.py Thu Sep 20 17:38:27 2007 +0200 +++ b/PLCControler.py Tue Oct 02 18:00:13 2007 +0200 @@ -1455,7 +1455,7 @@ for var in varlist.getVariable(): if var.getName() == varname: return var.getType().getValue() - return "" + return None def SetConnectionWires(self, connection, connector): wires = connector.GetWires() @@ -1975,14 +1975,12 @@ instance = element.getInstance(id) if isinstance(instance, plcopen.block): blocktype = instance.getTypeName() - blocktype_infos = GetBlockType(blocktype) - if blocktype_infos["type"] != "function": - if self.CurrentElementEditing != None: - name = self.ElementsOpened[self.CurrentElementEditing] - words = name.split("::") - if words[0] in ["P","T","A"]: - pou = self.Project.getPou(words[1]) - pou.removePouVar(blocktype, instance.getInstanceName()) + if self.CurrentElementEditing != None: + name = self.ElementsOpened[self.CurrentElementEditing] + words = name.split("::") + if words[0] in ["P","T","A"]: + pou = self.Project.getPou(words[1]) + pou.removePouVar(blocktype, instance.getInstanceName()) element.removeInstance(id) self.RefreshPouUsingTree()