Viewer.py
changeset 198 4768050433b8
parent 195 d9084f6eecfd
child 202 e219803fdd11
equal deleted inserted replaced
197:8023d02d78ed 198:4768050433b8
   108                 if values[1] != "function" and blockname == "":
   108                 if values[1] != "function" and blockname == "":
   109                     dialog = wx.TextEntryDialog(self.ParentWindow, "Block name", "Please enter a block name", "", wx.OK|wx.CANCEL|wx.CENTRE)
   109                     dialog = wx.TextEntryDialog(self.ParentWindow, "Block name", "Please enter a block name", "", wx.OK|wx.CANCEL|wx.CENTRE)
   110                     if dialog.ShowModal():
   110                     if dialog.ShowModal():
   111                         blockname = dialog.GetValue()
   111                         blockname = dialog.GetValue()
   112                     dialog.Destroy()
   112                     dialog.Destroy()
   113                 if blockname.upper() not in [name.upper() for name in self.ParentWindow.Controler.GetProjectPouNames()]:
   113                 if blockname.upper() in [name.upper() for name in self.ParentWindow.Controler.GetProjectPouNames()]:
   114                     message = wx.MessageDialog(self.ParentWindow, "\"%s\" pou already exists!"%blockname, "Error", wx.OK|wx.ICON_ERROR)
   114                     message = wx.MessageDialog(self.ParentWindow, "\"%s\" pou already exists!"%blockname, "Error", wx.OK|wx.ICON_ERROR)
   115                     message.ShowModal()
   115                     message.ShowModal()
   116                     message.Destroy()
   116                     message.Destroy()
   117                 elif blockname.upper() not in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(self.ParentWindow.GetTagName())]:
   117                 elif blockname.upper() in [name.upper() for name in self.ParentWindow.Controler.GetEditedElementVariables(self.ParentWindow.GetTagName())]:
   118                     message = wx.MessageDialog(self.ParentWindow, "\"%s\" element for this pou already exists!"%blockname, "Error", wx.OK|wx.ICON_ERROR)
   118                     message = wx.MessageDialog(self.ParentWindow, "\"%s\" element for this pou already exists!"%blockname, "Error", wx.OK|wx.ICON_ERROR)
   119                     message.ShowModal()
   119                     message.ShowModal()
   120                     message.Destroy()
   120                     message.Destroy()
   121                 else:
   121                 else:
   122                     id = self.ParentWindow.GetNewId()
   122                     id = self.ParentWindow.GetNewId()