dialogs/ConnectionDialog.py
changeset 2587 c67488bd8134
parent 1878 fb73a6b6622d
child 2591 5f685bcd3ad6
equal deleted inserted replaced
2586:b89484560a97 2587:c67488bd8134
   136             # Parameter is connection name
   136             # Parameter is connection name
   137             elif name == "name":
   137             elif name == "name":
   138                 self.ConnectionName.SetValue(value)
   138                 self.ConnectionName.SetValue(value)
   139 
   139 
   140         # Refresh preview panel
   140         # Refresh preview panel
   141         self.RefreshPreview()
   141         self.DrawPreview()
   142 
   142 
   143     def GetValues(self):
   143     def GetValues(self):
   144         """
   144         """
   145         Return connection parameters defined in dialog
   145         Return connection parameters defined in dialog
   146         @return: {parameter_name: parameter_value,...}
   146         @return: {parameter_name: parameter_value,...}
   197     def OnTypeChanged(self, event):
   197     def OnTypeChanged(self, event):
   198         """
   198         """
   199         Called when connection type changed
   199         Called when connection type changed
   200         @param event: wx.RadioButtonEvent
   200         @param event: wx.RadioButtonEvent
   201         """
   201         """
   202         self.RefreshPreview()
   202         self.DrawPreview()
   203         event.Skip()
   203         event.Skip()
   204 
   204 
   205     def OnNameChanged(self, event):
   205     def OnNameChanged(self, event):
   206         """
   206         """
   207         Called when connection name value changed
   207         Called when connection name value changed
   208         @param event: wx.TextEvent
   208         @param event: wx.TextEvent
   209         """
   209         """
   210         self.RefreshPreview()
   210         self.DrawPreview()
   211         event.Skip()
   211         event.Skip()
   212 
   212 
   213     def RefreshPreview(self):
   213     def DrawPreview(self):
   214         """
   214         """
   215         Refresh preview panel of graphic element
   215         Refresh preview panel of graphic element
   216         Override BlockPreviewDialog function
   216         Override BlockPreviewDialog function
   217         """
   217         """
   218         # Set graphic element displayed, creating a FBD connection element
   218         # Set graphic element displayed, creating a FBD connection element
   219         self.Element = FBD_Connector(self.Preview,
   219         self.Element = FBD_Connector(self.Preview,
   220                                      self.GetConnectionType(),
   220                                      self.GetConnectionType(),
   221                                      self.ConnectionName.GetValue())
   221                                      self.ConnectionName.GetValue())
   222 
   222 
   223         # Call BlockPreviewDialog function
   223         # Call BlockPreviewDialog function
   224         BlockPreviewDialog.RefreshPreview(self)
   224         BlockPreviewDialog.DrawPreview(self)