def OnBrowseButton(event): dialog = BrowseValuesLibraryDialog(self, name, library, infos[0]) if dialog.ShowModal() == wx.ID_OK: value, value_infos = self.SetConfNodeParamsAttribute(path, dialog.GetValueInfos()) textctrl.ChangeValue(value) infos[0] = value_infos # dialog.Destroy() event.Skip()
def OnAddEthercatSlave(self, event): app_frame = self.GetCTRoot().AppFrame dialog = BrowseValuesLibraryDialog(app_frame, _("Ethercat Slave Type"), self.GetSlaveTypesLibrary()) if dialog.ShowModal() == wx.ID_OK: type_infos = dialog.GetValueInfos() device, _module_extra_params = self.GetModuleInfos(type_infos) if device is not None: if HAS_MCL and str(_EthercatCIA402SlaveCTN.NODE_PROFILE ) in device.GetProfileNumbers(): ConfNodeType = "EthercatCIA402Slave" else: ConfNodeType = "EthercatSlave" new_child = self.CTNAddChild("%s_0" % ConfNodeType, ConfNodeType) new_child.SetParamsAttribute("SlaveParams.Type", type_infos) self.CTNRequestSave() new_child._OpenView() app_frame._Refresh(TITLE, FILEMENU, PROJECTTREE) dialog.Destroy()